Commit 091da1f1 authored by renjie's avatar renjie

绑定记录

parent 4b9ede7b
......@@ -21,6 +21,7 @@ public class IpResourceDto {
private String password;
private List<String> protocol;
ShopDto bindShop;
private List<BindHistory> bindHistories;
public IpResourceDto(){
}
......@@ -39,6 +40,7 @@ public class IpResourceDto {
this.password = ipResource.getPassword();
this.protocol = ipResource.getProtocol();
this.bindShop = shopDto;
this.bindHistories = ipResource.getBindHistory();
}
public String getId() {
......@@ -144,4 +146,12 @@ public class IpResourceDto {
public void setProtocol(List<String> protocol) {
this.protocol = protocol;
}
public List<BindHistory> getBindHistories() {
return bindHistories;
}
public void setBindHistories(List<BindHistory> bindHistories) {
this.bindHistories = bindHistories;
}
}
......@@ -9,11 +9,10 @@ public class BindHistoryToString implements Converter<BindHistory, String> {
@Override
public String convert(BindHistory bindHistory) {
return "BindHistory{" +
"shopName=\"" + bindHistory.getShopName() + "\"" +
", ip=\"" + bindHistory.getIp() + "\"" +
", platform=\"" + bindHistory.getPlatform() + "\"" +
", unbindTime=\"" + bindHistory.getUnbindTime() + "\"" +
"}";
return "{ shopName=" + new Character('"') + bindHistory.getShopName() + new Character('"') +
", ip=" + new Character('"') + bindHistory.getIp() + new Character('"') +
", platform=" + new Character('"') + bindHistory.getPlatform() + new Character('"') +
", unbindTime=" + new Character('"') + bindHistory.getUnbindTime() + new Character('"') +
" }";
}
}
......@@ -10,7 +10,7 @@ import java.util.StringTokenizer;
public class StringToBindHistory implements Converter<String, BindHistory> {
@Override
public BindHistory convert(String s) {
s = s.substring(12, s.lastIndexOf("}"));
s = s.substring(2, s.lastIndexOf("}"));
StringTokenizer stringTokenizer = new StringTokenizer(s, ",");
BindHistory bindHistory = new BindHistory();
if (stringTokenizer.hasMoreTokens()) {
......
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