Commit 24bee1c6 authored by tangtuo's avatar tangtuo

登录接口加入实名认证信息

parent 443cfd21
......@@ -72,6 +72,9 @@ public class User extends AbstractUser {
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Long updateTime;
@ApiModelProperty("个人实名认证信息")
@TableField(exist = false)
private AuthPerson authPerson;
@Override
public String appId() {
......
......@@ -8,4 +8,6 @@ import com.fzm.common.entity.AuthPerson;
* @date 2021/6/28 11:28
*/
public interface AuthPersonService extends IService<AuthPerson> {
AuthPerson getByUserId(Integer userId);
}
package com.fzm.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.AuthPerson;
import com.fzm.common.mapper.AuthPersonMapper;
import com.fzm.common.service.AuthPersonService;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/6/28 11:29
*/
@Service
public class AuthPersonServiceImpl extends ServiceImpl<AuthPersonMapper, AuthPerson> implements AuthPersonService {
@Override
public AuthPerson getByUserId(Integer userId) {
QueryWrapper<AuthPerson> wrapper = new QueryWrapper<>();
wrapper.eq("user_id", userId);
return getOne(wrapper);
}
}
......@@ -138,6 +138,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
throw GlobalException.newException(ResultCode.VALIDATE_FAILED, "验证码校验失败");
}
}
// 认证成功的用户需要返回实名认证信息
if (AuthStatusEnum.SUCCESS.getStatus().equals(user.getAuthStatus())) {
// 个人认证
if (AuthTypeEnum.PERSON.getType().equals(user.getAuthType())) {
AuthPerson authPerson = authPersonService.getByUserId(user.getId());
user.setAuthPerson(authPerson);
}
//TODO 企业认证
}
return user;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment