소스 검색

头条批量

syh 5 년 전
부모
커밋
5a376cf001

+ 1 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -114,15 +114,13 @@ public class ShiroConfig {
         //oauth接口
         filterChainDefinitionMap.put("/auth/**", "anon");
         filterChainDefinitionMap.put("/ctop/syncdata/**", "anon");
+        filterChainDefinitionMap.put("/sys/dictItem/list", "anon");
         //头条接口
         filterChainDefinitionMap.put("/bytedance", "anon");
-        filterChainDefinitionMap.put("/toutiao/dictitem/list", "anon");
         filterChainDefinitionMap.put("/toutiao/loadAllData", "anon");
         filterChainDefinitionMap.put("/toutiao/loadSingleData", "anon");
         filterChainDefinitionMap.put("/kuaishou/getReport/historyData", "anon");
         filterChainDefinitionMap.put("/toutiao/advertiser/**", "anon");
-        filterChainDefinitionMap.put("/toutiao/industry/list", "anon");
-        filterChainDefinitionMap.put("/template/bytedance/industry/list", "anon");
         filterChainDefinitionMap.put("/template/convert/list", "anon");
         filterChainDefinitionMap.put("/template/convert/list/url", "anon");
         //文件上传接口
@@ -144,7 +142,6 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/graphql/video", "anon");
         filterChainDefinitionMap.put("/ks/web/test", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
-        //filterChainDefinitionMap.put("/ctop/performance/show/**", "anon");
         filterChainDefinitionMap.put("/job/test/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt

+ 0 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java

@@ -65,7 +65,6 @@ public class ActorController {
         QueryWrapper<Actor> queryWrapper = QueryGenerator.initQueryWrapper(actor, req.getParameterMap());
         Page<Actor> page = new Page<>(pageNo, pageSize);
         IPage<Actor> pageList = actorService.page(page, queryWrapper);
-
         result.setSuccess(true);
         result.setResult(pageList);
         return result;
@@ -77,7 +76,6 @@ public class ActorController {
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
         Result<IPage<ActorPhoto>> result = new Result<>();
-
         QueryWrapper<ActorPhoto> queryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, req.getParameterMap());
         Page<ActorPhoto> page = new Page<>(pageNo, pageSize);
         IPage<ActorPhoto> pageList = actorPhotoService.page(page, queryWrapper);
@@ -92,7 +90,6 @@ public class ActorController {
                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                             HttpServletRequest req) {
         Result<IPage<ActorComment>> result = new Result<>();
-
         QueryWrapper<ActorComment> queryWrapper = QueryGenerator.initQueryWrapper(actorComment, req.getParameterMap());
         Page<ActorComment> page = new Page<>(pageNo, pageSize);
         IPage<ActorComment> pageList = actorCommentService.page(page, queryWrapper);

+ 13 - 37
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -41,8 +41,17 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 @Slf4j
 public class TestController {
     @Autowired
+    private CtopOauthTokenMapper tokenMapper;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IMaterialCutFrameService cutFrameService;
+    @Autowired
+    IKuaiShouVideoGetService videoGetService;
+    @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
-
     @Autowired
     private CtopOauthTokenMapper oauthTokenMapper;
     @Autowired
@@ -63,6 +72,7 @@ public class TestController {
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
 
+
     @GetMapping(value = "/t")
     public String test() {
         Result<String> result = new Result<>();
@@ -83,26 +93,10 @@ public class TestController {
     }
 
 
-    @Autowired
-    private CtopOauthTokenMapper tokenMapper;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-
-    @Autowired
-    private IMaterialCutFrameService cutFrameService;
-    @Autowired
-    IKuaiShouVideoGetService videoGetService;
-
 
     @GetMapping(value = "/getSuZhao")
     public void getSuZhao() throws JobExecutionException {
-
         try {
-
             //1:查询当日数据
             QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("media_id", 2);
@@ -113,9 +107,8 @@ public class TestController {
                 return;
             }
 
-            executorService = Executors.newFixedThreadPool(8);
             tokens.forEach(token -> {
-                executorService.submit(new Runnable() {
+                suzhaoService.submit(new Runnable() {
                     @Override
                     public void run() {
                         //1: 获取广告主信息数据
@@ -172,19 +165,15 @@ public class TestController {
 
     @GetMapping(value = "/getVideo")
     public String getVideo(String startDate, String endDate) throws IOException {
-
         try {
-
             Thread thread = new Thread() {
                 @Override
                 public void run() {
                     QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
                     tokenQueryWrapper.eq("media_id", 2);
                     List<CtopOauthToken> list = tokenService.list(tokenQueryWrapper);
-
-                    executorService = Executors.newFixedThreadPool(8);
                     list.forEach(token -> {
-                        executorService.submit(new Runnable() {
+                        videoService.submit(new Runnable() {
                             @Override
                             public void run() {
                                 try {
@@ -223,9 +212,7 @@ public class TestController {
 
     @GetMapping(value = "/getVideoByAccountId")
     public String getVideoByAccountId(Long accountId) throws IOException {
-
         try {
-
             Thread thread = new Thread() {
                 @Override
                 public void run() {
@@ -252,8 +239,6 @@ public class TestController {
                         e.printStackTrace();
                     } finally {
                     }
-
-
                     log.info("快手物料数据同步完成");
                 }
             };
@@ -267,7 +252,6 @@ public class TestController {
 
     @GetMapping(value = "/createCutTask")
     public String createCutTask(String startDate, String endDate) throws IOException {
-
         List<MaterialInfo> materialInfos = materialInfoService.getListByDate(startDate, endDate);
         if (!Check.isNull(materialInfos)) {
             for (MaterialInfo materialInfo : materialInfos) {
@@ -281,11 +265,8 @@ public class TestController {
                         cutFrameService.getCutFrame(materialInfo.getUrl(), code, materialParameter.getSecond(), materialParameter.getHeight(), materialParameter.getWidth());
 
                     }
-
                 }
-
             }
-
         }
         return "Success";
     }
@@ -320,7 +301,6 @@ public class TestController {
             SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
             Date date1 = sim.parse(startDate);
             Date date2 = sim.parse(endDate);
-
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
@@ -328,7 +308,6 @@ public class TestController {
                 for (CtopOauthToken token : ctopOauthTokens) {
                     kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
                 }
-
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -372,14 +351,12 @@ public class TestController {
             parameterService.update(updateMaterialParameter, parameterQueryWrapper);
         }
 
-
         List<String> codeList = iMaterialImageInfoService.getCodeList();
         if (!Check.isNull(codeList)) {
             for (int i = 0; i < codeList.size(); i++) {
                 String code = codeList.get(i);
                 QueryWrapper<MaterialImageInfo> materialImageInfoQueryWrapper = new QueryWrapper<>();
                 materialImageInfoQueryWrapper.eq("code", code);
-
                 List<MaterialImageInfo> list2 = iMaterialImageInfoService.list(materialImageInfoQueryWrapper);
                 if (list2.size() > 1) {
                     for (int j = 0; j < list2.size(); j++) {
@@ -389,7 +366,6 @@ public class TestController {
                         MaterialImageInfo materialImageInfo = list2.get(j);
                         iMaterialImageInfoService.removeById(String.valueOf(materialImageInfo.getId()));
                     }
-
                 }
             }
         }

+ 17 - 25
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDictItemController.java

@@ -1,30 +1,22 @@
 package org.jeecg.modules.system.controller;
 
 
-import java.util.Arrays;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.system.entity.SysDictItem;
 import org.jeecg.modules.system.service.ISysDictItemService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
-import lombok.extern.slf4j.Slf4j;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.Date;
 
 /**
  * <p>
@@ -41,7 +33,7 @@ public class SysDictItemController {
 
 	@Autowired
 	private ISysDictItemService sysDictItemService;
-	
+
 	/**
 	 * @功能:查询字典数据
 	 * @param sysDictItem
@@ -50,19 +42,19 @@ public class SysDictItemController {
 	 * @param req
 	 * @return
 	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	@GetMapping(value = "/list")
 	public Result<IPage<SysDictItem>> queryPageList(SysDictItem sysDictItem,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
-		Result<IPage<SysDictItem>> result = new Result<IPage<SysDictItem>>();
+		Result<IPage<SysDictItem>> result = new Result<>();
 		QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
 		queryWrapper.orderByAsc("sort_order");
-		Page<SysDictItem> page = new Page<SysDictItem>(pageNo, pageSize);
+		Page<SysDictItem> page = new Page<>(pageNo, pageSize);
 		IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;
 	}
-	
+
 	/**
 	 * @功能:新增
 	 * @param sysDictItem
@@ -82,7 +74,7 @@ public class SysDictItemController {
 		}
 		return result;
 	}
-	
+
 	/**
 	 * @功能:编辑
 	 * @param sysDictItem
@@ -105,7 +97,7 @@ public class SysDictItemController {
 		}
 		return result;
 	}
-	
+
 	/**
 	 * @功能:删除字典数据
 	 * @param id
@@ -126,7 +118,7 @@ public class SysDictItemController {
 		}
 		return result;
 	}
-	
+
 	/**
 	 * @功能:批量删除字典数据
 	 * @param ids
@@ -144,5 +136,5 @@ public class SysDictItemController {
 		}
 		return result;
 	}
-	
+
 }

+ 21 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceAudienceTemplateController.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.toutiao.modules.batch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("ctop/audience/template")
+public class BytedanceAudienceTemplateController {
+    @PostMapping("create")
+    public Map<String,Object> createAudiencePackageTemplate(HttpServletRequest request, JSONObject data){
+        Map<String,Object> result = new HashMap<>();
+
+        return result;
+    }
+}