调用接口公共方法加入pageSize,pageNo,orderBy,fields

This commit is contained in:
wangxin
2018-07-09 10:29:22 +08:00
parent fb2ef3b4cd
commit 13833a65d7
4 changed files with 77 additions and 1 deletions

View File

@@ -10,8 +10,8 @@ package com.nis.domain.log;
import java.util.Map.Entry;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -82,6 +82,18 @@ public class ReportResultLog<T extends BaseReportLog> extends RestfulResult{
if(StringUtils.isNotBlank(searchCondition.getSearchReportEndTime())){
url.append("&searchReportEndTime=").append(searchCondition.getSearchReportEndTime());
}
if(searchCondition.getPageNo()!=null){
url.append("&pageNo=").append(searchCondition.getPageNo());
}
if(searchCondition.getPageSize()!=null){
url.append("&pageSize=").append(searchCondition.getPageSize());
}
if(StringUtils.isNotBlank(searchCondition.getOrderBy())){
url.append("&orderBy=").append(searchCondition.getOrderBy());
}
if(StringUtils.isNotBlank(searchCondition.getFields())){
url.append("&fields=").append(searchCondition.getFields());
}
//创建连接
WebTarget wt = ClientUtil.getWebTarger(url.toString());
Builder header = wt.request(MediaType.APPLICATION_JSON);

View File

@@ -40,7 +40,67 @@ public class SearchReport extends BaseEntity<SearchReport>{
private HashMap<String,Object> searchCondition;
public static final String searchConditionSplitor=",";
public int searchConditionLimit;
private Integer pageNo;
private Integer pageSize;
private String orderBy;
private String fields;
/**
* pageNo
* @return pageNo
*/
public Integer getPageNo() {
return pageNo;
}
/**
* @param pageNo the pageNo to set
*/
public void setPageNo(Integer pageNo) {
this.pageNo = pageNo;
}
/**
* pageSize
* @return pageSize
*/
public Integer getPageSize() {
return pageSize;
}
/**
* @param pageSize the pageSize to set
*/
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
/**
* orderBy
* @return orderBy
*/
public String getOrderBy() {
return orderBy;
}
/**
* @param orderBy the orderBy to set
*/
public void setOrderBy(String orderBy) {
this.orderBy = orderBy;
}
/**
* fields
* @return fields
*/
public String getFields() {
return fields;
}
/**
* @param fields the fields to set
*/
public void setFields(String fields) {
this.fields = fields;
}
/**
* reportBusinessType
* @return reportBusinessType

View File

@@ -342,6 +342,8 @@ public final class Constants {
public static final String CONFIG_ID_SOURCES=Configurations.getStringProperty("configIdSources","configPzIdSources");
//日志查询接口URL
public static final String LOG_BASE_URL = Configurations.getStringProperty("logBaseUrl","");
public static final String NTC_SERVICE_REPORT=Configurations.getStringProperty("ntcServiceReport","ntcServiceReport");
public static final String NTC_TAG_REPORT=Configurations.getStringProperty("ntcTagReport","ntcTagReport");
public static final String NTC_PZ_REPORT=Configurations.getStringProperty("ntcPzReport","ntcPzReport");
public static final String NTC_IP_LOG = Configurations.getStringProperty("ntcIpLog","");
public static final String NTC_HTTP_LOG = Configurations.getStringProperty("ntcHttpLog","");

View File

@@ -228,6 +228,8 @@ configIdSources=configPzIdSources
#logBaseUrl=http://10.0.6.242:8080/galaxy/service/log/v1/
logBaseUrl=http://10.0.6.242:8080/galaxy/service/log/v1/
ntcPzReport=ntcPzReport
ntcServiceReport=ntcServiceReport
ntcTagReport=ntcTagReport
ntcIpLog=ntcIpLogs
ntcHttpLog=ntcHttpLogs
ntcDnsLog=ntcDnsLogs