Browse Source

接口api

liulingchao 5 years ago
parent
commit
d9faee03b8

+ 33 - 14
dgtly-api/src/main/java/com/dgtly/api/controller/SysNoticeInterface.java

@@ -1,8 +1,11 @@
 package com.dgtly.api.controller;
 
+import com.dgtly.common.annotation.ApiNoCheckSign;
+import com.dgtly.common.annotation.ApiPassToken;
 import com.dgtly.common.core.controller.ApiBaseController;
 import com.dgtly.common.core.controller.BaseController;
 import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.system.domain.SysNotice;
 import com.dgtly.system.service.ISysNoticeService;
@@ -24,23 +27,27 @@ import java.util.List;
   */
 @RestController
 @RequestMapping("/interface/notice")
+@ApiPassToken
+@ApiNoCheckSign
 public class SysNoticeInterface extends ApiBaseController {
 
     @Autowired
     private ISysNoticeService sysNoticeService;
 
     /**
-     * @descption: 根据类型查询内容列表前
+     * @descption: 根据类型查询内容列表前
      * @param:类型
-     * @return: 内容列表
+     * @return: 内容列表
      * @auther: LiuLingChao
      * @date: 2019-11-04 11:46
      */
-    @PostMapping("getNoticeListTop3")
-    public AjaxResult getNoticeList(String noticeType){
+    @PostMapping("getNoticeListTop5")
+    public AjaxResult getNoticeList(){
+
+        ParameterObject obj =  getParameterObject();
+        SysNotice sysNotice = obj.parseBean(SysNotice.class);
+        String noticeType = sysNotice.getNoticeType();
         if(StringUtils.isNotEmpty(noticeType)){
-            SysNotice sysNotice = new SysNotice();
-            sysNotice.setNoticeType(noticeType);
             sysNotice.setLimitFlag("true");
             List<SysNotice> sysNoticeList = sysNoticeService.selectNoticeTop3ByRole(sysNotice);
             List<String> banner = new ArrayList<String>();
@@ -65,12 +72,14 @@ public class SysNoticeInterface extends ApiBaseController {
      * @date: 2019-11-04 15:01
      */
     @PostMapping("getNoticeListAll")
-    public AjaxResult getNoticeListAll(String noticeType){
+    public AjaxResult getNoticeListAll(){
+        ParameterObject obj =  getParameterObject();
+        SysNotice sysNotice = obj.parseBean(SysNotice.class);
+        String noticeType = sysNotice.getNoticeType();
         if(StringUtils.isNotEmpty(noticeType)){
-            SysNotice sysNotice = new SysNotice();
-            sysNotice.setNoticeType(noticeType);
+            startPage(obj);/*向分页传递 分页参数*/
             List<SysNotice> sysNoticeList = sysNoticeService.selectNoticeTop3ByRole(sysNotice);
-            return AjaxResult.success("查询成功").putKV("list",sysNoticeList);
+            return AjaxResult.success(getDataTable(sysNoticeList));
         }else{
             return AjaxResult.error("参数为空");
         }
@@ -78,11 +87,21 @@ public class SysNoticeInterface extends ApiBaseController {
 
     }
 
+    /**
+     * @descption: 根据id查询详情
+     * @param:
+     * @return:
+     * @auther: LiuLingChao
+     * @date: 2020-2-27 10:31
+     */
     @RequestMapping("getNoticeListById")
-    public AjaxResult getNoticeListById( String noticeId){
-        if(StringUtils.isNotEmpty(noticeId)){
-            SysNotice sysNotice = sysNoticeService.selectNoticeById(Long.parseLong(noticeId));
-            return AjaxResult.success("查询成功",sysNotice);
+    public AjaxResult getNoticeListById(){
+        ParameterObject obj =  getParameterObject();
+        SysNotice sysNotice = obj.parseBean(SysNotice.class);
+        Long noticeId = sysNotice.getNoticeId();
+        if(null != noticeId){
+            SysNotice sysNotice1 = sysNoticeService.selectNoticeById(noticeId);
+            return AjaxResult.success("查询成功",sysNotice1);
         }else{
             return AjaxResult.error("参数为空");
         }

+ 1 - 0
dgtly-member/dgtly-member-api/src/main/java/com/dgtly/member/controller/SupplyInfoController.java

@@ -43,6 +43,7 @@ public class SupplyInfoController extends ApiBaseController {
     public Object getSupplyInfoAllList(){
         ParameterObject obj =  getParameterObject();
         NoticeSupply noticeSupply = obj.parseBean(NoticeSupply.class);
+        startPage(obj);/*向分页传递 分页参数*/
         List<NoticeSupply> noticeSupplyList = iNoticeSupplyService.selectNoticeSupplyList(noticeSupply);
         return AjaxResult.success(getDataTable(noticeSupplyList));
     }