|
@@ -1052,6 +1052,7 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
*/
|
|
|
+ @Override
|
|
|
public Result getActionText(CtopOauthToken token, String landingType,String advancedCreativeType) {
|
|
|
|
|
|
JSONObject data = new JSONObject();
|
|
@@ -1089,25 +1090,21 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
*/
|
|
|
+ @Override
|
|
|
public Result getAudiencePackage(CtopOauthToken token,String landingType,String deliveryRange) {
|
|
|
-
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("advertiser_id", token.getAccountId());
|
|
|
-
|
|
|
Map map = new HashMap();
|
|
|
map.put("landing_type",landingType);
|
|
|
map.put("delivery_range",deliveryRange);
|
|
|
params.put("filtering", map);
|
|
|
params.put("page", 1);
|
|
|
params.put("page_size", 100);
|
|
|
-
|
|
|
params = Check.jsonRemoveEmpty(params);
|
|
|
JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
urlPath+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_audience_package_get"),params);
|
|
|
-
|
|
|
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);
|
|
@@ -1121,19 +1118,28 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Result getAudiencePackageRead(CtopOauthToken token,String accountId,List<Integer> ids) {
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @description: 获取人群包详细信息
|
|
|
+ *
|
|
|
+ * @param token
|
|
|
+ * @param accountId
|
|
|
+ * @param ids
|
|
|
+ * @return: org.jeecg.common.api.vo.Result
|
|
|
+ * @author: zianY
|
|
|
+ * @time: 2021/5/12 11:16
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Result getAudiencePackageRead(CtopOauthToken token,String accountId,List<Integer> ids) {
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("advertiser_id", token.getAccountId());
|
|
|
params.put("custom_audience_ids", ids);
|
|
|
-
|
|
|
params = Check.jsonRemoveEmpty(params);
|
|
|
JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
urlPath+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_read"),params);
|
|
|
-
|
|
|
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);
|
|
@@ -1145,4 +1151,38 @@ public class MarketingServiceImpl implements MarketingService{
|
|
|
}
|
|
|
return Result.successMsg("获取人群包详细信息成功",dataList.getJSONArray("custom_audience_list"));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @description: 创建定向包
|
|
|
+ *
|
|
|
+ * @param token
|
|
|
+ * @return: org.jeecg.common.api.vo.Result
|
|
|
+ * @author: zianY
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Result createAudiencePackage(CtopOauthToken token) {
|
|
|
+
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.put("advertiser_id", token.getAccountId());
|
|
|
+ params.put("name", "测试-定向包创建-004");
|
|
|
+ params.put("description", "0512定向包-过滤已转化用户-测试");
|
|
|
+ params.put("landing_type", "APP_ANDROID");
|
|
|
+ params.put("hide_if_exists", 2);
|
|
|
+ params.put("hide_if_converted", "AD");
|
|
|
+
|
|
|
+ JSONObject jsonObject = HttpUtils.bytedancePostRequest(token.getAccessToken(),
|
|
|
+ urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_audience_package_create"),
|
|
|
+ params);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ return Result.successMsg("创建定向包成功",jsonObject.getJSONObject("audience_package_id"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|