Commit b0ca5495 authored by renjie's avatar renjie

绑定记录

parent 11d018bc
......@@ -7,6 +7,7 @@ import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Document(collection = "ipresource")
......@@ -25,7 +26,7 @@ public class IpResource {
private long purchasedTime;
private long validTime;
private String details;
List<BindHistory> bindHistory = new ArrayList<>();
List<HashMap<String, String>> bindHistory = new ArrayList<>();
private boolean isDeleted;
private String username;
private String owner;
......@@ -83,11 +84,11 @@ public class IpResource {
this.ipType = ipType;
}
public List<BindHistory> getBindHistory() {
public List<HashMap<String, String>> getBindHistory() {
return bindHistory;
}
public void setBindHistory(List<BindHistory> bindHistory) {
public void setBindHistory(List<HashMap<String, String>> bindHistory) {
this.bindHistory = bindHistory;
}
......
......@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
......@@ -285,12 +286,12 @@ public class ShopServiceImpl implements ShopService {
if (!ipResource.getId().equals(shop.getIpId()))
throw new ClientRequestException(BrowserErrorCode.IPNOTBINDTOSHOP);
try {
List<BindHistory> history = ipResource.getBindHistory();
BindHistory bindHistory = new BindHistory();
bindHistory.setIp(ipResource.getAddr());
bindHistory.setPlatform(shop.getShopPlatform());
bindHistory.setShopName(shop.getShopName());
history.add(bindHistory);
List<HashMap<String, String>> history = ipResource.getBindHistory();
HashMap<String, String> map = new HashMap<>();
map.put("shopName", shop.getShopName());
map.put("platform", shop.getShopPlatform());
map.put("ip", ipResource.getAddr());
history.add(map);
shop.setIp(null);
shop.setIpId(null);
shop.setIpRegion(null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment