Commit c5a7775f authored by renjie's avatar renjie

专线表添加字段

parent ffa3ceb3
...@@ -36,12 +36,10 @@ public class IpResource implements Serializable { ...@@ -36,12 +36,10 @@ public class IpResource implements Serializable {
private String password; private String password;
private double price; private double price;
private boolean specialLine; private boolean specialLine; //是否使用专线
//专线数据 //专线数据
private String proxyUsername; private String proxyUsername; //专线的代理用户名
private String proxyPassword; private String proxyPassword; //专线的代理密码
private List<String> proxyProtocol;
private List<String> proxyPort;
private String shopId; private String shopId;
private String shopName; private String shopName;
...@@ -287,19 +285,4 @@ public class IpResource implements Serializable { ...@@ -287,19 +285,4 @@ public class IpResource implements Serializable {
this.specialLine = specialLine; this.specialLine = specialLine;
} }
public List<String> getProxyPort() {
return proxyPort;
}
public void setProxyPort(List<String> proxyPort) {
this.proxyPort = proxyPort;
}
public List<String> getProxyProtocol() {
return proxyProtocol;
}
public void setProxyProtocol(List<String> proxyProtocol) {
this.proxyProtocol = proxyProtocol;
}
} }
...@@ -3,6 +3,8 @@ package com.edgec.browserbackend.browser.domain; ...@@ -3,6 +3,8 @@ package com.edgec.browserbackend.browser.domain;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
@Document("specialline") @Document("specialline")
public class SpecialLine { public class SpecialLine {
@Id @Id
...@@ -10,6 +12,9 @@ public class SpecialLine { ...@@ -10,6 +12,9 @@ public class SpecialLine {
private String ip; private String ip;
private List<String> proxyProtocol; //专线使用的协议
private List<String> proxyPort; //专线使用的端口
public String getIp() { public String getIp() {
return ip; return ip;
} }
...@@ -25,4 +30,20 @@ public class SpecialLine { ...@@ -25,4 +30,20 @@ public class SpecialLine {
public void setId(String id) { public void setId(String id) {
Id = id; Id = id;
} }
public List<String> getProxyProtocol() {
return proxyProtocol;
}
public void setProxyProtocol(List<String> proxyProtocol) {
this.proxyProtocol = proxyProtocol;
}
public List<String> getProxyPort() {
return proxyPort;
}
public void setProxyPort(List<String> proxyPort) {
this.proxyPort = proxyPort;
}
} }
...@@ -49,10 +49,6 @@ public class IpResourceDto { ...@@ -49,10 +49,6 @@ public class IpResourceDto {
this.details = ipResource.getDetails(); this.details = ipResource.getDetails();
this.password = ipResource.getPassword(); this.password = ipResource.getPassword();
this.protocol = ipResource.getProtocol(); this.protocol = ipResource.getProtocol();
this.proxyUsername = ipResource.getProxyUsername();
this.proxyPassword = ipResource.getProxyPassword();
this.proxyPort = ipResource.getProxyPort();
this.proxyProtocol = ipResource.getProxyProtocol();
this.specialLine = ipResource.isSpecialLine(); this.specialLine = ipResource.isSpecialLine();
this.bindShop = shopDto; this.bindShop = shopDto;
if (useHistory) if (useHistory)
...@@ -61,7 +57,7 @@ public class IpResourceDto { ...@@ -61,7 +57,7 @@ public class IpResourceDto {
this.bindHistories = new ArrayList<>(); this.bindHistories = new ArrayList<>();
} }
public IpResourceDto(IpResource ipResource, ShopDto shopDto, boolean useHistory, String speicalLineIp){ public IpResourceDto(IpResource ipResource, ShopDto shopDto, boolean useHistory, SpecialLine speicalLine){
this.id = ipResource.getId(); this.id = ipResource.getId();
this.addr = ipResource.getAddr(); this.addr = ipResource.getAddr();
this.vendor = ipResource.getVendor(); this.vendor = ipResource.getVendor();
...@@ -76,11 +72,11 @@ public class IpResourceDto { ...@@ -76,11 +72,11 @@ public class IpResourceDto {
this.protocol = ipResource.getProtocol(); this.protocol = ipResource.getProtocol();
this.proxyUsername = ipResource.getProxyUsername(); this.proxyUsername = ipResource.getProxyUsername();
this.proxyPassword = ipResource.getProxyPassword(); this.proxyPassword = ipResource.getProxyPassword();
this.proxyPort = ipResource.getProxyPort(); this.proxyPort = speicalLine.getProxyPort();
this.proxyProtocol = ipResource.getProxyProtocol(); this.proxyProtocol = speicalLine.getProxyProtocol();
this.specialLine = ipResource.isSpecialLine(); this.specialLine = ipResource.isSpecialLine();
this.bindShop = shopDto; this.bindShop = shopDto;
this.speicalLineIp = speicalLineIp; this.speicalLineIp = speicalLine.getIp();
if (useHistory) if (useHistory)
this.bindHistories = ipResource.getBindHistory(); this.bindHistories = ipResource.getBindHistory();
else else
......
...@@ -153,10 +153,10 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -153,10 +153,10 @@ public class IpResourceServiceImpl implements IpResourceService {
return retStr; return retStr;
} }
// public static void main(String[] args) { public static void main(String[] args) {
// String password = genRandom(3, 12); String password = genRandom(3, 12);
// System.out.println(password); System.out.println(password);
// } }
private IpChargeRequestDto buildIpChargeRequestDto(IpResourceRequestDto request, int chargeType, int payMethod) { private IpChargeRequestDto buildIpChargeRequestDto(IpResourceRequestDto request, int chargeType, int payMethod) {
IpChargeRequestDto ipChargeRequestDto = new IpChargeRequestDto(); IpChargeRequestDto ipChargeRequestDto = new IpChargeRequestDto();
...@@ -582,7 +582,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -582,7 +582,7 @@ public class IpResourceServiceImpl implements IpResourceService {
} }
SpecialLine specialLine = specialLineRepository.findAll().get(0); SpecialLine specialLine = specialLineRepository.findAll().get(0);
if (x.isSpecialLine()) if (x.isSpecialLine())
ipResourceDtos.add(new IpResourceDto(x, shopDto, false, specialLine.getIp())); ipResourceDtos.add(new IpResourceDto(x, shopDto, false, specialLine));
else else
ipResourceDtos.add(new IpResourceDto(x, shopDto, false)); ipResourceDtos.add(new IpResourceDto(x, shopDto, false));
}); });
......
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