|
@@ -17,6 +17,7 @@ package io.jpress.admin.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jfinal.aop.Before;
|
|
|
+import com.jfinal.log.Log;
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.IAtom;
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
@@ -48,6 +49,8 @@ import java.util.*;
|
|
|
@RouterNotAllowConvert
|
|
|
public class _ContentController extends JBaseCRUDController<Content> {
|
|
|
|
|
|
+ private Log logger = Log.getLog(_ContentController.class);
|
|
|
+
|
|
|
private String getModuleName() {
|
|
|
return getPara("m");
|
|
|
}
|
|
@@ -522,6 +525,9 @@ public class _ContentController extends JBaseCRUDController<Content> {
|
|
|
}
|
|
|
|
|
|
String pushResult = null;
|
|
|
+ logger.warn("warn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +
|
|
|
+ "Content save Log:" + "cotentId=" + content.getId() + ", contentSlug=" + content.getSlug() + ", contentStatus=" + content.getStatus());
|
|
|
+
|
|
|
if ("uuhelper".equals(content.getModule()) && Content.STATUS_NORMAL.equals(content.getStatus())) {
|
|
|
pushResult = pushUuHelper(content);
|
|
|
}
|
|
@@ -533,6 +539,8 @@ public class _ContentController extends JBaseCRUDController<Content> {
|
|
|
}
|
|
|
|
|
|
private String pushUuHelper(Content content) {
|
|
|
+ logger.warn("warn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +
|
|
|
+ "pushUuHelper Log:" + "cotentId=" + content.getId() + ", contentSlug=" + content.getSlug() + ", contentStatus=" + content.getStatus());
|
|
|
String result = "";
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
String requestUrlMessage = this.getRequest().getScheme() +"://" + this.getRequest().getServerName() + ":" + this.getRequest().getServerPort();
|
|
@@ -574,13 +582,19 @@ public class _ContentController extends JBaseCRUDController<Content> {
|
|
|
try {
|
|
|
if (imageUrl == null) {
|
|
|
result = "软文推送失败,请选择一张图片";
|
|
|
+ logger.warn("warn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +
|
|
|
+ "推送结果:" + result);
|
|
|
} else {
|
|
|
String response = HttpUtils.post(url);
|
|
|
result = "软文推送成功";
|
|
|
+ logger.warn("warn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +
|
|
|
+ "推送结果:" + result);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
result = "软文推送失败,联系管理员检查接口";
|
|
|
+ logger.warn("warn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +
|
|
|
+ "推送结果:" + result);
|
|
|
} finally {
|
|
|
return result;
|
|
|
}
|