务工者追加app的个人基本信息查询
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserLongInRes;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
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.WgzAppPersonalBasicInformationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -71,5 +71,17 @@ public interface IWgzUserService extends IServicePlus<WgzUser> {
|
||||
*/
|
||||
Boolean userRegister(WgzAppUserRegisterReq bo);
|
||||
|
||||
WgzAppUserLongInRes userLongIn(WgzAppUserLongInReq req);
|
||||
/**
|
||||
* 务工者APP登录账号
|
||||
* @param phone APP务工者登录业务对象
|
||||
* @return bool
|
||||
*/
|
||||
WgzUser userLongIn(String phone);
|
||||
|
||||
/**
|
||||
* 务工者APP登录账号
|
||||
* @param req APP务工者登录业务对象
|
||||
* @return bool
|
||||
*/
|
||||
WgzAppPersonalBasicInformationRes userPersonalBasicInformation(WgzAppPersonalBasicInformationReq req);
|
||||
}
|
||||
|
||||
@ -1,29 +1,26 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserLongInRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
|
||||
import com.ruoyi.wgz.common.SnowflakeIdUtil;
|
||||
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.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -38,9 +35,6 @@ import java.util.Map;
|
||||
@Service
|
||||
public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser> implements IWgzUserService {
|
||||
|
||||
// @Autowired
|
||||
// private TokenService tokenService;
|
||||
|
||||
@Override
|
||||
public WgzUser queryById(String id){
|
||||
return getById(id);
|
||||
@ -109,7 +103,7 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//注册
|
||||
@Override
|
||||
public Boolean userRegister(WgzAppUserRegisterReq bo) {
|
||||
WgzUser wgzUser = new WgzUser();
|
||||
@ -129,35 +123,24 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
return baseMapper.insert(wgzUser) > 0;
|
||||
}
|
||||
|
||||
//登录-获取用户
|
||||
@Override
|
||||
public WgzAppUserLongInRes userLongIn(WgzAppUserLongInReq req) {
|
||||
//1、验证验证码是否正确(展示忽略)
|
||||
//2、验证账号是否存在
|
||||
WgzUser wgzUser = baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getPhone, req.getPhone()));
|
||||
if (wgzUser == null){
|
||||
throw new RuntimeException("账号不存在!");
|
||||
}
|
||||
//3、验证密码是否正确
|
||||
if (!SecurityUtils.matchesPassword(req.getPassword(),wgzUser.getPassword())){
|
||||
throw new RuntimeException("密码错误!");
|
||||
}
|
||||
//4、创建token返回wgzUser
|
||||
// String token = tokenService.createToken(wgzUser);
|
||||
// WgzAppUserLongInRes res = new WgzAppUserLongInRes();
|
||||
// res.setToken(token);
|
||||
return null;
|
||||
public WgzUser userLongIn(String phone) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getPhone, phone));
|
||||
}
|
||||
|
||||
//获取用户个人信息
|
||||
@Override
|
||||
public WgzAppPersonalBasicInformationRes userPersonalBasicInformation(WgzAppPersonalBasicInformationReq req) {
|
||||
//1、根据唯一标识查询用户基本信息
|
||||
WgzUser wgzUser = baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getUserId, req.getUserId()));
|
||||
if (wgzUser == null){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
//2、copy数据返回
|
||||
WgzAppPersonalBasicInformationRes wgzAppPersonalBasicInformationRes = new WgzAppPersonalBasicInformationRes();
|
||||
BeanUtils.copyProperties(wgzUser,wgzAppPersonalBasicInformationRes);
|
||||
return wgzAppPersonalBasicInformationRes;
|
||||
}
|
||||
|
||||
|
||||
// public String createToken(WgzUser wu) {
|
||||
// String token = IdUtil.fastUUID();
|
||||
// loginUser.setToken(token);
|
||||
// setUserAgent(loginUser);
|
||||
// refreshToken(loginUser);
|
||||
//
|
||||
// Map<String, Object> claims = new HashMap<>();
|
||||
// claims.put(Constants.LOGIN_USER_KEY, token);
|
||||
// return createToken(claims);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user