Commit 99b57ad6 by shenjunjie

全网搜sorter统一

parent b764e8a0
package com.zhiwei.brandkbs2.pojo.dto; package com.zhiwei.brandkbs2.pojo.dto;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -68,7 +69,7 @@ public class SearchFilterDTO { ...@@ -68,7 +69,7 @@ public class SearchFilterDTO {
* 排序字段 * 排序字段
*/ */
@ApiModelProperty(value = "排序字段") @ApiModelProperty(value = "排序字段")
private String sorter; private JSONObject sorter;
/** /**
* 排序字段(查商业数据库用) * 排序字段(查商业数据库用)
...@@ -134,7 +135,17 @@ public class SearchFilterDTO { ...@@ -134,7 +135,17 @@ public class SearchFilterDTO {
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("source", sourceKeyword); map.put("source", sourceKeyword);
map.put("url", hostKeyword); map.put("url", hostKeyword);
map.put("sort", Objects.nonNull(sorter) ? sorter : "DESC"); if (null == sorter || sorter.isEmpty()) {
map.put("sort", "DESC");
} else {
for (Map.Entry<String, Object> entry : sorter.entrySet()) {
if (entry.getValue().toString().contains("desc")) {
map.put("sort", "DESC");
} else {
map.put("sort", "ASC");
}
}
}
map.put("page", page); map.put("page", page);
map.put("pageSize", pageSize); map.put("pageSize", pageSize);
map.put("notWords", filterWords); map.put("notWords", filterWords);
......
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