Commit cfce3d66 authored by zhaobiyan's avatar zhaobiyan

用户注册新增推荐码

parent 6afa9a19
......@@ -43,4 +43,7 @@ public class AppAuthRegReqVO {
@ApiModelProperty(value = "英文名称", required = false, example = "+86")
private String englishName;
@ApiModelProperty(value = "推荐码", required = false)
private String referralCode;
}
......@@ -95,6 +95,8 @@ public class MemberUserDO extends TenantBaseDO {
*/
private String controlPassword;
private String referralCode;
///**
// * 是否身份认证
// */
......
......@@ -117,7 +117,7 @@ public class MemberAuthServiceImpl implements MemberAuthService {
}
// 获得获得注册用户
MemberUserDO user = userService.createUser(reqVO.getMobile(), userIp, reqVO.getPassword(),reqVO.getAreaCode(), reqVO.getEnglishName());
MemberUserDO user = userService.createUser(reqVO.getMobile(), userIp, reqVO.getPassword(),reqVO.getAreaCode(), reqVO.getEnglishName(), reqVO.getReferralCode());
Assert.notNull(user, "创建用户失败,结果为空");
//记录日志
......
package cn.iocoder.yudao.module.member.service.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.member.api.user.dto.UserSelectReqVO;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.UserBackVO;
......@@ -51,9 +50,10 @@ public interface MemberUserService {
* @param mobile
* @param registerIp
* @param password
* @param referralCode
* @return
*/
MemberUserDO createUser(String mobile, String registerIp, String password, String areaCode, String englishName);
MemberUserDO createUser(String mobile, String registerIp, String password, String areaCode, String englishName, String referralCode);
/**
* 更新用户的最后登陆信息
......
......@@ -172,7 +172,7 @@ public class MemberUserServiceImpl implements MemberUserService {
}
String englishName = maskMobileNumber(mobile);
// 用户不存在,则进行创建
user = this.createUser(mobile, registerIp, null, areaCode, englishName);
user = this.createUser(mobile, registerIp, null, areaCode, englishName, null);
//记录日志
UserOperationLogCreateReqVO userOperationLogCreateReqVO = new UserOperationLogCreateReqVO();
......@@ -202,7 +202,7 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override
@Transactional(rollbackFor = Exception.class)
public MemberUserDO createUser(String mobile, String registerIp, String password, String areacode, String englishName) {
public MemberUserDO createUser(String mobile, String registerIp, String password, String areacode, String englishName, String referralCode) {
// 生成密码
/* if (StrUtil.isBlank(password)) {
password = IdUtil.fastSimpleUUID();
......@@ -222,6 +222,7 @@ public class MemberUserServiceImpl implements MemberUserService {
user.setEnglishName(englishName);
user.setNickname(englishName);
user.setCode(getNextMemberCode());
user.setReferralCode(referralCode);
memberUserMapper.insert(user);
//站内信
InternalMessageCreateDto dto = InternalMessageCreateDto.builder().toIdList(Arrays.asList(user.getId()))
......
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