Commit 4c76ae89 by wang_jiaxing

修改全国ES接口工具类,增加实体类的父类,用于限制范型类型

parent 27473e3e
package org.springblade.founder.utils.Entity; package org.springblade.founder.utils.Entity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
/** /**
* 全国案件ES接口案事件实体类 * 全国案件ES接口案事件实体类
...@@ -9,7 +10,8 @@ import lombok.Data; ...@@ -9,7 +10,8 @@ import lombok.Data;
* @date 2022/5/6 15:22 * @date 2022/5/6 15:22
*/ */
@Data @Data
public class QgEsAsj { @EqualsAndHashCode(callSuper = true)
public class QgEsAsj extends QgEsEntity{
//案事件编号 //案事件编号
private String asjbh; private String asjbh;
//案件名称 //案件名称
......
package org.springblade.founder.utils.Entity;
/**
* 全国ES接口实体类夫类,用于限制范型类型
*
* @author create by lystar
* @date 2022/5/7 11:27
*/
public class QgEsEntity {
}
package org.springblade.founder.utils.Entity; package org.springblade.founder.utils.Entity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
/** /**
* 全国案件ES接口嫌疑人实体类 * 全国案件ES接口嫌疑人实体类
...@@ -8,8 +9,9 @@ import lombok.Data; ...@@ -8,8 +9,9 @@ import lombok.Data;
* @author create by lystar * @author create by lystar
* @date 2022/5/6 16:08 * @date 2022/5/6 16:08
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
public class QgEsXyr { public class QgEsXyr extends QgEsEntity{
//姓名 //姓名
private String xm; private String xm;
//证件号码 //证件号码
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.founder.utils.Entity.QgEsAsj; import org.springblade.founder.utils.Entity.QgEsAsj;
import org.springblade.founder.utils.Entity.QgEsEntity;
import org.springblade.founder.utils.Entity.QgEsEnum; import org.springblade.founder.utils.Entity.QgEsEnum;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -74,7 +75,7 @@ public class QgEsUtil { ...@@ -74,7 +75,7 @@ public class QgEsUtil {
* @author lystar * @author lystar
* 2022/5/6 16:26 * 2022/5/6 16:26
*/ */
public static <T> List<T> getQgEsListByTypeAndParam(QgEsEnum qgEsEnum, String bh) { public static <T extends QgEsEntity> List<T> getQgEsListByTypeAndParam(QgEsEnum qgEsEnum, String bh) {
try { try {
Map<String, Object> jsonMap = new HashMap<>(); Map<String, Object> jsonMap = new HashMap<>();
if (QgEsEnum.GET_ASJ_BY_ZJHM == qgEsEnum) { if (QgEsEnum.GET_ASJ_BY_ZJHM == qgEsEnum) {
......
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