feat: 新增会员注册接口

This commit is contained in:
weizhiqiang 2024-09-18 11:10:07 +08:00
parent 9495618ca4
commit d4345c983d
7 changed files with 46 additions and 5 deletions

View file

@ -50,7 +50,7 @@ public class EnclosureLinkController {
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "queryEnclosureLinkList", value = "根据业务对象数据获取附件与业务对象关系", method = "POST", allUse = "2")
@ApiOperation(id = "queryEnclosureLinkList", value = "根据业务对象数据获取附件与业务对象关系", method = "POST", allUse = "0")
@ApiImplicitParams({
@ApiImplicitParam(id = "objectId", name = "objectId", value = "业务对象数据的id", required = "required"),
@ApiImplicitParam(id = "objectKey", name = "objectKey", value = "业务对象服务的className", required = "required")})
@ -65,7 +65,7 @@ public class EnclosureLinkController {
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "deleteEnclosureLink", value = "根据业务对象数据删除附件与业务对象关系", method = "POST", allUse = "2")
@ApiOperation(id = "deleteEnclosureLink", value = "根据业务对象数据删除附件与业务对象关系", method = "POST", allUse = "0")
@ApiImplicitParams({
@ApiImplicitParam(id = "objectId", name = "objectId", value = "业务对象数据的id", required = "required"),
@ApiImplicitParam(id = "objectKey", name = "objectKey", value = "业务对象服务的className", required = "required")})

View file

@ -5,6 +5,7 @@
package com.skyeye.enclosure.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
@ -94,8 +95,10 @@ public class SysEnclosureServiceImpl extends SkyeyeBusinessServiceImpl<SysEnclos
}
tree.putExtra("objectType", objectType);
});
outputObject.setBeans(treeNodes);
outputObject.settotal(treeNodes.size());
if (CollectionUtil.isNotEmpty(treeNodes)) {
outputObject.setBeans(treeNodes);
outputObject.settotal(treeNodes.size());
}
}
}

View file

@ -162,6 +162,9 @@ public class AbstractTeamServiceImpl<D extends SkyeyeBaseMapper<T>, T extends Ab
}
private List<TeamRoleUser> getTeamRoleUserList(List<TeamRole> teamRoleList) {
if (CollectionUtil.isEmpty(teamRoleList)) {
return CollectionUtil.newArrayList();
}
return teamRoleList.stream()
.filter(teamRole -> CollectionUtil.isNotEmpty(teamRole.getTeamRoleUserList()))
.flatMap(teamRole -> {

View file

@ -81,4 +81,13 @@ public class ShopAppAuthController {
shopAppAuthService.smsShopLogin(inputObject, outputObject);
}
@ApiOperation(id = "smsShopMemberRegister", value = "会员注册", method = "POST", allUse = "0")
@ApiImplicitParams({
@ApiImplicitParam(id = "mobile", name = "mobile", value = "手机号", required = "required"),
@ApiImplicitParam(id = "smsCode", name = "smsCode", value = "短信验证码", required = "required")})
@RequestMapping("/post/ShopAppAuthController/smsShopMemberRegister")
public void smsShopMemberRegister(InputObject inputObject, OutputObject outputObject) {
shopAppAuthService.smsShopMemberRegister(inputObject, outputObject);
}
}

View file

@ -28,4 +28,6 @@ public interface ShopAppAuthService {
void sendShopSmsCode(InputObject inputObject, OutputObject outputObject);
void smsShopLogin(InputObject inputObject, OutputObject outputObject);
void smsShopMemberRegister(InputObject inputObject, OutputObject outputObject);
}

View file

@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.skyeye.common.constans.CommonNumConstants;
import com.skyeye.common.constans.SysUserAuthConstants;
import com.skyeye.common.enumeration.EnableEnum;
import com.skyeye.common.enumeration.RequestType;
import com.skyeye.common.enumeration.SmsSceneEnum;
import com.skyeye.common.object.GetUserToken;
@ -24,9 +25,12 @@ import com.skyeye.service.ShopAppAuthService;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
import static com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl.TRANSACTION_MANAGER_VALUE;
/**
* @ClassName: ShopAppAuthServiceImpl
* @Description: 商城登录管理服务层
@ -162,4 +166,24 @@ public class ShopAppAuthServiceImpl implements ShopAppAuthService {
outputObject.setBean(member);
outputObject.settotal(CommonNumConstants.NUM_ONE);
}
@Override
@Transactional(value = TRANSACTION_MANAGER_VALUE, rollbackFor = Exception.class)
public void smsShopMemberRegister(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> params = inputObject.getParams();
String mobile = params.get("mobile").toString();
String smsCode = params.get("smsCode").toString();
// 校验验证码
iSmsCodeService.validateSmsCode(mobile, smsCode, SmsSceneEnum.LOGIN.getKey());
Member member = memberService.queryMemberByPhone(mobile);
if (ObjectUtil.isNotEmpty(member)) {
throw new CustomException("手机号已经被使用");
}
// 注册
Member saveMember = new Member();
saveMember.setPhone(mobile);
saveMember.setName("未命名");
saveMember.setEnabled(EnableEnum.ENABLE_USING.getKey());
memberService.createEntity(saveMember, null);
}
}

View file

@ -13,7 +13,7 @@ spring:
repositories:
enabled: false # 项目未使用到 Spring Data Redis 的 Repository所以直接禁用保证启动速度
profiles:
active: public
active: dev
cloud:
nacos:
discovery: