浏览代码

推理配置

zhaops 5 年之前
父节点
当前提交
160552d57c

+ 17 - 0
aipt-service/src/main/java/com/diagbot/dto/PushSetDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 17:24
+ */
+@Getter
+@Setter
+public class PushSetDTO {
+    List<PushSetRetDTO> pushSetList;
+}

+ 30 - 0
aipt-service/src/main/java/com/diagbot/dto/PushSetRetDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 17:34
+ */
+@Getter
+@Setter
+public class PushSetRetDTO {
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 170 - 0
aipt-service/src/main/java/com/diagbot/entity/PushSet.java

@@ -0,0 +1,170 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+@TableName("kl_push_set")
+public class PushSet implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 推理聚焦位置
+     */
+    private Integer focus;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Integer getFocus() {
+        return focus;
+    }
+
+    public void setFocus(Integer focus) {
+        this.focus = focus;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "PushSet{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", focus=" + focus +
+            ", name=" + name +
+            ", code=" + code +
+            ", value=" + value +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 45 - 0
aipt-service/src/main/java/com/diagbot/facade/PushSetFacade.java

@@ -0,0 +1,45 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.PushSetDTO;
+import com.diagbot.dto.PushSetRetDTO;
+import com.diagbot.entity.PushSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.PushSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.PushSetVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 17:18
+ */
+@Component
+public class PushSetFacade extends PushSetServiceImpl {
+
+    /**
+     * 推送配置
+     *
+     * @param pushSetVO
+     * @return
+     */
+    public PushSetDTO getPushSet(PushSetVO pushSetVO) {
+        if (StringUtil.isNotBlank(pushSetVO.getFocus())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入推理聚焦位置");
+        }
+        PushSetDTO pushSetDTO = new PushSetDTO();
+        QueryWrapper<PushSet> pushSetQueryWrapper = new QueryWrapper<>();
+        pushSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("focus", pushSetVO.getFocus());
+        List<PushSet> pushSetList = this.list(pushSetQueryWrapper);
+        List<PushSetRetDTO> retPushSetList = BeanUtil.listCopyTo(pushSetList, PushSetRetDTO.class);
+        pushSetDTO.setPushSetList(retPushSetList);
+        return pushSetDTO;
+    }
+}

+ 16 - 0
aipt-service/src/main/java/com/diagbot/mapper/PushSetMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.PushSet;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+public interface PushSetMapper extends BaseMapper<PushSet> {
+
+}

+ 16 - 0
aipt-service/src/main/java/com/diagbot/service/PushSetService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.PushSet;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+public interface PushSetService extends IService<PushSet> {
+
+}

+ 20 - 0
aipt-service/src/main/java/com/diagbot/service/impl/PushSetServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.PushSet;
+import com.diagbot.mapper.PushSetMapper;
+import com.diagbot.service.PushSetService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+@Service
+public class PushSetServiceImpl extends ServiceImpl<PushSetMapper, PushSet> implements PushSetService {
+
+}

+ 15 - 0
aipt-service/src/main/java/com/diagbot/vo/PushSetVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 16:12
+ */
+@Getter
+@Setter
+public class PushSetVO {
+    private String focus;
+}

+ 38 - 0
aipt-service/src/main/java/com/diagbot/web/PushSetController.java

@@ -0,0 +1,38 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.PushSetDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PushSetFacade;
+import com.diagbot.vo.PushSetVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+@RestController
+@RequestMapping("/pushSet")
+public class PushSetController {
+
+    @Autowired
+    private PushSetFacade pushSetFacade;
+
+    @ApiOperation(value = "推理配置项[by:zhaops]",
+            notes = "focus: 推理聚焦位置<br>")
+    @PostMapping("/getPushSet")
+    @SysLogger("getPushSet")
+    RespDTO<PushSetDTO> getPushSet(@RequestBody PushSetVO pushSetVO) {
+        return RespDTO.onSuc(pushSetFacade.getPushSet(pushSetVO));
+    }
+}

+ 20 - 0
aipt-service/src/main/resources/mapper/PushSetMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.PushSetMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.PushSet">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="focus" property="focus" />
+        <result column="name" property="name" />
+        <result column="code" property="code" />
+        <result column="value" property="value" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 19 - 10
data-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -8,14 +8,14 @@ import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.DisclaimerInformationDTO;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushSetDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.ScaleIndexDTO;
 import com.diagbot.dto.VersionWrapperDTO;
 import com.diagbot.vo.ConceptIntroduceVO;
 import com.diagbot.vo.DisclaimerInformationVO;
 import com.diagbot.vo.GetStaticKnowledgeVO;
-import com.diagbot.vo.ScaleIndexVO;
+import com.diagbot.vo.PushSetVO;
 import com.diagbot.vo.VersionVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -42,6 +42,15 @@ public interface AiptServiceClient {
     @PostMapping("/push/pushInner")
     RespDTO<PushDTO> pushInner(@RequestBody SearchVO searchVO);
 
+    /**
+     * 推理配置项
+     *
+     * @param pushSetVO
+     * @return
+     */
+    @PostMapping("/pushSet/getPushSet")
+    RespDTO<PushSetDTO> getPushSet(@RequestBody PushSetVO pushSetVO);
+
 
     @PostMapping("/disclaimerInformation/getDisclaimerInformations")
     RespDTO<List<DisclaimerInformationDTO>> getDisclaimerInformations(@RequestBody DisclaimerInformationVO disclaimerInformationVO);
@@ -97,14 +106,14 @@ public interface AiptServiceClient {
     @PostMapping("/concept/getStaticKnowledge")
     RespDTO<List<RetrievalDTO>> getStaticKnowledge(@RequestBody GetStaticKnowledgeVO getStaticKnowledgeVO);
 
-//    /**
-//     * 量表搜索
-//     *
-//     * @param scaleIndexVO
-//     * @return
-//     */
-//    @PostMapping(value = "/scale/index")
-//    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
+    //    /**
+    //     * 量表搜索
+    //     *
+    //     * @param scaleIndexVO
+    //     * @return
+    //     */
+    //    @PostMapping(value = "/scale/index")
+    //    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
 
     /**
      * 获取字典信息

+ 25 - 13
data-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -8,14 +8,14 @@ import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.DisclaimerInformationDTO;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushSetDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.ScaleIndexDTO;
 import com.diagbot.dto.VersionWrapperDTO;
 import com.diagbot.vo.ConceptIntroduceVO;
 import com.diagbot.vo.DisclaimerInformationVO;
 import com.diagbot.vo.GetStaticKnowledgeVO;
-import com.diagbot.vo.ScaleIndexVO;
+import com.diagbot.vo.PushSetVO;
 import com.diagbot.vo.VersionVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -45,6 +45,18 @@ public class AiptServiceHystrix implements AiptServiceClient {
         return null;
     }
 
+    /**
+     * 推理配置项
+     *
+     * @param pushSetVO
+     * @return
+     */
+    @Override
+    public RespDTO<PushSetDTO> getPushSet(@RequestBody PushSetVO pushSetVO) {
+        log.error("【hystrix】调用{}异常", "getPushSet");
+        return null;
+    }
+
 
     @Override
     public RespDTO<List<DisclaimerInformationDTO>> getDisclaimerInformations(DisclaimerInformationVO disclaimerInformationVO) {
@@ -121,17 +133,17 @@ public class AiptServiceHystrix implements AiptServiceClient {
         return null;
     }
 
-//    /**
-//     * 量表搜索
-//     *
-//     * @param scaleIndexVO
-//     * @return
-//     */
-//    @Override
-//    public RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO) {
-//        log.error("【hystrix】调用{}异常", "index");
-//        return null;
-//    }
+    //    /**
+    //     * 量表搜索
+    //     *
+    //     * @param scaleIndexVO
+    //     * @return
+    //     */
+    //    @Override
+    //    public RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO) {
+    //        log.error("【hystrix】调用{}异常", "index");
+    //        return null;
+    //    }
 
     /**
      * 获取字典信息

+ 17 - 0
data-service/src/main/java/com/diagbot/dto/PushSetDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 17:24
+ */
+@Getter
+@Setter
+public class PushSetDTO {
+    List<PushSetRetDTO> pushSetList;
+}

+ 30 - 0
data-service/src/main/java/com/diagbot/dto/PushSetRetDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 17:34
+ */
+@Getter
+@Setter
+public class PushSetRetDTO {
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 15 - 0
data-service/src/main/java/com/diagbot/vo/PushSetVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/1 16:12
+ */
+@Getter
+@Setter
+public class PushSetVO {
+    private String focus;
+}

+ 38 - 0
data-service/src/main/java/com/diagbot/web/PushSetController.java

@@ -0,0 +1,38 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.client.AiptServiceClient;
+import com.diagbot.dto.PushSetDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.vo.PushSetVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-01
+ */
+@RestController
+@RequestMapping("/pushSet")
+public class PushSetController {
+
+    @Autowired
+    private AiptServiceClient aiptServiceClient;
+
+    @ApiOperation(value = "推理配置项[by:zhaops]",
+            notes = "focus: 推理聚焦位置<br>")
+    @PostMapping("/getPushSet")
+    @SysLogger("getPushSet")
+    RespDTO<PushSetDTO> getPushSet(@RequestBody PushSetVO pushSetVO) {
+        return RespDTO.onSuc(aiptServiceClient.getPushSet(pushSetVO));
+    }
+}