|
@@ -1,9 +1,10 @@
|
|
|
package com.caimei365.user.service.impl;
|
|
|
|
|
|
+import com.caimei365.user.mapper.BaseMapper;
|
|
|
import com.caimei365.user.mapper.LoginMapper;
|
|
|
-import com.caimei365.user.mapper.RegisterUserDao;
|
|
|
+import com.caimei365.user.mapper.RegisterMapper;
|
|
|
import com.caimei365.user.model.*;
|
|
|
-import com.caimei365.user.service.ClubService;
|
|
|
+import com.caimei365.user.service.RegisterService;
|
|
|
import com.caimei365.user.components.RedisService;
|
|
|
import com.caimei365.user.utils.AliyunSmsUtil;
|
|
|
import com.caimei365.user.utils.Md5Util;
|
|
@@ -27,14 +28,14 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
-public class ClubServiceImpl implements ClubService {
|
|
|
+public class RegisterServiceImpl implements RegisterService {
|
|
|
|
|
|
@Resource
|
|
|
private RedisService redisService;
|
|
|
@Resource
|
|
|
- private LoginMapper loginMapper;
|
|
|
+ private BaseMapper baseMapper;
|
|
|
@Resource
|
|
|
- private RegisterUserDao registerUserDao;
|
|
|
+ private RegisterMapper registerMapper;
|
|
|
|
|
|
/**
|
|
|
* 普通机构入驻(注册)
|
|
@@ -54,7 +55,7 @@ public class ClubServiceImpl implements ClubService {
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public JsonModel<UserPo> register(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange) {
|
|
|
+ public JsonModel<UserPo> clubRegister(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange) {
|
|
|
// 打印IP
|
|
|
String ip = RequestUtil.getIp(serverWebExchange);
|
|
|
log.info("X-Forwarded-For:" + ip);
|
|
@@ -75,12 +76,12 @@ public class ClubServiceImpl implements ClubService {
|
|
|
return JsonModel.error("请勾选同意协议", null);
|
|
|
}
|
|
|
// 查找用户表是否存在
|
|
|
- Integer dbUserId = loginMapper.getUserIdByMobile(bindMobile);
|
|
|
+ Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
|
|
|
if (dbUserId > 0) {
|
|
|
return JsonModel.error("该手机号已被使用", null);
|
|
|
}
|
|
|
// 查找运营人员表是否存在
|
|
|
- Integer dbOperationId = loginMapper.getOperationIdByMobile(bindMobile);
|
|
|
+ Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
|
|
|
if (dbOperationId > 0) {
|
|
|
return JsonModel.error("您已是机构运营人员,无需再注册机构", null);
|
|
|
}
|
|
@@ -124,7 +125,7 @@ public class ClubServiceImpl implements ClubService {
|
|
|
/*
|
|
|
保存数据库 user
|
|
|
*/
|
|
|
- int insertFlag = registerUserDao.insertClubUser(user);
|
|
|
+ int insertFlag = registerMapper.insertClubUser(user);
|
|
|
if (insertFlag < 1) {
|
|
|
throw new RuntimeException("插入数据库异常user:" + user.toString());
|
|
|
}
|
|
@@ -151,13 +152,13 @@ public class ClubServiceImpl implements ClubService {
|
|
|
/*
|
|
|
保存数据库 club
|
|
|
*/
|
|
|
- int insertClubFlag = registerUserDao.insertClub(club);
|
|
|
+ int insertClubFlag = registerMapper.insertClub(club);
|
|
|
if (insertClubFlag < 1) {
|
|
|
throw new RuntimeException("插入数据库异常club:" + club.toString());
|
|
|
}
|
|
|
// user更新clubId
|
|
|
user.setClubId(club.getClubId());
|
|
|
- registerUserDao.updateUserClubId(user.getUserId(), club.getClubId());
|
|
|
+ registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
|
|
|
// 注册成功短信
|
|
|
boolean smsFlag = AliyunSmsUtil.sendSms(bindMobile, 7, "{name:"+ bindMobile +",password:"+ password +"}");
|
|
|
if (!smsFlag) {
|
|
@@ -203,7 +204,7 @@ public class ClubServiceImpl implements ClubService {
|
|
|
/*
|
|
|
保存数据库 operation
|
|
|
*/
|
|
|
- int insertOperationFlag = registerUserDao.insertOperation(operation);
|
|
|
+ int insertOperationFlag = registerMapper.insertOperation(operation);
|
|
|
if (insertOperationFlag < 1) {
|
|
|
log.info(operation.getUserId() + " 插入数据库异常operation:" + operation.toString());
|
|
|
}
|