id改为string
This commit is contained in:
parent
73b2ddae7d
commit
f6d6223bcd
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,11 @@ public class Level implements Serializable {
|
|||
/**
|
||||
* 关卡ID
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
/**
|
||||
* 关卡序号(和id不一致,是关卡在游戏中的顺序)
|
||||
*/
|
||||
private Integer order;
|
||||
/**
|
||||
* 关卡名称
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class UserVo implements Serializable {
|
|||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer id;
|
||||
private String id;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
|
|
@ -50,7 +50,7 @@ public interface AuthService {
|
|||
* @param id 用户id
|
||||
* @return 用户信息
|
||||
*/
|
||||
User getUserInfo(Integer id);
|
||||
User getUserInfo(String id);
|
||||
|
||||
/**
|
||||
* 通过用户名获取信息
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue