id改为string

This commit is contained in:
石皮幼鸟 2024-04-10 18:06:01 +08:00
parent 73b2ddae7d
commit f6d6223bcd
6 changed files with 11 additions and 7 deletions

View File

@ -54,7 +54,7 @@ public class AuthController {
@ApiOperation(value = "用户信息查询不会返回密码查不出status为0的用户")
@GetMapping("/info")
@ApiParam(name = "id", value = "用户ID不传就是拿token查自己")
public R<User> info(@RequestParam(required = false) Integer id, @RequestHeader("token") String token) {
public R<User> info(@RequestParam(required = false) String id, @RequestHeader("token") String token) {
if (id != null) {
return R.ok(authService.getUserInfo(id));
}

View File

@ -15,7 +15,11 @@ public class Level implements Serializable {
/**
* 关卡ID
*/
private Long id;
private String id;
/**
* 关卡序号和id不一致是关卡在游戏中的顺序
*/
private Integer order;
/**
* 关卡名称
*/

View File

@ -15,7 +15,7 @@ public class User implements Serializable {
/**
* 用户ID
*/
private Integer id;
private String id;
/**
* 用户名
*/
@ -65,7 +65,7 @@ public class User implements Serializable {
*/
private String introduction;
/**
* 当前游戏进度关卡ID
* 当前游戏进度关卡序号 **不是关卡id
*/
private Integer progress;

View File

@ -15,7 +15,7 @@ public class UserVo implements Serializable {
/**
* 用户ID
*/
private Integer id;
private String id;
/**
* 用户名
*/

View File

@ -50,7 +50,7 @@ public interface AuthService {
* @param id 用户id
* @return 用户信息
*/
User getUserInfo(Integer id);
User getUserInfo(String id);
/**
* 通过用户名获取信息

View File

@ -101,7 +101,7 @@ public class AuthServiceImpl implements AuthService {
}
@Override
public User getUserInfo(Integer id) {
public User getUserInfo(String id) {
return mongoTemplate.findOne(new Query(Criteria.where("id").is(id).and(CommonConstant.STATUS).ne(0)), User.class);
}