feat: 江南体育中心用户管理
This commit is contained in:
@@ -1,15 +1,65 @@
|
||||
package com.xiang.app.server.jntyzx;
|
||||
|
||||
import com.xiang.app.module.jntyzx.pojo.req.UserAddReq;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.UserQueryReq;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.UserStatusUpdateReq;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.UserTokenUpdateReq;
|
||||
import com.xiang.app.module.jntyzx.pojo.req.UsernameReq;
|
||||
import com.xiang.app.module.jntyzx.pojo.resp.JtUserVo;
|
||||
import com.xiang.app.modules.jntyzx.service.IUserTokenInfoService;
|
||||
import com.xiang.xservice.basic.common.resp.Result;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 江南体育中心用户管理控制器
|
||||
*
|
||||
* @Author: xiang
|
||||
* @Date: 2026-03-24 16:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/private/apps/jntyzx/user/")
|
||||
@RequestMapping("/private/apps/jntyzx/user")
|
||||
@RequiredArgsConstructor
|
||||
public class UserTokenServer {
|
||||
|
||||
public Result<>
|
||||
private final IUserTokenInfoService userTokenInfoService;
|
||||
|
||||
|
||||
@PostMapping("/list")
|
||||
public Result<List<JtUserVo>> list(@RequestBody @NotNull(message = "请求参数不能为空") @Valid UserQueryReq req) {
|
||||
return Result.data(userTokenInfoService.list(req));
|
||||
}
|
||||
@GetMapping("/info/{id}")
|
||||
public Result<JtUserVo> info(@PathVariable("id") Long userId) {
|
||||
return Result.data(userTokenInfoService.info(userId));
|
||||
}
|
||||
|
||||
@PostMapping("/updateToken")
|
||||
public Result<Boolean> updateToken(@RequestBody @NotNull(message = "请求参数不能为空") @Valid UserTokenUpdateReq req) {
|
||||
return Result.data(userTokenInfoService.updateTokenByName(req.getUsername(), req.getToken()));
|
||||
}
|
||||
|
||||
@PostMapping("/updateStatus")
|
||||
public Result<Boolean> updateStatus(@RequestBody @NotNull(message = "请求参数不能为空") @Valid UserStatusUpdateReq req) {
|
||||
return Result.data(userTokenInfoService.updateStatusByUserName(req.getUsername(), req.getStatus()));
|
||||
}
|
||||
|
||||
@PostMapping("/refreshToken")
|
||||
public Result<Boolean> refreshToken(@RequestBody @NotNull(message = "请求参数不能为空") @Valid UsernameReq req) {
|
||||
return Result.data(userTokenInfoService.refreshToken(req.getUsername()));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result<Boolean> addUser(@RequestBody @NotNull(message = "请求参数不能为空") @Valid UserAddReq req) {
|
||||
return Result.data(userTokenInfoService.save(req));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user