Commit c5a7775f authored by renjie's avatar renjie

专线表添加字段

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