From d4345c983d2c0cd25997f9ea47983b4f571168c2 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Wed, 18 Sep 2024 11:10:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EnclosureLinkController.java | 4 ++-- .../service/impl/SysEnclosureServiceImpl.java | 7 ++++-- .../service/impl/AbstractTeamServiceImpl.java | 3 +++ .../controller/ShopAppAuthController.java | 9 +++++++ .../skyeye/service/ShopAppAuthService.java | 2 ++ .../service/impl/ShopAppAuthServiceImpl.java | 24 +++++++++++++++++++ .../shop-web/src/main/resources/bootstrap.yml | 2 +- 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/controller/EnclosureLinkController.java b/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/controller/EnclosureLinkController.java index 8ec3ee1c..1b3b57d1 100644 --- a/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/controller/EnclosureLinkController.java +++ b/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/controller/EnclosureLinkController.java @@ -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")}) diff --git a/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/service/impl/SysEnclosureServiceImpl.java b/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/service/impl/SysEnclosureServiceImpl.java index 07abd934..f66393ee 100644 --- a/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/service/impl/SysEnclosureServiceImpl.java +++ b/skyeye-promote/skyeye-base-server/src/main/java/com/skyeye/enclosure/service/impl/SysEnclosureServiceImpl.java @@ -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, T extends Ab } private List getTeamRoleUserList(List teamRoleList) { + if (CollectionUtil.isEmpty(teamRoleList)) { + return CollectionUtil.newArrayList(); + } return teamRoleList.stream() .filter(teamRole -> CollectionUtil.isNotEmpty(teamRole.getTeamRoleUserList())) .flatMap(teamRole -> { diff --git a/skyeye-shop/shop-member/src/main/java/com/skyeye/controller/ShopAppAuthController.java b/skyeye-shop/shop-member/src/main/java/com/skyeye/controller/ShopAppAuthController.java index 202d797f..c9af5795 100644 --- a/skyeye-shop/shop-member/src/main/java/com/skyeye/controller/ShopAppAuthController.java +++ b/skyeye-shop/shop-member/src/main/java/com/skyeye/controller/ShopAppAuthController.java @@ -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); + } + } diff --git a/skyeye-shop/shop-member/src/main/java/com/skyeye/service/ShopAppAuthService.java b/skyeye-shop/shop-member/src/main/java/com/skyeye/service/ShopAppAuthService.java index 9b20601f..5b576151 100644 --- a/skyeye-shop/shop-member/src/main/java/com/skyeye/service/ShopAppAuthService.java +++ b/skyeye-shop/shop-member/src/main/java/com/skyeye/service/ShopAppAuthService.java @@ -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); } diff --git a/skyeye-shop/shop-member/src/main/java/com/skyeye/service/impl/ShopAppAuthServiceImpl.java b/skyeye-shop/shop-member/src/main/java/com/skyeye/service/impl/ShopAppAuthServiceImpl.java index fe398b84..fd6828ac 100644 --- a/skyeye-shop/shop-member/src/main/java/com/skyeye/service/impl/ShopAppAuthServiceImpl.java +++ b/skyeye-shop/shop-member/src/main/java/com/skyeye/service/impl/ShopAppAuthServiceImpl.java @@ -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 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); + } } diff --git a/skyeye-shop/shop-web/src/main/resources/bootstrap.yml b/skyeye-shop/shop-web/src/main/resources/bootstrap.yml index 657749f7..24074ec8 100644 --- a/skyeye-shop/shop-web/src/main/resources/bootstrap.yml +++ b/skyeye-shop/shop-web/src/main/resources/bootstrap.yml @@ -13,7 +13,7 @@ spring: repositories: enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度 profiles: - active: public + active: dev cloud: nacos: discovery: