old mode 100644
new mode 100755
| | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | |
| | | //一分钟,调用限制次数 |
| | | private int limitTimes; |
| | | |
| | | private String invokeModel; |
| | | |
| | | |
| | | |
| | | //掩码 |
| | | private String securityCode; |
| | | //白名单 |
| | |
| | | private List<String> backListIp = new ArrayList<String>(); |
| | | |
| | | //服务 |
| | | private List<AppServiceStatus> appServices = new ArrayList<AppServiceStatus>(); |
| | | //private List<AppServiceStatus> appServices = new ArrayList<AppServiceStatus>(); |
| | | private AppService appService; |
| | | |
| | | private String remark; |
| | | |
| | |
| | | this.backListIp.add(backIp); |
| | | } |
| | | |
| | | public List<AppServiceStatus> getAppServices() { |
| | | public String getInvokeModel() { |
| | | return invokeModel; |
| | | } |
| | | |
| | | public void setInvokeModel(String invokeModel) { |
| | | this.invokeModel = invokeModel; |
| | | } |
| | | |
| | | /*public List<AppServiceStatus> getAppServices() { |
| | | return appServices; |
| | | } |
| | | |
| | | public void addAppServices(AppServiceStatus appServiceStatus) { |
| | | this.appServices.add(appServiceStatus); |
| | | }*/ |
| | | |
| | | public AppService getAppService() { |
| | | return appService; |
| | | } |
| | | |
| | | public void setAppService(AppService appService) { |
| | | this.appService = appService; |
| | | } |
| | | |
| | | public String getRemark() { |
| | |
| | | * 构建数据 |
| | | * @return |
| | | */ |
| | | public AppRoute builder(){ |
| | | public AppRoute builder(Map appInfo){ |
| | | String []listIps = null; |
| | | this.setAppId(appInfo.get("app_id").toString()); |
| | | this.setLimitTimes(appInfo.get("invoke_limit_times") == null ? -1 : Integer.parseInt(appInfo.get("invoke_limit_times").toString())); |
| | | this.setName(appInfo.get("name").toString()); |
| | | this.setOrderTypeCd(appInfo.get("order_type_cd").toString()); |
| | | this.setSecurityCode(appInfo.get("security_code").toString()); |
| | | this.setInvokeModel(appInfo.get("invoke_model").toString()); |
| | | if(appInfo.get("while_list_ip") != null && !"".equals(appInfo.get("while_list_ip"))){ |
| | | listIps = appInfo.get("while_list_ip").toString().split(";"); |
| | | for(String whileIp : listIps ) |
| | | this.addWhileListIp(whileIp); |
| | | } |
| | | if(appInfo.get("black_list_ip") != null && !"".equals(appInfo.get("black_list_ip"))){ |
| | | listIps = appInfo.get("black_list_ip").toString().split(";"); |
| | | for(String backIp : listIps ) |
| | | this.addBackListIp(backIp); |
| | | } |
| | | this.setStatusCd("0"); |
| | | this.setAppService(AppService.newInstance().builder(appInfo)); |
| | | return this; |
| | | } |
| | | |
| | | |
| | | |
| | | public static AppRoute newInstance(){ |
| | | return new AppRoute(); |
| | | } |
| | | |
| | | |
| | | } |