1.change default nick name

main
Gary 10 months ago
parent cbac8c653f
commit 52dbe96167

@ -120,7 +120,7 @@ public class UserController {
public Result<UserRespDTO> touristLogin() {
UserRespDTO userRespDTO=new UserRespDTO();
userRespDTO.setId(String.valueOf(idWorker.nextId()));
userRespDTO.setNickname("游客"+NickNameUtil.getRandomNickName());
userRespDTO.setNickname("游客-"+NickNameUtil.getRandomNickName());
String token = jwtUtil.createJWT(userRespDTO.getId(),"tourist","tourist");
userRespDTO.setToken(token);
return Result.success(userRespDTO);

@ -6,7 +6,7 @@ import lombok.Data;
public class UserRespDTO {
@ApiModelProperty(value = "ID")
private String id;//ID
@ApiModelProperty(value = "昵称,首次注册登录,登录用户随机为“雀乐XXX”游客为“游客XXX”",example="雀乐XXX")
@ApiModelProperty(value = "昵称,首次注册登录,登录用户随机为“雀乐-XXX”游客为“游客-XXX”, XXX 为2~4位中文昵称",example="雀乐-XXX")
private String nickname;//昵称
@ApiModelProperty(value = "性别0为男1 为女,首次注册登录,留空不显示",example="0")
private String sex;//性别

@ -269,7 +269,7 @@ public class UserService {
user = new User();
user.setId(String.valueOf(idWorker.nextId()));
user.setMobile(mobile);
user.setNickname("雀乐" + NickNameUtil.getRandomNickName());
user.setNickname("雀乐-" + NickNameUtil.getRandomNickName());
userDao.save(user);
} else {
user.setLastdate(new Date());

@ -4,10 +4,6 @@ import com.apifan.common.random.RandomSource;
public class NickNameUtil {
public static String getRandomNickName() {
String rawNickName=RandomSource.personInfoSource().randomChineseNickName(3);
if(rawNickName.length()>3) {
return rawNickName.substring(0, 3);
}
return rawNickName;
return RandomSource.personInfoSource().randomChineseNickName(4);
}
}

Loading…
Cancel
Save