添加自定义处理接口

This commit is contained in:
wanggeng888 2021-05-02 16:24:24 +08:00
parent ff85d70c00
commit e15c96abd4
3 changed files with 10 additions and 5 deletions

View File

@ -41,7 +41,7 @@ public class RegisterWechatController extends DefaultBaseController {
@Autowired
private IOfficialAccountRegisterService officialAccountRegisterService;
@ApiOperation(value = "手机注册", notes = "手机注册,手机 + 短信验证码接口")
@ApiOperation(value = "手机注册", notes = "手机注册,手机 + 用户验证码注册接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("phone")
@CheckRequestBodyAnnotation

View File

@ -21,6 +21,7 @@ public interface IOfficialAccountRegisterService {
*
* @param officialAccountRegisterPhoneVO
* @param params
* @throws Exception
*/
void phoneRegister(OfficialAccountRegisterPhoneVO officialAccountRegisterPhoneVO, Map<String, Object> params);
void phoneRegister(OfficialAccountRegisterPhoneVO officialAccountRegisterPhoneVO, Map<String, Object> params) throws Exception;
}

View File

@ -3,8 +3,7 @@ package ink.wgink.register.wechat.service.official.account.impl;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.wechat.pojo.dtos.official.account.OfficialAccountUserDTO;
import ink.wgink.interfaces.expand.register.IRegisterHandlerService;
import ink.wgink.module.wechat.pojo.pos.official.account.OfficialAccountUserPO;
import ink.wgink.module.wechat.service.official.account.IOfficialAccountUserService;
import ink.wgink.register.wechat.service.miniapp.OfficialAccountRegisterPhoneVO;
@ -29,13 +28,15 @@ import java.util.Map;
@Service
public class OfficialAccountRegisterServiceImpl extends DefaultBaseService implements IOfficialAccountRegisterService {
@Autowired(required = false)
private IRegisterHandlerService registerHandler;
@Autowired
private IUserService userService;
@Autowired
private IOfficialAccountUserService officialAccountUserService;
@Override
public void phoneRegister(OfficialAccountRegisterPhoneVO officialAccountRegisterPhoneVO, Map<String, Object> params) {
public void phoneRegister(OfficialAccountRegisterPhoneVO officialAccountRegisterPhoneVO, Map<String, Object> params) throws Exception {
OfficialAccountUserPO officialAccountUserPO = officialAccountUserService.getPOByUserCode(officialAccountRegisterPhoneVO.getUserCode());
if (officialAccountUserPO == null) {
throw new SearchException("验证码错误");
@ -50,6 +51,9 @@ public class OfficialAccountRegisterServiceImpl extends DefaultBaseService imple
userService.updateUsername(officialAccountUserPO.getUserId(), updateUsernameVO);
// 修改初始账号标识
officialAccountUserService.updateIsInitAccount(officialAccountUserPO.getOpenId(), 0);
if (registerHandler == null) {
registerHandler.handler(officialAccountUserPO.getUserId(), params);
}
}