|
@@ -453,7 +453,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
return resultMap;
|
|
return resultMap;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 查询人群包信息
|
|
* 查询人群包信息
|
|
*
|
|
*
|
|
@@ -462,8 +461,15 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> advertiserCustomAudienceSelect(String accountId) {
|
|
public Map<String, Object> advertiserCustomAudienceSelect(String accountId) {
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
+ if(null == accountId||accountId.trim().equals("")){
|
|
|
|
+ ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
|
|
-
|
|
|
|
|
|
+ if(null==token){
|
|
|
|
+ ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_PARAM_ERROR);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_select");
|
|
String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_select");
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
headers.put("Content-Type", "application/json");
|
|
headers.put("Content-Type", "application/json");
|
|
@@ -477,17 +483,17 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
|
|
String result = HttpUtils.httpGetRequest(url, headers, params);
|
|
String result = HttpUtils.httpGetRequest(url, headers, params);
|
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
|
Integer code = jsonObject.getInteger("code");
|
|
Integer code = jsonObject.getInteger("code");
|
|
-
|
|
|
|
|
|
+ String message = jsonObject.getString("message");
|
|
if (null == code || !code.equals(0)) {
|
|
if (null == code || !code.equals(0)) {
|
|
- log.info("获取人群包信息接口异常==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
|
|
|
|
|
|
+ log.info("获取人群包信息接口异常==》accountId:{},message:{}", accountId, message);
|
|
resultMap.put("success", false);
|
|
resultMap.put("success", false);
|
|
- resultMap.put("message", "获取人群包信息接口异常");
|
|
|
|
|
|
+ resultMap.put("message", message);
|
|
resultMap.put("code", -1);
|
|
resultMap.put("code", -1);
|
|
return resultMap;
|
|
return resultMap;
|
|
}
|
|
}
|
|
JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
|
|
JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
|
|
if (null == data || data.isEmpty()) {
|
|
if (null == data || data.isEmpty()) {
|
|
- log.info("人群包信息不存在==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
|
|
|
|
|
|
+ log.info("人群包信息不存在==》accountId:{},message:{}", accountId, message);
|
|
resultMap.put("success", false);
|
|
resultMap.put("success", false);
|
|
resultMap.put("message", "人群包信息不存在");
|
|
resultMap.put("message", "人群包信息不存在");
|
|
resultMap.put("code", -1);
|
|
resultMap.put("code", -1);
|