|
@@ -960,4 +960,43 @@ public class marketing {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @description: 获取行业列表
|
|
|
+ *
|
|
|
+ * @param token
|
|
|
+ * @param type "ADVERTISER"为原有广告3.0行业, "AGENT"为代理商行业获取,代理商行业level都为1
|
|
|
+ * @return: org.jeecg.common.api.vo.Result
|
|
|
+ * @author: zianY
|
|
|
+ */
|
|
|
+ public static Result getToolIndustryList(CtopOauthToken token,String type) {
|
|
|
+
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.put("type", type);
|
|
|
+ params.put("level",type.equalsIgnoreCase(BytedanceConstant.LEVEL_AGENT) ? 1 : "");
|
|
|
+ params = Check.jsonRemoveEmpty(params);
|
|
|
+ JSONObject jsonObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(),
|
|
|
+ PropertiesUtils.getValue("bytedance_config", "bytedance_v2_tools_industry_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);
|
|
|
+ }
|
|
|
+ JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
|
|
|
+ if (null == data || data.isEmpty()) {
|
|
|
+ log.info("行业类别信息不存在==》accountId:{},message:{}", token.getAccountId(), message);
|
|
|
+ return Result.error("人群包信息不存在");
|
|
|
+ }
|
|
|
+ return Result.successMsg("行业类别信息获取成功",data);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|