| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package com.dataeasy.server.service.controller;
- import com.dataeasy.server.pojo.user.LoginRequest;
- import com.dataeasy.server.pojo.user.NicknameRequest;
- import com.dataeasy.server.pojo.user.UserInfoVO;
- import com.dataeasy.server.service.manager.IUserManager;
- import me.chanjar.weixin.common.error.WxErrorException;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * @author tyuio
- * @version 1.0.0
- * @description 用户 controller
- * @date 2024/12/13 15:09
- */
- @RestController
- @RequestMapping("/user")
- public class UserController {
- @Autowired
- private IUserManager userManager;
- /**
- * 用户登录
- * @param request
- * @return 访问凭据
- */
- @PostMapping("/login")
- public String login(@RequestBody @Validated LoginRequest request) throws WxErrorException {
- return userManager.login(request);
- }
- /**
- * 查询当前用户信息
- * @return
- */
- @GetMapping("/queryUserInfo")
- public UserInfoVO queryUserInfo() {
- return userManager.queryUserInfo();
- }
- /**
- * 修改昵称
- */
- @PostMapping("/modifyNickname")
- public void modifyNickname(@RequestBody @Validated NicknameRequest request) {
- userManager.modifyNickname(request);
- }
- }
|