|
@@ -53,8 +53,8 @@ public class ClubServiceImpl implements ClubService {
|
|
|
* @return BaseUser
|
|
|
*/
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
- public JsonModel<BaseUser> register(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange) {
|
|
|
+ @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) {
|
|
|
// 打印IP
|
|
|
String ip = RequestUtil.getIp(serverWebExchange);
|
|
|
log.info("X-Forwarded-For:" + ip);
|
|
@@ -126,8 +126,7 @@ public class ClubServiceImpl implements ClubService {
|
|
|
*/
|
|
|
int insertFlag = registerUserDao.insertClubUser(user);
|
|
|
if (insertFlag < 1) {
|
|
|
- log.info(user.getUserId() + " 插入数据库异常user:" + user.toString());
|
|
|
- return JsonModel.error("插入数据库异常", null);
|
|
|
+ throw new RuntimeException("插入数据库异常user:" + user.toString());
|
|
|
}
|
|
|
/*
|
|
|
组装机构数据
|
|
@@ -154,8 +153,7 @@ public class ClubServiceImpl implements ClubService {
|
|
|
*/
|
|
|
int insertClubFlag = registerUserDao.insertClub(club);
|
|
|
if (insertClubFlag < 1) {
|
|
|
- log.info(club.getUserId() + " 插入数据库异常club:" + club.toString());
|
|
|
- return JsonModel.error("插入数据库异常", null);
|
|
|
+ throw new RuntimeException("插入数据库异常club:" + club.toString());
|
|
|
}
|
|
|
// user更新clubId
|
|
|
user.setClubId(club.getClubId());
|
|
@@ -208,13 +206,10 @@ public class ClubServiceImpl implements ClubService {
|
|
|
int insertOperationFlag = registerUserDao.insertOperation(operation);
|
|
|
if (insertOperationFlag < 1) {
|
|
|
log.info(operation.getUserId() + " 插入数据库异常operation:" + operation.toString());
|
|
|
- return JsonModel.error("插入数据库异常", null);
|
|
|
}
|
|
|
log.info("注册普通机构,默认绑定为机构运营人员");
|
|
|
}
|
|
|
- //return model.success(clubVo);
|
|
|
-
|
|
|
- return null;
|
|
|
+ return JsonModel.success(user);
|
|
|
}
|
|
|
}
|
|
|
|