实名认证
This commit is contained in:
@ -3,6 +3,7 @@ package com.ruoyi.wgz.service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppModifyingUserProfilePictureReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzRealNameAuthenticationReq;
|
||||
@ -69,29 +70,26 @@ public interface IWgzUserService extends IServicePlus<WgzUser> {
|
||||
|
||||
/**
|
||||
* 务工者APP注册账号
|
||||
* @param bo APP务工者注册业务对象
|
||||
* @return bool
|
||||
*/
|
||||
Boolean userRegister(WgzAppUserRegisterReq bo);
|
||||
|
||||
/**
|
||||
* 修改用户头像修改用户头像
|
||||
*/
|
||||
Boolean userModifyingUserProfilePicture(@Validated @RequestBody WgzAppModifyingUserProfilePictureReq req);
|
||||
|
||||
/**
|
||||
* 务工者APP登录账号
|
||||
* @param phone APP务工者登录业务对象
|
||||
* @return bool
|
||||
*/
|
||||
WgzUser userLongIn(String phone);
|
||||
|
||||
/**
|
||||
* 务工者APP登录账号
|
||||
* @param req APP务工者登录业务对象
|
||||
* @return bool
|
||||
* 务工者APP个人基本信息
|
||||
*/
|
||||
WgzAppPersonalBasicInformationRes userPersonalBasicInformation(WgzAppPersonalBasicInformationReq req);
|
||||
|
||||
/**
|
||||
* 务工者APP实名认证
|
||||
* @param req APP务工者实名认证业务对象
|
||||
* @return bool
|
||||
*/
|
||||
Boolean userRealNameAuthentication(@Validated @RequestBody WgzRealNameAuthenticationReq req);
|
||||
}
|
||||
|
||||
@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.domain.dto.AnnexDTO;
|
||||
import com.ruoyi.common.service.IAnnexService;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppModifyingUserProfilePictureReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzRealNameAuthenticationReq;
|
||||
@ -19,8 +23,11 @@ import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.mapper.WgzUserMapper;
|
||||
import com.ruoyi.wgz.service.IWgzUserService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -36,6 +43,9 @@ import java.util.Map;
|
||||
@Service
|
||||
public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser> implements IWgzUserService {
|
||||
|
||||
@Autowired
|
||||
private IAnnexService iAnnexService;
|
||||
|
||||
@Override
|
||||
public WgzUser queryById(String id){
|
||||
return getById(id);
|
||||
@ -124,6 +134,17 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
return baseMapper.insert(wgzUser) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean userModifyingUserProfilePicture(WgzAppModifyingUserProfilePictureReq req) {
|
||||
WgzUser user = new WgzUser();
|
||||
BeanUtils.copyProperties(req, user);
|
||||
int update = baseMapper.update(user, new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getUserId, req.getUserId()));
|
||||
if (update == 0){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//登录-获取用户
|
||||
@Override
|
||||
public WgzUser userLongIn(String phone) {
|
||||
@ -146,12 +167,21 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
|
||||
//实名认证
|
||||
@Override
|
||||
@Transactional()
|
||||
public Boolean userRealNameAuthentication(WgzRealNameAuthenticationReq req) {
|
||||
//1、对指定用户进行实名认证
|
||||
WgzUser user = new WgzUser();
|
||||
BeanUtils.copyProperties(req,user);
|
||||
BeanUtils.copyProperties(req, user);
|
||||
int update = baseMapper.update(user, new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getUserId, req.getUserId()));
|
||||
return update>0;
|
||||
if (update == 0){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
//2、新增附件
|
||||
List<Annex> annex = req.getAnnex();
|
||||
List<AnnexDTO> annexDTOS = new ArrayList<>();
|
||||
BeanUtils.copyProperties(annex, annexDTOS);
|
||||
iAnnexService.insertBatch(annexDTOS);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user