添加根据手机号查询用户信息接口
This commit is contained in:
@ -1,10 +1,7 @@
|
|||||||
package com.sczx.user.controller;
|
package com.sczx.user.controller;
|
||||||
|
|
||||||
import com.sczx.user.common.Result;
|
import com.sczx.user.common.Result;
|
||||||
import com.sczx.user.dto.AlipayMiniProgramRegRequest;
|
import com.sczx.user.dto.*;
|
||||||
import com.sczx.user.dto.AuthRequest;
|
|
||||||
import com.sczx.user.dto.LoginResponse;
|
|
||||||
import com.sczx.user.dto.WxMiniProgramRegRequest;
|
|
||||||
import com.sczx.user.service.IUserService;
|
import com.sczx.user.service.IUserService;
|
||||||
import com.sczx.user.util.JwtUtil;
|
import com.sczx.user.util.JwtUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -82,4 +79,10 @@ public class AuthController {
|
|||||||
public Result<LoginResponse> getLoginTokenByMobile(@RequestParam("mobile") String mobile) {;
|
public Result<LoginResponse> getLoginTokenByMobile(@RequestParam("mobile") String mobile) {;
|
||||||
return Result.ok(userService.getLoginTokenByMobile(mobile));
|
return Result.ok(userService.getLoginTokenByMobile(mobile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据手机号获取用户信息", notes = "根据手机号获取用户信息")
|
||||||
|
@GetMapping("/getUInfoByMobile")
|
||||||
|
public Result<SimpleUserInfoDTO> getUInfoByMobile(@RequestParam("mobile") String mobile) {;
|
||||||
|
return Result.ok(userService.getUserInfoByMobile(mobile));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,4 +76,11 @@ public interface IUserService {
|
|||||||
* @return 登录token
|
* @return 登录token
|
||||||
*/
|
*/
|
||||||
LoginResponse getLoginTokenByMobile(String mobile);
|
LoginResponse getLoginTokenByMobile(String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号获取用户信息
|
||||||
|
* @param mobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SimpleUserInfoDTO getUserInfoByMobile(String mobile);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -358,6 +358,14 @@ public class UserServiceImpl implements IUserService {
|
|||||||
return getLoginResponse(baseUserPO,MiniProgramTypeEnum.WECHAT);
|
return getLoginResponse(baseUserPO,MiniProgramTypeEnum.WECHAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SimpleUserInfoDTO getUserInfoByMobile(String mobile) {
|
||||||
|
LambdaQueryWrapper<BaseUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(BaseUserPO::getPhoneNumber, mobile).last( " limit 1");
|
||||||
|
BaseUserPO baseUserPO = baseUserRepo.getOne(queryWrapper);
|
||||||
|
return UserInfoConvert.INSTANCE.poToSimpleDTO(baseUserPO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录信息
|
* 获取登录信息
|
||||||
* @param programId
|
* @param programId
|
||||||
|
|||||||
Reference in New Issue
Block a user