diff --git a/src/main/java/com/zh/project0512/controller/wxApp/AppMessageController.java b/src/main/java/com/zh/project0512/controller/wxApp/AppMessageController.java index 864f0eb..796ff1a 100644 --- a/src/main/java/com/zh/project0512/controller/wxApp/AppMessageController.java +++ b/src/main/java/com/zh/project0512/controller/wxApp/AppMessageController.java @@ -2,6 +2,8 @@ package com.zh.project0512.controller.wxApp; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.zh.project0512.annotation.TokenValid; import com.zh.project0512.model.AppMessage; import com.zh.project0512.model.User; import com.zh.project0512.service.IAppMessageService; @@ -9,15 +11,23 @@ import com.zh.project0512.service.IUserService; import com.zh.project0512.utils.JwtUtil; import com.zh.project0512.utils.MybatisPlusUtil; import com.zh.project0512.utils.result.Result; +import io.jsonwebtoken.Claims; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + /** *
- * app消息 + * app消息 *
* * @author zh @@ -29,16 +39,44 @@ import org.springframework.web.bind.annotation.*; public class AppMessageController { @Autowired private IAppMessageService appMessageService; - @Autowired - private IUserService userService; + + @Operation(summary = "消息列表") @PostMapping("/list") - public Result list( @RequestBody JSONObject obj, @RequestHeader(value = "token") @Parameter(name = "登录token") String token){ + @TokenValid + public Result list(@RequestBody JSONObject obj, @RequestHeader(value = "token") @Parameter(name = "登录token") String token) { String openid = new JwtUtil().parseOpenid(token); User user = userService.selByOpenid(openid); QueryWrapper