|
@@ -46,6 +46,9 @@ public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMap
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
if (!Check.isNull(resultJson)) {
|
|
if (!Check.isNull(resultJson)) {
|
|
Integer code = resultJson.getInteger("code");
|
|
Integer code = resultJson.getInteger("code");
|
|
|
|
+ /* Map<String, Object> deleteMap = new HashMap<>();
|
|
|
|
+ deleteMap.put("account_id", accountId);
|
|
|
|
+ this.removeByMap(deleteMap);*/
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
JSONObject dataJson = resultJson.getJSONObject("data");
|
|
JSONObject dataJson = resultJson.getJSONObject("data");
|
|
if (Check.isNull(dataJson)) {
|
|
if (Check.isNull(dataJson)) {
|
|
@@ -344,14 +347,16 @@ public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMap
|
|
if (Check.isNull(requestJson.getString("templateName"))) {
|
|
if (Check.isNull(requestJson.getString("templateName"))) {
|
|
throw new Exception("定向模板名称为必传项");
|
|
throw new Exception("定向模板名称为必传项");
|
|
}
|
|
}
|
|
|
|
+ if (Check.isNull(requestJson.getLong("templateId"))) {
|
|
|
|
+ throw new Exception("定向模板id为必传项");
|
|
|
|
+ }
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
JSONObject param = new JSONObject();
|
|
param.put("template_id", requestJson.getLong("templateId"));
|
|
param.put("template_id", requestJson.getLong("templateId"));
|
|
param.put("advertiser_id", accountId);
|
|
param.put("advertiser_id", accountId);
|
|
- if(!Check.isNull(requestJson.getString("templateName"))){
|
|
|
|
|
|
+ if (!Check.isNull(requestJson.getString("templateName"))) {
|
|
param.put("template_name", requestJson.getString("templateName"));
|
|
param.put("template_name", requestJson.getString("templateName"));
|
|
}
|
|
}
|
|
-
|
|
|
|
JSONObject targetJson = new JSONObject();
|
|
JSONObject targetJson = new JSONObject();
|
|
if (!Check.isNull(requestJson.getJSONArray("region"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("region"))) {
|
|
targetJson.put("region", requestJson.getJSONArray("region"));
|
|
targetJson.put("region", requestJson.getJSONArray("region"));
|
|
@@ -449,15 +454,12 @@ public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMap
|
|
if (!Check.isNull(targetJson)) {
|
|
if (!Check.isNull(targetJson)) {
|
|
param.put("target", targetJson);
|
|
param.put("target", targetJson);
|
|
}
|
|
}
|
|
-
|
|
|
|
Map<String, String> headers = new HashMap<String, String>();
|
|
Map<String, String> headers = new HashMap<String, String>();
|
|
headers.put("Access-Token", accessToken);
|
|
headers.put("Access-Token", accessToken);
|
|
headers.put("Content-Type", " application/json");
|
|
headers.put("Content-Type", " application/json");
|
|
- System.err.println("入参:" + param.toJSONString());
|
|
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.TEMPLATE_UPDATE;
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.TEMPLATE_UPDATE;
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
- System.err.println("返回:" + resultJson.toJSONString());
|
|
|
|
if (!Check.isNull(resultJson)) {
|
|
if (!Check.isNull(resultJson)) {
|
|
Integer code = resultJson.getInteger("code");
|
|
Integer code = resultJson.getInteger("code");
|
|
if (code == 0) {
|
|
if (code == 0) {
|