|
|
@@ -1,17 +1,17 @@
|
|
|
package com.ruoyi.web.controller.system;
|
|
|
|
|
|
import java.util.List;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.ruoyi.common.annotation.Anonymous;
|
|
|
+import com.ruoyi.system.utils.Auth;
|
|
|
+import com.ruoyi.system.utils.JwtUtil;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
@@ -34,6 +34,22 @@ public class PushMessageController extends BaseController
|
|
|
@Autowired
|
|
|
private IPushMessageService pushMessageService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 骑手、商家端获取推送消息分页列表
|
|
|
+ */
|
|
|
+ @Anonymous
|
|
|
+ @Auth
|
|
|
+ @GetMapping("/getPushMessageList")
|
|
|
+ public AjaxResult getPushMessageList(@RequestHeader String token, @RequestParam Integer pageNum, @RequestParam Integer pageSize) {
|
|
|
+ JwtUtil jwtUtil = new JwtUtil();
|
|
|
+ String uid = jwtUtil.getusid(token);
|
|
|
+ Page<PushMessage> page = new Page<>(pageNum,pageSize);
|
|
|
+ LambdaQueryWrapper<PushMessage> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PushMessage::getUserId,uid).orderByDesc(PushMessage::getTime);
|
|
|
+ IPage<PushMessage> data = pushMessageService.page(page,queryWrapper);
|
|
|
+ return success(data);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询推送消息列表
|
|
|
*/
|