mirror of
https://github.com/RemainderTime/spring-boot-base-demo.git
synced 2026-03-04 03:00:45 +08:00
1. springboot版本升级3.x
2. mybatis plus版本升级3.x 3. dynamic mybatis plus版本升级3.x 4. redis版本升级3.x 5. reids实现配置优化 6. 替换swagger依赖(支持3.x) 7. 新增请求头工具类 8. 参数校验异常捕获优化 9. 拦截器注册为spring容器管理 10. 新增本地日志配置文件
This commit is contained in:
@@ -5,8 +5,7 @@ import cn.xf.basedemo.common.model.RetObj;
|
||||
import cn.xf.basedemo.interceptor.SessionContext;
|
||||
import cn.xf.basedemo.model.res.LoginInfoRes;
|
||||
import cn.xf.basedemo.service.UserService;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author: xiongfeng
|
||||
* @create: 2022-06-28 09:17
|
||||
**/
|
||||
@Api(tags = "用户控制器")
|
||||
@RestController(value = "用户控制器")
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@@ -28,16 +26,14 @@ public class UserController {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@ApiOperation(value = "用户登录", notes = "用户登录")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "用户登录", description = "用户登录")
|
||||
@PostMapping("/login")
|
||||
public RetObj login(@RequestBody LoginInfoRes res){
|
||||
|
||||
return userService.login(res);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户信息", notes = "用户信息")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "用户信息", description = "用户信息")
|
||||
@PostMapping("/info")
|
||||
public RetObj info(){
|
||||
LoginUser loginUser = SessionContext.getInstance().get();
|
||||
|
||||
Reference in New Issue
Block a user