|
@@ -1279,4 +1279,131 @@ 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="+token.getAccountId()+"&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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Author: zianY
|
|
|
+ * Description: 资产-获取优化目标列表
|
|
|
+ *------------
|
|
|
+ * @param
|
|
|
+ * @param landingType 广告组推广目的,允许值:LINK 销售线索收集、LIVE 直播间推广、SHOP电商店铺推广、APP 应用、QUICK_APP 快应用
|
|
|
+ * @param marketingPurpose 营销目的,允许值:CONVERSION 行动转化、INTENTION 用户意向、ACKNOWLEDGE 品牌认知
|
|
|
+ * @param assetType 资产类型,允许值:THIRD_EXTERNAL 三方落地页、TETRIS_EXTERNAL 建站、APP 应用、QUICK_APP 快应用
|
|
|
+ * @param appType 应用类型,当asset_type为应用APP时必填 可选值:ANDROID 、IOS
|
|
|
+ * @param packageName 应用类型,当asset_type为应用APP时必填 可选值:ANDROID 、IOS
|
|
|
+ *------------
|
|
|
+ * Return org.jeecg.common.api.vo.Result
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Result getConvertOptimized(CtopOauthToken token, String landingType,String marketingPurpose,String assetType,String appType,String packageName) {
|
|
|
+
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ //params.put("page", 1);
|
|
|
+ //params.put("page_size", 30);
|
|
|
+ log.info("params======{}",params);
|
|
|
+
|
|
|
+ String str = "?advertiser_id="+token.getAccountId()+
|
|
|
+ "&landing_type="+landingType+
|
|
|
+ "&marketing_purpose="+marketingPurpose+
|
|
|
+ "&asset_type="+assetType+
|
|
|
+ "&app_type="+appType+
|
|
|
+ "&package_name="+packageName;
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
+ urlPath+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_event_convert_optimized")+str,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);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Author: zianY
|
|
|
+ * Description: 查询事件资产下的监测链接
|
|
|
+ *------------
|
|
|
+ * @param token
|
|
|
+ * @param assetId 资产ID
|
|
|
+ *------------
|
|
|
+ * Return org.jeecg.common.api.vo.Result
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Result getOptimizedTrackUrl(CtopOauthToken token, Long assetId,String downloadUrl) {
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ //params.put("page", 1);
|
|
|
+ //params.put("page_size", 30);
|
|
|
+ //log.info("params======{}",params);
|
|
|
+
|
|
|
+ String str = "?advertiser_id="+token.getAccountId()+
|
|
|
+ "&asset_id="+assetId+
|
|
|
+ "&download_url="+downloadUrl;
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
+ urlPath+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_event_track_url")+str,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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|