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