Explorar o código

头条-zichan

yangzian %!s(int64=3) %!d(string=hai) anos
pai
achega
9f2518efb8

+ 2 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/MarketingService.java

@@ -81,4 +81,6 @@ public interface MarketingService {
 
     Result getCreativeComponent(CtopOauthToken token);
 
+    Result getEventAssets(CtopOauthToken token,String landingType);
+
 }

+ 36 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/MarketingServiceImpl.java

@@ -1279,4 +1279,40 @@ public class MarketingServiceImpl implements MarketingService{
     }
 
 
+    /**
+     *  获取已创建资产列表
+     * @param token
+     * @param landingType
+     * @return
+     */
+    public Result getEventAssets(CtopOauthToken token,String landingType) {
+        JSONObject params = new JSONObject();
+        //params.put("advertiser_id", 1700992275550222L);
+       // params.put("asset_type", landingType);
+        params.put("page", 1);
+        params.put("page_size", 30);
+        //params = Check.jsonRemoveEmpty(params);
+        log.info("params======{}",params);
+        JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
+                urlPath+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_event_assets")+"?advertiser_id="+1700992275550222L+"&asset_type="+landingType,params);
+        log.info("result======{}",jsonObject);
+        Integer code = jsonObject.getInteger("code");
+        String message = jsonObject.getString("message");
+        if (null == code || !code.equals(0)) {
+            log.info("查询资产列表接口异常==》accountId:{},message:{}", token.getAccountId(), message);
+            return Result.error(message);
+        }
+        JSONObject dataList = jsonObject.getJSONObject("data");
+        if (null == dataList || dataList.isEmpty()) {
+            log.info("查询资产列表不存在==》accountId:{},message:{}", token.getAccountId(), message);
+            return Result.error("查询资产列表不存在");
+        }
+
+
+
+
+        return Result.successMsg("查询资产列表成功",dataList);
+    }
+
+
 }

+ 4 - 1
jeecg-boot-bytedance/src/main/resources/bytedance_config.properties

@@ -106,4 +106,7 @@ bytedance_v2_ad_creative_get=/2/report/creative/get/
 
 
 #\u67E5\u8BE2\u7EC4\u4EF6\u5217\u8868
-bytedance_v2_assets_get=/2/assets/creative_component/get/
+bytedance_v2_assets_get=/2/assets/creative_component/get/
+
+#\u83B7\u53D6\u5DF2\u521B\u5EFA\u7684\u8D44\u4EA7\u5217\u8868
+bytedance_v2_event_assets=/2/tools/event/assets/get/

+ 20 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -640,6 +640,26 @@ public class AiBytedanceAdvertiserStrategyController {
 
 
 
+	@ApiOperation(value="获取已创建资产列表", notes="获取已创建资产列表")
+	@GetMapping(value = "/getEventAssetsAccount")
+	public Result getEventAssetsAccount(@RequestParam("accountId") String accountId,
+								 @RequestParam("landingType") String landingType) {
+		try {
+			CtopOauthToken token = tokenService.getTokenByAccountId(new Long(accountId));
+			return marketingService.getEventAssets(token,landingType);
+		}catch (Exception e){
+			log.error("获取已创建资产列表异常",e);
+			return Result.error("请求失败,请联系开发人员!");
+		}
+	}
+
+
+
+
+
+
+
+
 
 
 }

+ 2 - 2
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -156,8 +156,8 @@ spring:
          max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
          min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
        shutdown-timeout: 100ms
-     password: hcst@2020
-     #password: ''
+     #password: hcst@2020
+     password: ''
      port: 6379
 #mybatis plus 设置
 mybatis-plus: