Procházet zdrojové kódy

获取项目id接口

zhouzeyu@c-top.com.cn před 3 roky
rodič
revize
167945be6a

+ 21 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/EstimatePepoleNumberController.java

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.clean.controller;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
+import cn.com.ctop.kuaishou.modules.clean.mapper.KuaishouAccountCleanTemplateMapper;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.client.ClientProtocolException;
@@ -11,10 +12,9 @@ import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
-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;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.io.BufferedReader;
@@ -41,6 +41,9 @@ public class EstimatePepoleNumberController {
     @Resource
     CtopOauthTokenMapper ctopOauthTokenMapper;
 
+    @Resource
+    KuaishouAccountCleanTemplateMapper kuaishouAccountCleanTemplateMapper;
+
 
     /**
      * 获取人群预估数量
@@ -54,6 +57,20 @@ public class EstimatePepoleNumberController {
     }
 
     /**
+     * 根据账户ID获取项目ID
+     *
+     * @param accountId
+     * @return
+     */
+    @GetMapping("/getProjectId")
+    public Result getProjectId(@Param("accountId") String accountId) {
+        Result result=new Result();
+        String projectId = kuaishouAccountCleanTemplateMapper.getProjectId(accountId);
+        result.setSuccess(true);
+        result.setMessage(projectId);
+        return result;
+    }
+    /**
      * 根据地址请求巨量殷勤,返回响应结果
      *
      * @author zzy

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/KuaishouAccountCleanTemplateMapper.java

@@ -54,4 +54,9 @@ public interface KuaishouAccountCleanTemplateMapper {
      * 根据模板名称查询
      */
     int getTemplateName(@Param("templateName") String templateName);
+
+    /**
+     * 根据模板名称查询
+     */
+    String getProjectId(@Param("accountId") String accountId);
 }

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/KuaishouAccountCleanTemplateMapper.xml

@@ -189,4 +189,7 @@
     <select id="getGroupByAccount" resultType="Map">
         select  t.unit_id as 'unitId',t.ocpx_action_type  as 'type' from ctop_kuaishou_group t  where t.account_id=#{accountId}
     </select>
+    <select id="getProjectId" resultType="String">
+        SELECT t.project_id from ctop_user_allocation t where t.account_id=#{accountId}
+    </select>
 </mapper>