Forráskód Böngészése

feat: agent服务 渠道列表返回字段新增字段:服务名;

hidewnd 2 hete
szülő
commit
8fd2dcdcfa

+ 12 - 5
yt-agent/agent-service/src/main/resources/mapper/AgentDitchMapper.xml

@@ -42,14 +42,21 @@
 
     <select id="ditchList" resultType="com.ytpm.agent.view.AgentDitchView">
         select
-            ditch_id, ditch_name, app_type, app_id, create_time
-        from yt_ditch
+            yd.ditch_id,
+            yd.ditch_name,
+            yd.app_type,
+            ya.app_id,
+            ypua.service_name,
+            yd.create_time
+        from yt_ditch yd
+        left join yt_app ya on ya.ditch_id = yd.ditch_id
+        left join yt_platform_user_app ypua on ypua.app_id = ya.superior_id
         <where>
-            user_id = #{userId}
+            yd.user_id = #{userId}
             <if test="ditchName != null and ditchName != ''">
-                AND ditch_name LIKE CONCAT('%', #{ditchName}, '%')
+                AND yd.ditch_name LIKE CONCAT('%', #{ditchName}, '%')
             </if>
-            and is_delete=0
+            and yd.is_delete=0
         </where>
     </select>
     <select id="selectById" resultType="com.ytpm.agent.model.YtDitch">

+ 11 - 2
yt-common/src/main/java/com/ytpm/agent/view/AgentDitchView.java

@@ -1,17 +1,26 @@
 package com.ytpm.agent.view;
 
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.util.Date;
 
 @Data
 @ApiModel("渠道列表")
-public class AgentDitchView {
+public class AgentDitchView implements Serializable {
+    @ApiModelProperty("渠道ID")
     private Long ditchId;
+    @ApiModelProperty("渠道名称")
+    private String ditchName;
+    @ApiModelProperty("应用类型")
     private String appType;
+    @ApiModelProperty("应用ID")
     private String appId;
-    private String ditchName;
+    @ApiModelProperty("微服务名")
+    private String serviceName;
+    @ApiModelProperty("创建时间")
     private Date createTime;
 
 }

+ 2 - 1
yt-risk/risk-manage/src/main/java/com/ytpm/service/impl/RiskServiceImpl.java

@@ -991,7 +991,8 @@ public class RiskServiceImpl implements RiskService {
                 redisService.setTimeOutStr("lock_"+userId,param.getAppId(),1000);
                 redisService.setTimeOutHoursStr("unlock_"+userId,param.getAppId(),24);
                 break;
-            case 3: //增加封禁记录
+            case 3:
+                //增加封禁记录
                 RiskBannedParam bannedParam = new RiskBannedParam();
                 BeanUtil.copyProperties(param, bannedParam);
                 bannedParam.setUserId(param.getUserId());