feat(user): 新增用户详情接口并放开鉴权
This commit is contained in:
@@ -73,7 +73,8 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
"/character/listByTag",
|
||||
"/user/login",
|
||||
"/character/listByUser",
|
||||
"/user/updateInfo"
|
||||
"/user/updateInfo",
|
||||
"/user/detail"
|
||||
};
|
||||
}
|
||||
@Bean
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.yolo.keyborad.model.dto.AppleLoginReq;
|
||||
import com.yolo.keyborad.model.dto.user.KeyboardUserReq;
|
||||
import com.yolo.keyborad.model.dto.user.UserLoginDTO;
|
||||
import com.yolo.keyborad.model.entity.KeyboardUser;
|
||||
import com.yolo.keyborad.model.vo.user.KeyboardUserInfoRespVO;
|
||||
import com.yolo.keyborad.model.vo.user.KeyboardUserRespVO;
|
||||
import com.yolo.keyborad.service.IAppleService;
|
||||
import com.yolo.keyborad.service.UserService;
|
||||
@@ -69,4 +70,12 @@ public class UserController {
|
||||
public BaseResponse<Boolean> update(@RequestBody KeyboardUserReq keyboardUserReq) {
|
||||
return ResultUtils.success(userService.updateUserInfo(keyboardUserReq));
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
@Operation(summary = "获取用户详情", description = "获取用户详情接口")
|
||||
public BaseResponse<KeyboardUserInfoRespVO> detail() {
|
||||
long loginId = StpUtil.getLoginIdAsLong();
|
||||
KeyboardUser keyboardUser = userService.getById(loginId);
|
||||
return ResultUtils.success(BeanUtil.copyProperties(keyboardUser, KeyboardUserInfoRespVO.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yolo.keyborad.model.vo.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/12/2 18:08
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Schema(description="用户信息")
|
||||
public class KeyboardUserInfoRespVO {
|
||||
|
||||
|
||||
@Schema(description="用户ID")
|
||||
private Long uid;
|
||||
|
||||
@Schema(description="用户昵称")
|
||||
private String nickName;
|
||||
|
||||
@Schema(description="性别")
|
||||
private Integer gender;
|
||||
|
||||
|
||||
@Schema(description="头像URL")
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 邮箱地址
|
||||
*/
|
||||
@Schema(description="邮箱地址")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 邮箱是否验证
|
||||
*/
|
||||
@Schema(description="邮箱是否验证")
|
||||
private Boolean emailVerified;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user