|
@@ -0,0 +1,70 @@
|
|
|
+package cn.com.ctop.kuaishou.modules.ai.controller;
|
|
|
+
|
|
|
+import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+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;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Api(tags = "快手-创意拒审重提")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/kuaishou/creative/")
|
|
|
+public class KuaiShouCreativeRefusalController {
|
|
|
+ @Autowired
|
|
|
+ private ICtopOauthTokenService tokenService;
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouCreativeService creativeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 吃创意拒审重提
|
|
|
+ *
|
|
|
+ * @param requestJson
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "again")
|
|
|
+ public JSONObject campaignCreate(@RequestBody JSONObject requestJson) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (Check.isNull(requestJson)) {
|
|
|
+ throw new Exception("入参不能为空");
|
|
|
+ }
|
|
|
+ Long accountId = requestJson.getLong("accountId");
|
|
|
+ if (Check.isNull(accountId)) {
|
|
|
+ throw new Exception("请输入账户id");
|
|
|
+ }
|
|
|
+ CtopOauthToken oauthToken = tokenService.getTokenByAccountId(accountId);
|
|
|
+ if (Check.isNull(oauthToken)) {
|
|
|
+ throw new Exception("未获取到账户信息");
|
|
|
+ }
|
|
|
+ JSONArray creativeIds = requestJson.getJSONArray("creativeIds");
|
|
|
+ if (Check.isNull(creativeIds)) {
|
|
|
+ throw new Exception("请传入需要重提的创意id列表");
|
|
|
+ }
|
|
|
+ for (int i = 0; i < creativeIds.size(); i++) {
|
|
|
+ Long creativeId = creativeIds.getLong(i);
|
|
|
+ // KuaiShouCreative creative = creativeService.getCreativeByCreativeId(creativeId);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|