Selaa lähdekoodia

定向包~添加兴趣定向类目词。关键词查询接口

zhaoxian 4 vuotta sitten
vanhempi
commit
588f5d54dd

+ 8 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouDirectionalPackageServiceImpl.java

@@ -7,12 +7,14 @@ import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouDirectionalPackage;
 import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouDirectionalPackageMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouDirectionalPackageService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouTemplateService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -29,6 +31,9 @@ import java.util.Map;
 @Service
 public class KuaishouDirectionalPackageServiceImpl extends ServiceImpl<KuaishouDirectionalPackageMapper, KuaishouDirectionalPackage> implements IKuaishouDirectionalPackageService {
 
+    @Autowired
+    private IKuaishouTemplateService kuaishouTemplateService;
+
     @Override
     public Result<Object> createDirectionalPackage(String accessToken, JSONObject requestJson) {
         JSONObject returnJson = new JSONObject();
@@ -170,11 +175,11 @@ public class KuaishouDirectionalPackageServiceImpl extends ServiceImpl<KuaishouD
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.TEMPLATE_CREATE;
             String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
-
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 message = resultJson.getString("message");
                 if (code == 0) {
+                    kuaishouTemplateService.getTemplateByAccountId(requestJson.getLong("accountId"), accessToken, 1);
                     flag = code;
                     JSONObject data = resultJson.getJSONObject("data");
                     requestJson.put("templateId", data.getLong("template_id"));
@@ -348,6 +353,7 @@ public class KuaishouDirectionalPackageServiceImpl extends ServiceImpl<KuaishouD
                 Integer code = resultJson.getInteger("code");
                 message = resultJson.getString("message");
                 if (code == 0) {
+                    kuaishouTemplateService.getTemplateByAccountId(requestJson.getLong("accountId"), accessToken, 1);
                     flag = code;
                     JSONObject data = resultJson.getJSONObject("data");
                 }
@@ -376,7 +382,7 @@ public class KuaishouDirectionalPackageServiceImpl extends ServiceImpl<KuaishouD
     }
 
     @Override
-    public Result<Object> getRelatedAccountGroup(Long projectId,Long templateId, Integer type, Integer pageNo, Integer pageSize) {
+    public Result<Object> getRelatedAccountGroup(Long projectId, Long templateId, Integer type, Integer pageNo, Integer pageSize) {
         return null;
     }
 

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouTemplateController.java

@@ -77,7 +77,7 @@ public class KuaishouTemplateController {
     @GetMapping(value = "/getbehaviorInterest")
     public Result<Object> getbehaviorInterest(Long accountId) {
         Result<List<JSONObject>> result = new Result<>();
-        return kuaishouTemplateService.getbehaviorInterest(accountId);
+        return kuaishouTemplateService.getBehaviorInterest(accountId);
     }
 
     /**

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouTemplateService.java

@@ -23,7 +23,7 @@ public interface IKuaishouTemplateService extends IService<KuaishouTemplate> {
 
     List<JSONObject> getJsonArrByAccountId(Long accountId, Integer platformOs, Boolean autoTarget);
 
-    Result<Object> getbehaviorInterest(Long accountId);
+    Result<Object> getBehaviorInterest(Long accountId);
 
     Result<Object> getKeywordQuery(JSONObject data);
 }

+ 10 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouTemplateServiceImpl.java

@@ -517,14 +517,14 @@ public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMap
 
 
     /**
-     * 查询加速探索信息
+     * 获得行为兴趣类目词
      *
      * @param
      * @throws
      * @author ZHAOXA
      */
     @Override
-    public Result<Object> getbehaviorInterest(Long accountId) {
+    public Result<Object> getBehaviorInterest(Long accountId) {
         try {
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.BEHAVIOR_INTEREST;
@@ -550,6 +550,14 @@ public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMap
         return Result.error("获取行为与兴趣类目失败");
     }
 
+    /**
+     * 获取行为兴趣关键词
+     *
+     * @param
+     * @return org.jeecg.common.api.vo.Result<java.lang.Object>
+     * @throws
+     * @author ZHAOXA
+     */
     @Override
     public Result<Object> getKeywordQuery(JSONObject data) {
         try {