From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java | 149 +++++++++++++++++++++++++------------------------ 1 files changed, 75 insertions(+), 74 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 d40dce9..c28e52e 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 @@ -1,74 +1,75 @@ -package com.yeshi.fanli.controller.admin; - -import java.io.PrintWriter; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.yeshi.utils.JsonUtil; - -import com.yeshi.fanli.entity.xinge.PushRecord; -import com.yeshi.fanli.service.inter.push.PushRecordService; -import com.yeshi.fanli.tag.PageEntity; -import com.yeshi.fanli.util.Constant; - -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("admin/new/api/v1/pushRecord") -public class PushRecordAdminController { - - - @Resource - private PushRecordService pushRecordService; - - - /** - * 鎺ㄨ崘璁板綍 -(鏂板悗鍙�) - * @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; - } - - int pageSize = Constant.PAGE_SIZE; - - List<PushRecord> list = pushRecordService.getPushRecordList((pageIndex-1) * pageSize, pageSize, key, type); - if (list == null || list.size() == 0) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏇村鏁版嵁")); - return; - } - - long count = pushRecordService.getCount(key, type); - - 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(); - } - - } - - -} +package com.yeshi.fanli.controller.admin; + +import java.io.PrintWriter; +import java.util.List; + +import javax.annotation.Resource; + +import com.yeshi.fanli.entity.accept.AdminAcceptData; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.yeshi.utils.JsonUtil; + +import com.yeshi.fanli.entity.xinge.PushRecord; +import com.yeshi.fanli.service.inter.push.PushRecordService; +import com.yeshi.common.entity.PageEntity; +import com.yeshi.fanli.util.Constant; + +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("admin/new/api/v1/pushRecord") +public class PushRecordAdminController { + + + @Resource + private PushRecordService pushRecordService; + + + /** + * 鎺ㄨ崘璁板綍 -(鏂板悗鍙�) + * @param callback + * @param key + * @param type + * @param pageIndex + * @param out + */ + @RequestMapping(value = "getNewPushRecordList") + public void getNewPushRecordList(AdminAcceptData acceptData, String callback, String key, Integer type, Integer pageIndex, PrintWriter out){ + try { + + if (pageIndex == null || pageIndex < 0){ + pageIndex = 1; + } + + if (type == null) { + type = 0; + } + + int pageSize = Constant.PAGE_SIZE; + + List<PushRecord> list = pushRecordService.getPushRecordList((pageIndex-1) * pageSize, pageSize, key, type); + if (list == null || list.size() == 0) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏇村鏁版嵁")); + return; + } + + long count = pushRecordService.getCount(key, type); + + 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