Commit b0ca5495 authored by renjie's avatar renjie

绑定记录

parent 11d018bc
...@@ -7,6 +7,7 @@ import org.springframework.data.annotation.Transient; ...@@ -7,6 +7,7 @@ import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
@Document(collection = "ipresource") @Document(collection = "ipresource")
...@@ -25,7 +26,7 @@ public class IpResource { ...@@ -25,7 +26,7 @@ public class IpResource {
private long purchasedTime; private long purchasedTime;
private long validTime; private long validTime;
private String details; private String details;
List<BindHistory> bindHistory = new ArrayList<>(); List<HashMap<String, String>> bindHistory = new ArrayList<>();
private boolean isDeleted; private boolean isDeleted;
private String username; private String username;
private String owner; private String owner;
...@@ -83,11 +84,11 @@ public class IpResource { ...@@ -83,11 +84,11 @@ public class IpResource {
this.ipType = ipType; this.ipType = ipType;
} }
public List<BindHistory> getBindHistory() { public List<HashMap<String, String>> getBindHistory() {
return bindHistory; return bindHistory;
} }
public void setBindHistory(List<BindHistory> bindHistory) { public void setBindHistory(List<HashMap<String, String>> bindHistory) {
this.bindHistory = bindHistory; this.bindHistory = bindHistory;
} }
......
...@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -285,12 +286,12 @@ public class ShopServiceImpl implements ShopService { ...@@ -285,12 +286,12 @@ public class ShopServiceImpl implements ShopService {
if (!ipResource.getId().equals(shop.getIpId())) if (!ipResource.getId().equals(shop.getIpId()))
throw new ClientRequestException(BrowserErrorCode.IPNOTBINDTOSHOP); throw new ClientRequestException(BrowserErrorCode.IPNOTBINDTOSHOP);
try { try {
List<BindHistory> history = ipResource.getBindHistory(); List<HashMap<String, String>> history = ipResource.getBindHistory();
BindHistory bindHistory = new BindHistory(); HashMap<String, String> map = new HashMap<>();
bindHistory.setIp(ipResource.getAddr()); map.put("shopName", shop.getShopName());
bindHistory.setPlatform(shop.getShopPlatform()); map.put("platform", shop.getShopPlatform());
bindHistory.setShopName(shop.getShopName()); map.put("ip", ipResource.getAddr());
history.add(bindHistory); history.add(map);
shop.setIp(null); shop.setIp(null);
shop.setIpId(null); shop.setIpId(null);
shop.setIpRegion(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