1、PXY HTTP日志查询接口添加searchUrl和searchWebsite查询条件;
2、对原始日志查询条件中的特殊字符进行转换处理;
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nis.domain.LogEntity;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@@ -42,6 +43,8 @@ public class PxyHttpLog extends LogEntity<PxyHttpLog> {
|
||||
@ApiModelProperty(value="域名", required=true)
|
||||
protected String website;
|
||||
|
||||
protected String searchUrl; //url查询条件a
|
||||
protected String searchWebsite; //website查询条件
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
@@ -127,4 +130,29 @@ public class PxyHttpLog extends LogEntity<PxyHttpLog> {
|
||||
public void setWebsite(String website) {
|
||||
this.website = website;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the searchUrl
|
||||
*/
|
||||
|
||||
@JsonIgnore
|
||||
public String getSearchUrl() {
|
||||
return searchUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param searchUrl the searchUrl to set
|
||||
*/
|
||||
public void setSearchUrl(String searchUrl) {
|
||||
this.searchUrl = searchUrl;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getSearchWebsite() {
|
||||
return searchWebsite;
|
||||
}
|
||||
|
||||
public void setSearchWebsite(String searchWebsite) {
|
||||
this.searchWebsite = searchWebsite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ public class LogDataService {
|
||||
String field = filedAndColumnMap.get(key).toLowerCase();
|
||||
if (type.equals("java.lang.String")) {
|
||||
if (field.equals("url") || field.equals("website")) {
|
||||
whereSB.append(" and " + field + " like '" + value.toString().trim() + "%'");
|
||||
whereSB.append(" and " + field + " like '" + StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "%'");
|
||||
} else {
|
||||
whereSB.append(" and " + field + "='"
|
||||
+ StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "'");
|
||||
@@ -402,10 +402,11 @@ public class LogDataService {
|
||||
|
||||
if (typeName.equals("java.lang.String")) {
|
||||
String field = filedAndColumnMap.get(key);
|
||||
if (field.equals("url")) {
|
||||
whereSB.append(" and " + field + " like '" + value.toString().trim() + "%'");
|
||||
if (field.equals("url") || field.equals("website")) {
|
||||
whereSB.append(" and " + field + " like '" + StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "%'");
|
||||
} else {
|
||||
whereSB.append(" and " + field + "='" + value.toString().trim() + "'");
|
||||
whereSB.append(" and " + field + "='"
|
||||
+ StringEscapeUtils.unescapeHtml4(value.toString().trim()) + "'");
|
||||
}
|
||||
} else if (typeName.equals("java.lang.Integer") || typeName.equals("int")) {
|
||||
whereSB.append(
|
||||
|
||||
Reference in New Issue
Block a user