From dd209750c5fecd9b05e827bc3e634b06816f1249 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 15 一月 2019 09:07:31 +0800 Subject: [PATCH] 浏览足迹添加时间 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java index dafb478..2de9c5b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java @@ -13,6 +13,7 @@ import com.yeshi.fanli.service.inter.push.PushRecordService; import com.yeshi.fanli.tag.PageEntity; import com.yeshi.fanli.util.Constant; + import org.yeshi.utils.JsonUtil; import net.sf.json.JSONObject; @@ -36,4 +37,51 @@ out.print(JsonUtil.loadTrueResult(data)); } + + /** + * 鎺ㄨ崘璁板綍 -(鏂板悗鍙�) + * @param callback + * @param key + * @param type + * @param pageIndex + * @param out + */ + @RequestMapping(value = "getNewPushRecordList") + public void getNewPushRecordList(String callback, String key, Integer type, Integer pageIndex, PrintWriter out){ + try { + + if (pageIndex == null || pageIndex < 0){ + pageIndex = 1; + } + + if (type == null) { + type = 0; + } + + List<PushRecord> list = pushRecordService.getPushRecordList(key, type, pageIndex); + if (list == null || list.size() == 0) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏇村鏁版嵁")); + return; + } + + int pageSize = Constant.PAGE_SIZE; + + int count = pushRecordService.getCount(key, type, pageIndex); + + int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); + PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); + + JSONObject data = new JSONObject(); + data.put("pe", pe); + data.put("result_list", list); + + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); + } catch (Exception e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏌ヨ澶辫触")); + e.printStackTrace(); + } + + } + + } -- Gitblit v1.8.0