获取用户信息
parent
949c63432d
commit
22a98befb6
|
@ -2,6 +2,7 @@ package com.jwl.driver.server.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.jwl.driver.server.dto.LoginUserDto;
|
import com.jwl.driver.server.dto.LoginUserDto;
|
||||||
|
import com.jwl.driver.server.exception.BusinessException;
|
||||||
import com.jwl.driver.server.response.BaseResponse;
|
import com.jwl.driver.server.response.BaseResponse;
|
||||||
import com.jwl.driver.server.service.ITdSysUserService;
|
import com.jwl.driver.server.service.ITdSysUserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
@ -14,6 +15,7 @@ import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -64,6 +66,9 @@ public class TdSysUserController {
|
||||||
@PostMapping("/bindSchool")
|
@PostMapping("/bindSchool")
|
||||||
public BaseResponse bindSchool(@RequestBody LoginUserDto userDto) {
|
public BaseResponse bindSchool(@RequestBody LoginUserDto userDto) {
|
||||||
log.info("用户绑定驾校======>schoolId{}",userDto.getSchoolId());
|
log.info("用户绑定驾校======>schoolId{}",userDto.getSchoolId());
|
||||||
|
if (Objects.isNull(userDto.getSchoolId())){
|
||||||
|
throw new BusinessException("缺少必要参数");
|
||||||
|
}
|
||||||
return BaseResponse.success(userService.bindSchool(userDto));
|
return BaseResponse.success(userService.bindSchool(userDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,5 @@ public class LoginUserDto {
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@ApiModelProperty(value = "驾校id",required = false)
|
@ApiModelProperty(value = "驾校id",required = false)
|
||||||
@NotBlank(message = "驾校id")
|
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class TdSysUserServiceImpl extends ServiceImpl<TdSysUserMapper, TdSysUser
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public LoginUserVo login(LoginUserDto loginUserDto) {
|
public LoginUserVo login(LoginUserDto loginUserDto) {
|
||||||
//校验验证码 如果是默认验证码则不需要校验
|
//校验验证码 如果是默认验证码则不需要校验
|
||||||
if (StrUtil.equals(Constants.DEFAULT_MESSAGE_CODE,loginUserDto.getCode())){
|
if (!StrUtil.equals(Constants.DEFAULT_MESSAGE_CODE,loginUserDto.getCode())){
|
||||||
String code = redisCache.getCacheObject(Constants.MESSAGE_CODE_PREFIX + loginUserDto.getPhone());
|
String code = redisCache.getCacheObject(Constants.MESSAGE_CODE_PREFIX + loginUserDto.getPhone());
|
||||||
|
|
||||||
if (StrUtil.isBlank(code)){
|
if (StrUtil.isBlank(code)){
|
||||||
|
|
Loading…
Reference in New Issue