Commit 06fa85a35356dd3bf8155e599022de9fa219867a
1 parent
678e2def
多模块重构 1:将 yudao-user-server 涉及到 member 模块的逻辑,都迁移到 yudao-module-member 中
Showing
85 changed files
with
400 additions
and
301 deletions
pom.xml
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | <module>yudao-admin-server</module> | 13 | <module>yudao-admin-server</module> |
| 14 | <module>yudao-user-server</module> | 14 | <module>yudao-user-server</module> |
| 15 | <module>yudao-core-service</module> | 15 | <module>yudao-core-service</module> |
| 16 | + <module>yudao-module-member</module> | ||
| 17 | + <module>yudao-server</module> | ||
| 16 | </modules> | 18 | </modules> |
| 17 | 19 | ||
| 18 | <name>${artifactId}</name> | 20 | <name>${artifactId}</name> |
| @@ -20,7 +22,7 @@ | @@ -20,7 +22,7 @@ | ||
| 20 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 22 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 21 | 23 | ||
| 22 | <properties> | 24 | <properties> |
| 23 | - <revision>1.3.0-snapshot</revision> | 25 | + <revision>1.4.0-snapshot</revision> |
| 24 | <!-- Maven 相关 --> | 26 | <!-- Maven 相关 --> |
| 25 | <java.version>1.8</java.version> | 27 | <java.version>1.8</java.version> |
| 26 | <maven.compiler.source>${java.version}</maven.compiler.source> | 28 | <maven.compiler.source>${java.version}</maven.compiler.source> |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/dal/mysql/user/MbrUserCoreMapper.java deleted
| 1 | -package cn.iocoder.yudao.coreservice.modules.member.dal.mysql.user; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | ||
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | -import org.apache.ibatis.annotations.Mapper; | ||
| 6 | - | ||
| 7 | -@Mapper | ||
| 8 | -public interface MbrUserCoreMapper extends BaseMapperX<MbrUserDO> { | ||
| 9 | - | ||
| 10 | -} |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/package-info.java deleted
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/service/user/MbrUserCoreService.java deleted
| 1 | -package cn.iocoder.yudao.coreservice.modules.member.service.user; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * 前台用户 Core Service 接口 | ||
| 7 | - * | ||
| 8 | - * @author 芋道源码 | ||
| 9 | - */ | ||
| 10 | -public interface MbrUserCoreService { | ||
| 11 | - /** | ||
| 12 | - * 通过用户 ID 查询用户 | ||
| 13 | - * | ||
| 14 | - * @param id 用户ID | ||
| 15 | - * @return 用户对象信息 | ||
| 16 | - */ | ||
| 17 | - MbrUserDO getUser(Long id); | ||
| 18 | - | ||
| 19 | -} |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/service/user/impl/MbrUserCoreServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.coreservice.modules.member.service.user.impl; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | ||
| 4 | -import cn.iocoder.yudao.coreservice.modules.member.dal.mysql.user.MbrUserCoreMapper; | ||
| 5 | -import cn.iocoder.yudao.coreservice.modules.member.service.user.MbrUserCoreService; | ||
| 6 | -import lombok.extern.slf4j.Slf4j; | ||
| 7 | -import org.springframework.stereotype.Service; | ||
| 8 | - | ||
| 9 | -import javax.annotation.Resource; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * User Core Service 实现类 | ||
| 13 | - * | ||
| 14 | - * @author 芋道源码 | ||
| 15 | - */ | ||
| 16 | -@Service | ||
| 17 | -@Slf4j | ||
| 18 | -public class MbrUserCoreServiceImpl implements MbrUserCoreService { | ||
| 19 | - | ||
| 20 | - @Resource | ||
| 21 | - private MbrUserCoreMapper userCoreMapper; | ||
| 22 | - | ||
| 23 | - @Override | ||
| 24 | - public MbrUserDO getUser(Long id) { | ||
| 25 | - return userCoreMapper.selectById(id); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | -} |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/tool/package-info.java deleted
yudao-dependencies/pom.xml
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 15 | ||
| 16 | <properties> | 16 | <properties> |
| 17 | - <revision>1.3.0-snapshot</revision> | 17 | + <revision>1.4.0-snapshot</revision> |
| 18 | <!-- 统一依赖管理 --> | 18 | <!-- 统一依赖管理 --> |
| 19 | <spring.boot.version>2.4.12</spring.boot.version> | 19 | <spring.boot.version>2.4.12</spring.boot.version> |
| 20 | <!-- Web 相关 --> | 20 | <!-- Web 相关 --> |
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AbstractSignUpUrlAuthenticationSuccessHandler.java deleted
| 1 | -/* | ||
| 2 | - * MIT License | ||
| 3 | - * Copyright (c) 2020-2029 YongWu zheng (dcenter.top and gitee.com/pcore and github.com/ZeroOrInfinity) | ||
| 4 | - * | ||
| 5 | - * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 6 | - * of this software and associated documentation files (the "Software"), to deal | ||
| 7 | - * in the Software without restriction, including without limitation the rights | ||
| 8 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | - * copies of the Software, and to permit persons to whom the Software is | ||
| 10 | - * furnished to do so, subject to the following conditions: | ||
| 11 | - * | ||
| 12 | - * The above copyright notice and this permission notice shall be included in all | ||
| 13 | - * copies or substantial portions of the Software. | ||
| 14 | - * | ||
| 15 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 20 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 21 | - * SOFTWARE. | ||
| 22 | - */ | ||
| 23 | -package cn.iocoder.yudao.framework.security.core.handler; | ||
| 24 | - | ||
| 25 | -import org.springframework.security.core.Authentication; | ||
| 26 | -import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; | ||
| 27 | -import org.springframework.security.web.savedrequest.HttpSessionRequestCache; | ||
| 28 | -import org.springframework.security.web.savedrequest.RequestCache; | ||
| 29 | - | ||
| 30 | -import javax.servlet.ServletException; | ||
| 31 | -import javax.servlet.http.HttpServletRequest; | ||
| 32 | -import javax.servlet.http.HttpServletResponse; | ||
| 33 | -import java.io.IOException; | ||
| 34 | - | ||
| 35 | -/** | ||
| 36 | - * @author weir | ||
| 37 | - */ | ||
| 38 | -public class AbstractSignUpUrlAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { | ||
| 39 | - private RequestCache requestCache = new HttpSessionRequestCache(); | ||
| 40 | - | ||
| 41 | - @Override | ||
| 42 | - public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { | ||
| 43 | - if (requestCache.getRequest(request, response) != null) { | ||
| 44 | - requestCache.getRequest(request, response); | ||
| 45 | - } | ||
| 46 | - super.onAuthenticationSuccess(request,response,authentication); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - @Override | ||
| 50 | - public void setRequestCache(RequestCache requestCache) { | ||
| 51 | - this.requestCache = requestCache; | ||
| 52 | - } | ||
| 53 | -} |
yudao-module-member/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | + <parent> | ||
| 6 | + <groupId>cn.iocoder.boot</groupId> | ||
| 7 | + <artifactId>yudao</artifactId> | ||
| 8 | + <version>${revision}</version> | ||
| 9 | + </parent> | ||
| 10 | + <modelVersion>4.0.0</modelVersion> | ||
| 11 | + <modules> | ||
| 12 | + <module>yudao-module-member-api</module> | ||
| 13 | + <module>yudao-module-member-impl</module> | ||
| 14 | + </modules> | ||
| 15 | + <artifactId>yudao-module-member</artifactId> | ||
| 16 | + <packaging>pom</packaging> | ||
| 17 | + | ||
| 18 | + <name>${artifactId}</name> | ||
| 19 | + <description> | ||
| 20 | + member 模块,我们放会员业务。 | ||
| 21 | + 例如说:会员中心等等 | ||
| 22 | + </description> | ||
| 23 | + | ||
| 24 | +</project> |
yudao-module-member/yudao-module-member-api/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | + <parent> | ||
| 6 | + <groupId>cn.iocoder.boot</groupId> | ||
| 7 | + <artifactId>yudao-module-member</artifactId> | ||
| 8 | + <version>${revision}</version> | ||
| 9 | + </parent> | ||
| 10 | + <modelVersion>4.0.0</modelVersion> | ||
| 11 | + <artifactId>yudao-module-member-api</artifactId> | ||
| 12 | + <packaging>jar</packaging> | ||
| 13 | + | ||
| 14 | + <name>${artifactId}</name> | ||
| 15 | + <description> | ||
| 16 | + member 模块 API,暴露给其它模块调用 | ||
| 17 | + </description> | ||
| 18 | + | ||
| 19 | + <dependencies> | ||
| 20 | + <dependency> | ||
| 21 | + <groupId>cn.iocoder.boot</groupId> | ||
| 22 | + <artifactId>yudao-common</artifactId> | ||
| 23 | + </dependency> | ||
| 24 | + </dependencies> | ||
| 25 | + | ||
| 26 | +</project> |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/package-info.java renamed to yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/package-info.java
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.api.user; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 会员用户的 API 接口 | ||
| 7 | + * | ||
| 8 | + * @author 芋道源码 | ||
| 9 | + */ | ||
| 10 | +public interface MemberUserApi { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 获得会员用户信息 | ||
| 14 | + * | ||
| 15 | + * @param id 用户编号 | ||
| 16 | + * @return 用户信息 | ||
| 17 | + */ | ||
| 18 | + MemberUserRespDTO getMemberUser(Long id); | ||
| 19 | + | ||
| 20 | +} |
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/MemberUserRespDTO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.api.user.dto; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 用户信息 Response DTO | ||
| 7 | + * | ||
| 8 | + * @author 芋道源码 | ||
| 9 | + */ | ||
| 10 | +public class MemberUserRespDTO { | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * 用户ID | ||
| 14 | + */ | ||
| 15 | + private Long id; | ||
| 16 | + /** | ||
| 17 | + * 用户昵称 | ||
| 18 | + */ | ||
| 19 | + private String nickname; | ||
| 20 | + /** | ||
| 21 | + * 帐号状态 | ||
| 22 | + * | ||
| 23 | + * 枚举 {@link CommonStatusEnum} | ||
| 24 | + */ | ||
| 25 | + private Integer status; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 手机 | ||
| 29 | + */ | ||
| 30 | + private String mobile; | ||
| 31 | + | ||
| 32 | +} |
yudao-module-member/yudao-module-member-impl/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | + <parent> | ||
| 6 | + <groupId>cn.iocoder.boot</groupId> | ||
| 7 | + <artifactId>yudao-module-member</artifactId> | ||
| 8 | + <version>${revision}</version> | ||
| 9 | + </parent> | ||
| 10 | + <modelVersion>4.0.0</modelVersion> | ||
| 11 | + <artifactId>yudao-module-member-impl</artifactId> | ||
| 12 | + <packaging>jar</packaging> | ||
| 13 | + | ||
| 14 | + <name>${artifactId}</name> | ||
| 15 | + <description> | ||
| 16 | + member 模块,我们放会员业务。 | ||
| 17 | + 例如说:会员中心等等 | ||
| 18 | + </description> | ||
| 19 | + | ||
| 20 | + <dependencies> | ||
| 21 | + <!-- 业务组件 --> | ||
| 22 | + <dependency> | ||
| 23 | + <groupId>cn.iocoder.boot</groupId> | ||
| 24 | + <artifactId>yudao-core-service</artifactId> | ||
| 25 | + </dependency> | ||
| 26 | + | ||
| 27 | + <dependency> | ||
| 28 | + <groupId>cn.iocoder.boot</groupId> | ||
| 29 | + <artifactId>yudao-spring-boot-starter-biz-dict</artifactId> | ||
| 30 | + </dependency> | ||
| 31 | + <dependency> | ||
| 32 | + <groupId>cn.iocoder.boot</groupId> | ||
| 33 | + <artifactId>yudao-spring-boot-starter-biz-sms</artifactId> | ||
| 34 | + </dependency> | ||
| 35 | + <dependency> | ||
| 36 | + <groupId>cn.iocoder.boot</groupId> | ||
| 37 | + <artifactId>yudao-spring-boot-starter-biz-weixin</artifactId> | ||
| 38 | + </dependency> | ||
| 39 | + | ||
| 40 | + <!-- Web 相关 --> | ||
| 41 | + <dependency> | ||
| 42 | + <groupId>cn.iocoder.boot</groupId> | ||
| 43 | + <artifactId>yudao-spring-boot-starter-web</artifactId> | ||
| 44 | + </dependency> | ||
| 45 | + | ||
| 46 | + <dependency> | ||
| 47 | + <groupId>cn.iocoder.boot</groupId> | ||
| 48 | + <artifactId>yudao-spring-boot-starter-security</artifactId> | ||
| 49 | + </dependency> | ||
| 50 | + | ||
| 51 | + <!-- DB 相关 --> | ||
| 52 | + <dependency> | ||
| 53 | + <groupId>cn.iocoder.boot</groupId> | ||
| 54 | + <artifactId>yudao-spring-boot-starter-mybatis</artifactId> | ||
| 55 | + </dependency> | ||
| 56 | + | ||
| 57 | + <dependency> | ||
| 58 | + <groupId>cn.iocoder.boot</groupId> | ||
| 59 | + <artifactId>yudao-spring-boot-starter-redis</artifactId> | ||
| 60 | + </dependency> | ||
| 61 | + | ||
| 62 | + <!-- Config 配置中心相关 --> | ||
| 63 | + <dependency> | ||
| 64 | + <groupId>cn.iocoder.boot</groupId> | ||
| 65 | + <artifactId>yudao-spring-boot-starter-config</artifactId> | ||
| 66 | + </dependency> | ||
| 67 | + | ||
| 68 | + <!-- Job 定时任务相关 --> | ||
| 69 | + | ||
| 70 | + <!-- 消息队列相关 --> | ||
| 71 | + <dependency> | ||
| 72 | + <groupId>cn.iocoder.boot</groupId> | ||
| 73 | + <artifactId>yudao-spring-boot-starter-mq</artifactId> | ||
| 74 | + </dependency> | ||
| 75 | + | ||
| 76 | + <!-- 服务保障相关 --> | ||
| 77 | + <dependency> | ||
| 78 | + <groupId>cn.iocoder.boot</groupId> | ||
| 79 | + <artifactId>yudao-spring-boot-starter-protection</artifactId> | ||
| 80 | + </dependency> | ||
| 81 | + | ||
| 82 | + <!-- 监控相关 --> | ||
| 83 | + <dependency> | ||
| 84 | + <groupId>cn.iocoder.boot</groupId> | ||
| 85 | + <artifactId>yudao-spring-boot-starter-monitor</artifactId> | ||
| 86 | + </dependency> | ||
| 87 | + | ||
| 88 | + <!-- Test 测试相关 --> | ||
| 89 | + <dependency> | ||
| 90 | + <groupId>cn.iocoder.boot</groupId> | ||
| 91 | + <artifactId>yudao-spring-boot-starter-test</artifactId> | ||
| 92 | + <scope>test</scope> | ||
| 93 | + </dependency> | ||
| 94 | + <!-- 工具类相关 --> | ||
| 95 | + | ||
| 96 | + </dependencies> | ||
| 97 | + | ||
| 98 | + <build> | ||
| 99 | + <!-- 设置构建的 jar 包名 --> | ||
| 100 | + <finalName>${artifactId}</finalName> | ||
| 101 | + <plugins> | ||
| 102 | + <!-- 打包 --> | ||
| 103 | + <plugin> | ||
| 104 | + <groupId>org.springframework.boot</groupId> | ||
| 105 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
| 106 | + <configuration> | ||
| 107 | + <fork>true</fork> | ||
| 108 | + </configuration> | ||
| 109 | + <executions> | ||
| 110 | + <execution> | ||
| 111 | + <goals> | ||
| 112 | + <goal>repackage</goal> <!-- 将引入的 jar 打入其中 --> | ||
| 113 | + </goals> | ||
| 114 | + </execution> | ||
| 115 | + </executions> | ||
| 116 | + </plugin> | ||
| 117 | + </plugins> | ||
| 118 | + </build> | ||
| 119 | + | ||
| 120 | +</project> |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/SysAuthController.http renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.http
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/SysAuthController.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; | 3 | import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; |
| 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | 6 | import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; |
| 7 | -import cn.iocoder.yudao.userserver.modules.system.controller.auth.vo.*; | 7 | +import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; |
| 8 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; | 8 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; |
| 9 | import cn.iocoder.yudao.userserver.modules.system.service.sms.SysSmsCodeService; | 9 | import cn.iocoder.yudao.userserver.modules.system.service.sms.SysSmsCodeService; |
| 10 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
| @@ -23,12 +23,12 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getCli | @@ -23,12 +23,12 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getCli | ||
| 23 | import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUserAgent; | 23 | import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUserAgent; |
| 24 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 24 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 25 | 25 | ||
| 26 | -@Api(tags = "认证") | 26 | +@Api(tags = "APP 端 - 认证") |
| 27 | @RestController | 27 | @RestController |
| 28 | @RequestMapping("/") | 28 | @RequestMapping("/") |
| 29 | @Validated | 29 | @Validated |
| 30 | @Slf4j | 30 | @Slf4j |
| 31 | -public class SysAuthController { | 31 | +public class AppAuthController { |
| 32 | 32 | ||
| 33 | @Resource | 33 | @Resource |
| 34 | private SysAuthService authService; | 34 | private SysAuthService authService; |
| @@ -39,18 +39,18 @@ public class SysAuthController { | @@ -39,18 +39,18 @@ public class SysAuthController { | ||
| 39 | 39 | ||
| 40 | @PostMapping("/login") | 40 | @PostMapping("/login") |
| 41 | @ApiOperation("使用手机 + 密码登录") | 41 | @ApiOperation("使用手机 + 密码登录") |
| 42 | - public CommonResult<SysAuthLoginRespVO> login(@RequestBody @Valid SysAuthLoginReqVO reqVO) { | 42 | + public CommonResult<AppAuthLoginRespVO> login(@RequestBody @Valid AppAuthLoginReqVO reqVO) { |
| 43 | String token = authService.login(reqVO, getClientIP(), getUserAgent()); | 43 | String token = authService.login(reqVO, getClientIP(), getUserAgent()); |
| 44 | // 返回结果 | 44 | // 返回结果 |
| 45 | - return success(SysAuthLoginRespVO.builder().token(token).build()); | 45 | + return success(AppAuthLoginRespVO.builder().token(token).build()); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | @PostMapping("/sms-login") | 48 | @PostMapping("/sms-login") |
| 49 | @ApiOperation("使用手机 + 验证码登录") | 49 | @ApiOperation("使用手机 + 验证码登录") |
| 50 | - public CommonResult<SysAuthLoginRespVO> smsLogin(@RequestBody @Valid SysAuthSmsLoginReqVO reqVO) { | 50 | + public CommonResult<AppAuthLoginRespVO> smsLogin(@RequestBody @Valid AppAuthSmsLoginReqVO reqVO) { |
| 51 | String token = authService.smsLogin(reqVO, getClientIP(), getUserAgent()); | 51 | String token = authService.smsLogin(reqVO, getClientIP(), getUserAgent()); |
| 52 | // 返回结果 | 52 | // 返回结果 |
| 53 | - return success(SysAuthLoginRespVO.builder().token(token).build()); | 53 | + return success(AppAuthLoginRespVO.builder().token(token).build()); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | @PostMapping("/send-sms-code") | 56 | @PostMapping("/send-sms-code") |
| @@ -70,7 +70,7 @@ public class SysAuthController { | @@ -70,7 +70,7 @@ public class SysAuthController { | ||
| 70 | @PostMapping("/reset-password") | 70 | @PostMapping("/reset-password") |
| 71 | @ApiOperation(value = "重置密码", notes = "用户忘记密码时使用") | 71 | @ApiOperation(value = "重置密码", notes = "用户忘记密码时使用") |
| 72 | @PreAuthenticated | 72 | @PreAuthenticated |
| 73 | - public CommonResult<Boolean> resetPassword(@RequestBody @Valid MbrAuthResetPasswordReqVO reqVO) { | 73 | + public CommonResult<Boolean> resetPassword(@RequestBody @Valid AppAuthResetPasswordReqVO reqVO) { |
| 74 | authService.resetPassword(reqVO); | 74 | authService.resetPassword(reqVO); |
| 75 | return success(true); | 75 | return success(true); |
| 76 | } | 76 | } |
| @@ -78,12 +78,11 @@ public class SysAuthController { | @@ -78,12 +78,11 @@ public class SysAuthController { | ||
| 78 | @PostMapping("/update-password") | 78 | @PostMapping("/update-password") |
| 79 | @ApiOperation(value = "修改用户密码",notes = "用户修改密码时使用") | 79 | @ApiOperation(value = "修改用户密码",notes = "用户修改密码时使用") |
| 80 | @PreAuthenticated | 80 | @PreAuthenticated |
| 81 | - public CommonResult<Boolean> updatePassword(@RequestBody @Valid MbrAuthUpdatePasswordReqVO reqVO) { | 81 | + public CommonResult<Boolean> updatePassword(@RequestBody @Valid AppAuthUpdatePasswordReqVO reqVO) { |
| 82 | authService.updatePassword(getLoginUserId(), reqVO); | 82 | authService.updatePassword(getLoginUserId(), reqVO); |
| 83 | return success(true); | 83 | return success(true); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | - | ||
| 87 | // ========== 社交登录相关 ========== | 86 | // ========== 社交登录相关 ========== |
| 88 | 87 | ||
| 89 | @GetMapping("/social-auth-redirect") | 88 | @GetMapping("/social-auth-redirect") |
| @@ -97,32 +96,30 @@ public class SysAuthController { | @@ -97,32 +96,30 @@ public class SysAuthController { | ||
| 97 | return CommonResult.success(socialService.getAuthorizeUrl(type, redirectUri)); | 96 | return CommonResult.success(socialService.getAuthorizeUrl(type, redirectUri)); |
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | - | ||
| 101 | @PostMapping("/social-login") | 99 | @PostMapping("/social-login") |
| 102 | @ApiOperation("社交登录,使用 code 授权码") | 100 | @ApiOperation("社交登录,使用 code 授权码") |
| 103 | - public CommonResult<SysAuthLoginRespVO> socialLogin(@RequestBody @Valid MbrAuthSocialLoginReqVO reqVO) { | 101 | + public CommonResult<AppAuthLoginRespVO> socialLogin(@RequestBody @Valid AppAuthSocialLoginReqVO reqVO) { |
| 104 | String token = authService.socialLogin(reqVO, getClientIP(), getUserAgent()); | 102 | String token = authService.socialLogin(reqVO, getClientIP(), getUserAgent()); |
| 105 | - return success(SysAuthLoginRespVO.builder().token(token).build()); | 103 | + return success(AppAuthLoginRespVO.builder().token(token).build()); |
| 106 | } | 104 | } |
| 107 | 105 | ||
| 108 | - | ||
| 109 | @PostMapping("/social-login2") | 106 | @PostMapping("/social-login2") |
| 110 | @ApiOperation("社交登录,使用 手机号 + 手机验证码") | 107 | @ApiOperation("社交登录,使用 手机号 + 手机验证码") |
| 111 | - public CommonResult<SysAuthLoginRespVO> socialLogin2(@RequestBody @Valid MbrAuthSocialLogin2ReqVO reqVO) { | 108 | + public CommonResult<AppAuthLoginRespVO> socialLogin2(@RequestBody @Valid AppAuthSocialLogin2ReqVO reqVO) { |
| 112 | String token = authService.socialLogin2(reqVO, getClientIP(), getUserAgent()); | 109 | String token = authService.socialLogin2(reqVO, getClientIP(), getUserAgent()); |
| 113 | - return success(SysAuthLoginRespVO.builder().token(token).build()); | 110 | + return success(AppAuthLoginRespVO.builder().token(token).build()); |
| 114 | } | 111 | } |
| 115 | 112 | ||
| 116 | @PostMapping("/social-bind") | 113 | @PostMapping("/social-bind") |
| 117 | @ApiOperation("社交绑定,使用 code 授权码") | 114 | @ApiOperation("社交绑定,使用 code 授权码") |
| 118 | - public CommonResult<Boolean> socialBind(@RequestBody @Valid MbrAuthSocialBindReqVO reqVO) { | 115 | + public CommonResult<Boolean> socialBind(@RequestBody @Valid AppAuthSocialBindReqVO reqVO) { |
| 119 | authService.socialBind(getLoginUserId(), reqVO); | 116 | authService.socialBind(getLoginUserId(), reqVO); |
| 120 | return CommonResult.success(true); | 117 | return CommonResult.success(true); |
| 121 | } | 118 | } |
| 122 | 119 | ||
| 123 | @DeleteMapping("/social-unbind") | 120 | @DeleteMapping("/social-unbind") |
| 124 | @ApiOperation("取消社交绑定") | 121 | @ApiOperation("取消社交绑定") |
| 125 | - public CommonResult<Boolean> socialUnbind(@RequestBody MbrAuthSocialUnbindReqVO reqVO) { | 122 | + public CommonResult<Boolean> socialUnbind(@RequestBody AppAuthSocialUnbindReqVO reqVO) { |
| 126 | socialService.unbindSocialUser(getLoginUserId(), reqVO.getType(), reqVO.getUnionId(), UserTypeEnum.MEMBER); | 123 | socialService.unbindSocialUser(getLoginUserId(), reqVO.getType(), reqVO.getUnionId(), UserTypeEnum.MEMBER); |
| 127 | return CommonResult.success(true); | 124 | return CommonResult.success(true); |
| 128 | } | 125 | } |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/SysAuthCheckCodeReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| @@ -15,12 +15,12 @@ import javax.validation.constraints.NotBlank; | @@ -15,12 +15,12 @@ import javax.validation.constraints.NotBlank; | ||
| 15 | import javax.validation.constraints.NotNull; | 15 | import javax.validation.constraints.NotNull; |
| 16 | import javax.validation.constraints.Pattern; | 16 | import javax.validation.constraints.Pattern; |
| 17 | 17 | ||
| 18 | -@ApiModel("校验验证码 Request VO") | 18 | +@ApiModel("APP 端 - 校验验证码 Request VO") |
| 19 | @Data | 19 | @Data |
| 20 | @NoArgsConstructor | 20 | @NoArgsConstructor |
| 21 | @AllArgsConstructor | 21 | @AllArgsConstructor |
| 22 | @Builder | 22 | @Builder |
| 23 | -public class SysAuthCheckCodeReqVO { | 23 | +public class AppAuthCheckCodeReqVO { |
| 24 | 24 | ||
| 25 | @ApiModelProperty(value = "手机号", example = "15601691234") | 25 | @ApiModelProperty(value = "手机号", example = "15601691234") |
| 26 | @NotBlank(message = "手机号不能为空") | 26 | @NotBlank(message = "手机号不能为空") |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/SysAuthLoginReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| @@ -11,12 +11,12 @@ import org.hibernate.validator.constraints.Length; | @@ -11,12 +11,12 @@ import org.hibernate.validator.constraints.Length; | ||
| 11 | 11 | ||
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | 13 | ||
| 14 | -@ApiModel("手机 + 密码登录 Request VO") | 14 | +@ApiModel("APP 端 - 手机 + 密码登录 Request VO") |
| 15 | @Data | 15 | @Data |
| 16 | @NoArgsConstructor | 16 | @NoArgsConstructor |
| 17 | @AllArgsConstructor | 17 | @AllArgsConstructor |
| 18 | @Builder | 18 | @Builder |
| 19 | -public class SysAuthLoginReqVO { | 19 | +public class AppAuthLoginReqVO { |
| 20 | 20 | ||
| 21 | @ApiModelProperty(value = "手机号", required = true, example = "15601691300") | 21 | @ApiModelProperty(value = "手机号", required = true, example = "15601691300") |
| 22 | @NotEmpty(message = "手机号不能为空") | 22 | @NotEmpty(message = "手机号不能为空") |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/SysAuthLoginRespVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginRespVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| @@ -7,12 +7,12 @@ import lombok.Builder; | @@ -7,12 +7,12 @@ import lombok.Builder; | ||
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| 8 | import lombok.NoArgsConstructor; | 8 | import lombok.NoArgsConstructor; |
| 9 | 9 | ||
| 10 | -@ApiModel("手机密码登录 Response VO") | 10 | +@ApiModel("APP 端 - 手机密码登录 Response VO") |
| 11 | @Data | 11 | @Data |
| 12 | @NoArgsConstructor | 12 | @NoArgsConstructor |
| 13 | @AllArgsConstructor | 13 | @AllArgsConstructor |
| 14 | @Builder | 14 | @Builder |
| 15 | -public class SysAuthLoginRespVO { | 15 | +public class AppAuthLoginRespVO { |
| 16 | 16 | ||
| 17 | @ApiModelProperty(value = "token", required = true, example = "yudaoyuanma") | 17 | @ApiModelProperty(value = "token", required = true, example = "yudaoyuanma") |
| 18 | private String token; | 18 | private String token; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthResetPasswordReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthResetPasswordReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| @@ -13,12 +13,12 @@ import javax.validation.constraints.NotBlank; | @@ -13,12 +13,12 @@ import javax.validation.constraints.NotBlank; | ||
| 13 | import javax.validation.constraints.NotEmpty; | 13 | import javax.validation.constraints.NotEmpty; |
| 14 | import javax.validation.constraints.Pattern; | 14 | import javax.validation.constraints.Pattern; |
| 15 | 15 | ||
| 16 | -@ApiModel("重置密码 Request VO") | 16 | +@ApiModel("APP 端 - 重置密码 Request VO") |
| 17 | @Data | 17 | @Data |
| 18 | @NoArgsConstructor | 18 | @NoArgsConstructor |
| 19 | @AllArgsConstructor | 19 | @AllArgsConstructor |
| 20 | @Builder | 20 | @Builder |
| 21 | -public class MbrAuthResetPasswordReqVO { | 21 | +public class AppAuthResetPasswordReqVO { |
| 22 | 22 | ||
| 23 | @ApiModelProperty(value = "新密码", required = true, example = "buzhidao") | 23 | @ApiModelProperty(value = "新密码", required = true, example = "buzhidao") |
| 24 | @NotEmpty(message = "新密码不能为空") | 24 | @NotEmpty(message = "新密码不能为空") |
| @@ -35,4 +35,5 @@ public class MbrAuthResetPasswordReqVO { | @@ -35,4 +35,5 @@ public class MbrAuthResetPasswordReqVO { | ||
| 35 | @NotBlank(message = "手机号不能为空") | 35 | @NotBlank(message = "手机号不能为空") |
| 36 | @Mobile | 36 | @Mobile |
| 37 | private String mobile; | 37 | private String mobile; |
| 38 | + | ||
| 38 | } | 39 | } |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/SysAuthSmsLoginReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| @@ -12,12 +12,12 @@ import org.hibernate.validator.constraints.Length; | @@ -12,12 +12,12 @@ import org.hibernate.validator.constraints.Length; | ||
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | import javax.validation.constraints.Pattern; | 13 | import javax.validation.constraints.Pattern; |
| 14 | 14 | ||
| 15 | -@ApiModel("手机 + 验证码登录 Request VO") | 15 | +@ApiModel("APP 端 - 手机 + 验证码登录 Request VO") |
| 16 | @Data | 16 | @Data |
| 17 | @NoArgsConstructor | 17 | @NoArgsConstructor |
| 18 | @AllArgsConstructor | 18 | @AllArgsConstructor |
| 19 | @Builder | 19 | @Builder |
| 20 | -public class SysAuthSmsLoginReqVO { | 20 | +public class AppAuthSmsLoginReqVO { |
| 21 | 21 | ||
| 22 | @ApiModelProperty(value = "手机号", required = true, example = "15601691300") | 22 | @ApiModelProperty(value = "手机号", required = true, example = "15601691300") |
| 23 | @NotEmpty(message = "手机号不能为空") | 23 | @NotEmpty(message = "手机号不能为空") |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthSocialBindReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialBindReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | import javax.validation.constraints.NotNull; | 13 | import javax.validation.constraints.NotNull; |
| 14 | 14 | ||
| 15 | -@ApiModel("社交绑定 Request VO,使用 code 授权码") | 15 | +@ApiModel("APP 端 - 社交绑定 Request VO,使用 code 授权码") |
| 16 | @Data | 16 | @Data |
| 17 | @NoArgsConstructor | 17 | @NoArgsConstructor |
| 18 | @AllArgsConstructor | 18 | @AllArgsConstructor |
| 19 | @Builder | 19 | @Builder |
| 20 | -public class MbrAuthSocialBindReqVO { | 20 | +public class AppAuthSocialBindReqVO { |
| 21 | 21 | ||
| 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") |
| 23 | @InEnum(SysSocialTypeEnum.class) | 23 | @InEnum(SysSocialTypeEnum.class) |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthSocialLogin2ReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLogin2ReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| @@ -14,12 +14,12 @@ import javax.validation.constraints.NotEmpty; | @@ -14,12 +14,12 @@ import javax.validation.constraints.NotEmpty; | ||
| 14 | import javax.validation.constraints.NotNull; | 14 | import javax.validation.constraints.NotNull; |
| 15 | import javax.validation.constraints.Pattern; | 15 | import javax.validation.constraints.Pattern; |
| 16 | 16 | ||
| 17 | -@ApiModel("社交登录 Request VO,使用 code 授权码 + 账号密码") | 17 | +@ApiModel("APP 端 - 社交登录 Request VO,使用 code 授权码 + 账号密码") |
| 18 | @Data | 18 | @Data |
| 19 | @NoArgsConstructor | 19 | @NoArgsConstructor |
| 20 | @AllArgsConstructor | 20 | @AllArgsConstructor |
| 21 | @Builder | 21 | @Builder |
| 22 | -public class MbrAuthSocialLogin2ReqVO { | 22 | +public class AppAuthSocialLogin2ReqVO { |
| 23 | 23 | ||
| 24 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | 24 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") |
| 25 | @InEnum(SysSocialTypeEnum.class) | 25 | @InEnum(SysSocialTypeEnum.class) |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthSocialLoginReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | import javax.validation.constraints.NotNull; | 13 | import javax.validation.constraints.NotNull; |
| 14 | 14 | ||
| 15 | -@ApiModel("社交登录 Request VO,使用 code 授权码") | 15 | +@ApiModel("APP 端 - 社交登录 Request VO,使用 code 授权码") |
| 16 | @Data | 16 | @Data |
| 17 | @NoArgsConstructor | 17 | @NoArgsConstructor |
| 18 | @AllArgsConstructor | 18 | @AllArgsConstructor |
| 19 | @Builder | 19 | @Builder |
| 20 | -public class MbrAuthSocialLoginReqVO { | 20 | +public class AppAuthSocialLoginReqVO { |
| 21 | 21 | ||
| 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") |
| 23 | @InEnum(SysSocialTypeEnum.class) | 23 | @InEnum(SysSocialTypeEnum.class) |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthSocialUnbindReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialUnbindReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | 3 | import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | import javax.validation.constraints.NotNull; | 13 | import javax.validation.constraints.NotNull; |
| 14 | 14 | ||
| 15 | -@ApiModel("取消社交绑定 Request VO,使用 code 授权码") | 15 | +@ApiModel("APP 端 - 取消社交绑定 Request VO,使用 code 授权码") |
| 16 | @Data | 16 | @Data |
| 17 | @NoArgsConstructor | 17 | @NoArgsConstructor |
| 18 | @AllArgsConstructor | 18 | @AllArgsConstructor |
| 19 | @Builder | 19 | @Builder |
| 20 | -public class MbrAuthSocialUnbindReqVO { | 20 | +public class AppAuthSocialUnbindReqVO { |
| 21 | 21 | ||
| 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | 22 | @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") |
| 23 | @InEnum(SysSocialTypeEnum.class) | 23 | @InEnum(SysSocialTypeEnum.class) |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/MbrAuthUpdatePasswordReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthUpdatePasswordReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| @@ -11,12 +11,12 @@ import org.hibernate.validator.constraints.Length; | @@ -11,12 +11,12 @@ import org.hibernate.validator.constraints.Length; | ||
| 11 | import javax.validation.constraints.NotBlank; | 11 | import javax.validation.constraints.NotBlank; |
| 12 | import javax.validation.constraints.NotEmpty; | 12 | import javax.validation.constraints.NotEmpty; |
| 13 | 13 | ||
| 14 | -@ApiModel("修改密码 Request VO") | 14 | +@ApiModel("APP 端 - 修改密码 Request VO") |
| 15 | @Data | 15 | @Data |
| 16 | @NoArgsConstructor | 16 | @NoArgsConstructor |
| 17 | @AllArgsConstructor | 17 | @AllArgsConstructor |
| 18 | @Builder | 18 | @Builder |
| 19 | -public class MbrAuthUpdatePasswordReqVO { | 19 | +public class AppAuthUpdatePasswordReqVO { |
| 20 | 20 | ||
| 21 | @ApiModelProperty(value = "用户旧密码", required = true, example = "123456") | 21 | @ApiModelProperty(value = "用户旧密码", required = true, example = "123456") |
| 22 | @NotBlank(message = "旧密码不能为空") | 22 | @NotBlank(message = "旧密码不能为空") |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/controller/auth/vo/SysAuthSendSmsReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppSendSmsReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.controller.auth.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.auth.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| @@ -10,10 +10,10 @@ import lombok.experimental.Accessors; | @@ -10,10 +10,10 @@ import lombok.experimental.Accessors; | ||
| 10 | 10 | ||
| 11 | import javax.validation.constraints.NotNull; | 11 | import javax.validation.constraints.NotNull; |
| 12 | 12 | ||
| 13 | -@ApiModel("发送手机验证码 Response VO") | 13 | +@ApiModel("APP 端 - 发送手机验证码 Response VO") |
| 14 | @Data | 14 | @Data |
| 15 | @Accessors(chain = true) | 15 | @Accessors(chain = true) |
| 16 | -public class SysAuthSendSmsReqVO { | 16 | +public class AppSendSmsReqVO { |
| 17 | 17 | ||
| 18 | @ApiModelProperty(value = "手机号", example = "15601691234") | 18 | @ApiModelProperty(value = "手机号", example = "15601691234") |
| 19 | @Mobile | 19 | @Mobile |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/package-info.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.app; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/user/SysUserProfileController.http renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.http
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/user/SysUserProfileController.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.controller.user; | 1 | +package cn.iocoder.yudao.module.member.controller.app.user; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; | 3 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; |
| 4 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | 4 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| @@ -25,12 +25,12 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getCli | @@ -25,12 +25,12 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getCli | ||
| 25 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 25 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| 26 | import static cn.iocoder.yudao.userserver.modules.member.enums.MbrErrorCodeConstants.FILE_IS_EMPTY; | 26 | import static cn.iocoder.yudao.userserver.modules.member.enums.MbrErrorCodeConstants.FILE_IS_EMPTY; |
| 27 | 27 | ||
| 28 | -@Api(tags = "用户个人中心") | 28 | +@Api(tags = "APP 端 - 用户个人中心") |
| 29 | @RestController | 29 | @RestController |
| 30 | -@RequestMapping("/member/user/profile") | 30 | +@RequestMapping("/member/user") |
| 31 | @Validated | 31 | @Validated |
| 32 | @Slf4j | 32 | @Slf4j |
| 33 | -public class SysUserProfileController { | 33 | +public class AppUserController { |
| 34 | 34 | ||
| 35 | @Resource | 35 | @Resource |
| 36 | private MbrUserService userService; | 36 | private MbrUserService userService; |
| @@ -48,7 +48,7 @@ public class SysUserProfileController { | @@ -48,7 +48,7 @@ public class SysUserProfileController { | ||
| 48 | @PreAuthenticated | 48 | @PreAuthenticated |
| 49 | public CommonResult<String> updateAvatar(@RequestParam("avatarFile") MultipartFile file) throws IOException { | 49 | public CommonResult<String> updateAvatar(@RequestParam("avatarFile") MultipartFile file) throws IOException { |
| 50 | if (file.isEmpty()) { | 50 | if (file.isEmpty()) { |
| 51 | - throw ServiceExceptionUtil.exception(FILE_IS_EMPTY); | 51 | + throw ServiceExceptionUtil.exception(MbrErrorCodeConstants.FILE_IS_EMPTY); |
| 52 | } | 52 | } |
| 53 | String avatar = userService.updateAvatar(getLoginUserId(), file.getInputStream()); | 53 | String avatar = userService.updateAvatar(getLoginUserId(), file.getInputStream()); |
| 54 | return success(avatar); | 54 | return success(avatar); |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/user/vo/MbrUserInfoRespVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.controller.user.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.user.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | ||
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | import lombok.NoArgsConstructor; | 7 | import lombok.NoArgsConstructor; |
| 8 | 8 | ||
| 9 | -@ApiModel("用户个人信息 Response VO") | 9 | +@ApiModel("APP 端 - 用户个人信息 Response VO") |
| 10 | @Data | 10 | @Data |
| 11 | @NoArgsConstructor | 11 | @NoArgsConstructor |
| 12 | @AllArgsConstructor | 12 | @AllArgsConstructor |
| 13 | -public class MbrUserInfoRespVO { | 13 | +public class AppUserInfoRespVO { |
| 14 | 14 | ||
| 15 | @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") | 15 | @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") |
| 16 | private String nickname; | 16 | private String nickname; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/user/vo/MbrUserUpdateMobileReqVO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserUpdateMobileReqVO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.controller.user.vo; | 1 | +package cn.iocoder.yudao.module.member.controller.app.user.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 3 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| @@ -13,12 +13,12 @@ import javax.validation.constraints.NotBlank; | @@ -13,12 +13,12 @@ import javax.validation.constraints.NotBlank; | ||
| 13 | import javax.validation.constraints.NotEmpty; | 13 | import javax.validation.constraints.NotEmpty; |
| 14 | import javax.validation.constraints.Pattern; | 14 | import javax.validation.constraints.Pattern; |
| 15 | 15 | ||
| 16 | -@ApiModel("修改手机 Request VO") | 16 | +@ApiModel("APP 端 - 修改手机 Request VO") |
| 17 | @Data | 17 | @Data |
| 18 | @NoArgsConstructor | 18 | @NoArgsConstructor |
| 19 | @AllArgsConstructor | 19 | @AllArgsConstructor |
| 20 | @Builder | 20 | @Builder |
| 21 | -public class MbrUserUpdateMobileReqVO { | 21 | +public class AppUserUpdateMobileReqVO { |
| 22 | 22 | ||
| 23 | @ApiModelProperty(value = "手机验证码", required = true, example = "1024") | 23 | @ApiModelProperty(value = "手机验证码", required = true, example = "1024") |
| 24 | @NotEmpty(message = "手机验证码不能为空") | 24 | @NotEmpty(message = "手机验证码不能为空") |
| @@ -44,5 +44,4 @@ public class MbrUserUpdateMobileReqVO { | @@ -44,5 +44,4 @@ public class MbrUserUpdateMobileReqVO { | ||
| 44 | @Mobile | 44 | @Mobile |
| 45 | private String oldMobile; | 45 | private String oldMobile; |
| 46 | 46 | ||
| 47 | - | ||
| 48 | } | 47 | } |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/package-info.java
0 → 100644
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/convert/auth/SysAuthConvert.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/auth/SysAuthConvert.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.convert.auth; | 1 | +package cn.iocoder.yudao.module.member.convert.auth; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 4 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/convert/package-info.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/package-info.java
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.convert.user; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; | ||
| 4 | +import org.mapstruct.Mapper; | ||
| 5 | +import org.mapstruct.factory.Mappers; | ||
| 6 | + | ||
| 7 | +@Mapper | ||
| 8 | +public interface UserConvert { | ||
| 9 | + | ||
| 10 | + UserConvert INSTANCE = Mappers.getMapper(UserConvert.class); | ||
| 11 | + | ||
| 12 | + AppUserInfoRespVO convert(MemberUserDO bean); | ||
| 13 | + | ||
| 14 | +} |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dal/dataobject/sms/SysSmsCodeDO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/sms/SysSmsCodeDO.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.dal.dataobject.sms; | 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.sms; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import com.baomidou.mybatisplus.annotation.TableName; | 4 | import com.baomidou.mybatisplus.annotation.TableName; |
| 5 | import lombok.*; | 5 | import lombok.*; |
| 6 | -import lombok.experimental.Accessors; | ||
| 7 | 6 | ||
| 8 | import java.util.Date; | 7 | import java.util.Date; |
| 9 | 8 |
yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/member/dal/dataobject/user/MbrUserDO.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUserDO.java
| 1 | -package cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user; | 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.user; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | 3 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 4 | import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | 4 | import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; |
| @@ -16,13 +16,13 @@ import java.util.Date; | @@ -16,13 +16,13 @@ import java.util.Date; | ||
| 16 | * | 16 | * |
| 17 | * @author 芋道源码 | 17 | * @author 芋道源码 |
| 18 | */ | 18 | */ |
| 19 | -@TableName(value = "mbr_user", autoResultMap = true) | 19 | +@TableName(value = "member_user", autoResultMap = true) |
| 20 | @Data | 20 | @Data |
| 21 | @EqualsAndHashCode(callSuper = true) | 21 | @EqualsAndHashCode(callSuper = true) |
| 22 | @Builder | 22 | @Builder |
| 23 | @NoArgsConstructor | 23 | @NoArgsConstructor |
| 24 | @AllArgsConstructor | 24 | @AllArgsConstructor |
| 25 | -public class MbrUserDO extends TenantBaseDO { | 25 | +public class MemberUserDO extends TenantBaseDO { |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 28 | * 用户ID | 28 | * 用户ID |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dal/mysql/sms/SysSmsCodeMapper.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/sms/SysSmsCodeMapper.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.dal.mysql.sms; | 1 | +package cn.iocoder.yudao.module.member.dal.mysql.sms; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| 5 | +import cn.iocoder.yudao.module.member.dal.dataobject.sms.SysSmsCodeDO; | ||
| 5 | import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.sms.SysSmsCodeDO; | 6 | import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.sms.SysSmsCodeDO; |
| 6 | import org.apache.ibatis.annotations.Mapper; | 7 | import org.apache.ibatis.annotations.Mapper; |
| 7 | 8 | ||
| 8 | - | 9 | +// TODO @芋艿: |
| 9 | @Mapper | 10 | @Mapper |
| 10 | public interface SysSmsCodeMapper extends BaseMapperX<SysSmsCodeDO> { | 11 | public interface SysSmsCodeMapper extends BaseMapperX<SysSmsCodeDO> { |
| 11 | 12 |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserMapper.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MbrUserMapper.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.dal.mysql.user; | 1 | +package cn.iocoder.yudao.module.member.dal.mysql.user; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/package-info.java
0 → 100644
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/redis/package-info.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.dal.redis; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/enums/MbrErrorCodeConstants.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/enums/MemberErrorCodeConstants.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.enums; | 1 | +package cn.iocoder.yudao.module.member.enums; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.exception.ErrorCode; | 3 | import cn.iocoder.yudao.framework.common.exception.ErrorCode; |
| 4 | 4 | ||
| @@ -7,11 +7,12 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; | @@ -7,11 +7,12 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; | ||
| 7 | * | 7 | * |
| 8 | * member 系统,使用 1-004-000-000 段 | 8 | * member 系统,使用 1-004-000-000 段 |
| 9 | */ | 9 | */ |
| 10 | -public interface MbrErrorCodeConstants { | 10 | +public interface MemberErrorCodeConstants { |
| 11 | 11 | ||
| 12 | // ==========用户相关 1004001000============ | 12 | // ==========用户相关 1004001000============ |
| 13 | ErrorCode USER_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在"); | 13 | ErrorCode USER_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在"); |
| 14 | 14 | ||
| 15 | // ==========文件相关 1004002000 =========== | 15 | // ==========文件相关 1004002000 =========== |
| 16 | ErrorCode FILE_IS_EMPTY = new ErrorCode(1004002000, "文件为空"); | 16 | ErrorCode FILE_IS_EMPTY = new ErrorCode(1004002000, "文件为空"); |
| 17 | + | ||
| 17 | } | 18 | } |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/enums/SysErrorCodeConstants.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/enums/SysErrorCodeConstants.java
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/enums/sms/SysSmsSceneEnum.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/enums/sms/SysSmsSceneEnum.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.enums.sms; | 1 | +package cn.iocoder.yudao.module.member.enums.sms; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | 3 | import cn.iocoder.yudao.framework.common.core.IntArrayValuable; |
| 4 | import lombok.AllArgsConstructor; | 4 | import lombok.AllArgsConstructor; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/enums/sms/SysSmsTemplateCodeConstants.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/enums/sms/SysSmsTemplateCodeConstants.java
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/framework/package-info.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/framework/package-info.java
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/framework/security/SecurityConfiguration.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/framework/security/SecurityConfiguration.java
| 1 | -package cn.iocoder.yudao.userserver.framework.security; | 1 | +package cn.iocoder.yudao.module.member.framework.security; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.web.config.WebProperties; | 3 | import cn.iocoder.yudao.framework.web.config.WebProperties; |
| 4 | import org.springframework.context.annotation.Bean; | 4 | import org.springframework.context.annotation.Bean; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/framework/sms/SmsCodeConfiguration.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/framework/sms/SmsCodeConfiguration.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.framework.sms; | 1 | +package cn.iocoder.yudao.module.member.framework.sms; |
| 2 | 2 | ||
| 3 | import org.springframework.boot.context.properties.EnableConfigurationProperties; | 3 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 4 | import org.springframework.context.annotation.Configuration; | 4 | import org.springframework.context.annotation.Configuration; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/framework/sms/SmsCodeProperties.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/framework/sms/SmsCodeProperties.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.framework.sms; | 1 | +package cn.iocoder.yudao.module.member.framework.sms; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | import org.springframework.boot.context.properties.ConfigurationProperties; | 4 | import org.springframework.boot.context.properties.ConfigurationProperties; |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/package-info.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/auth/SysAuthService.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/SysAuthService.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service.auth; | 1 | +package cn.iocoder.yudao.module.member.service.auth; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; | 3 | import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; |
| 4 | -import cn.iocoder.yudao.userserver.modules.system.controller.auth.vo.*; | 4 | +import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; |
| 5 | 5 | ||
| 6 | import javax.validation.Valid; | 6 | import javax.validation.Valid; |
| 7 | 7 |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/auth/impl/SysAuthServiceImpl.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/SysAuthServiceImpl.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service.auth.impl; | 1 | +package cn.iocoder.yudao.module.member.service.auth; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.lang.Assert; | 4 | import cn.hutool.core.lang.Assert; |
| @@ -12,12 +12,13 @@ import cn.iocoder.yudao.coreservice.modules.system.service.logger.dto.SysLoginLo | @@ -12,12 +12,13 @@ import cn.iocoder.yudao.coreservice.modules.system.service.logger.dto.SysLoginLo | ||
| 12 | import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; | 12 | import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; |
| 13 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | 13 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 14 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | 14 | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; |
| 15 | +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | ||
| 15 | import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; | 16 | import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
| 16 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | 17 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 17 | import cn.iocoder.yudao.framework.security.core.LoginUser; | 18 | import cn.iocoder.yudao.framework.security.core.LoginUser; |
| 18 | import cn.iocoder.yudao.userserver.modules.member.dal.mysql.user.MbrUserMapper; | 19 | import cn.iocoder.yudao.userserver.modules.member.dal.mysql.user.MbrUserMapper; |
| 19 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; | 20 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; |
| 20 | -import cn.iocoder.yudao.userserver.modules.system.controller.auth.vo.*; | 21 | +import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; |
| 21 | import cn.iocoder.yudao.userserver.modules.system.convert.auth.SysAuthConvert; | 22 | import cn.iocoder.yudao.userserver.modules.system.convert.auth.SysAuthConvert; |
| 22 | import cn.iocoder.yudao.userserver.modules.system.enums.sms.SysSmsSceneEnum; | 23 | import cn.iocoder.yudao.userserver.modules.system.enums.sms.SysSmsSceneEnum; |
| 23 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; | 24 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; |
| @@ -131,13 +132,13 @@ public class SysAuthServiceImpl implements SysAuthService { | @@ -131,13 +132,13 @@ public class SysAuthServiceImpl implements SysAuthService { | ||
| 131 | String unionId = socialService.getAuthUserUnionId(authUser); | 132 | String unionId = socialService.getAuthUserUnionId(authUser); |
| 132 | List<SysSocialUserDO> socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, USER_TYPE_ENUM); | 133 | List<SysSocialUserDO> socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, USER_TYPE_ENUM); |
| 133 | if (CollUtil.isEmpty(socialUsers)) { | 134 | if (CollUtil.isEmpty(socialUsers)) { |
| 134 | - throw exception(AUTH_THIRD_LOGIN_NOT_BIND); | 135 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.AUTH_THIRD_LOGIN_NOT_BIND); |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | // 自动登录 | 138 | // 自动登录 |
| 138 | MbrUserDO user = userService.getUser(socialUsers.get(0).getUserId()); | 139 | MbrUserDO user = userService.getUser(socialUsers.get(0).getUserId()); |
| 139 | if (user == null) { | 140 | if (user == null) { |
| 140 | - throw exception(USER_NOT_EXISTS); | 141 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_NOT_EXISTS); |
| 141 | } | 142 | } |
| 142 | this.createLoginLog(user.getMobile(), SysLoginLogTypeEnum.LOGIN_SOCIAL, SysLoginResultEnum.SUCCESS); | 143 | this.createLoginLog(user.getMobile(), SysLoginLogTypeEnum.LOGIN_SOCIAL, SysLoginResultEnum.SUCCESS); |
| 143 | 144 | ||
| @@ -190,14 +191,14 @@ public class SysAuthServiceImpl implements SysAuthService { | @@ -190,14 +191,14 @@ public class SysAuthServiceImpl implements SysAuthService { | ||
| 190 | authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password)); | 191 | authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password)); |
| 191 | } catch (BadCredentialsException badCredentialsException) { | 192 | } catch (BadCredentialsException badCredentialsException) { |
| 192 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.BAD_CREDENTIALS); | 193 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.BAD_CREDENTIALS); |
| 193 | - throw exception(AUTH_LOGIN_BAD_CREDENTIALS); | 194 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.AUTH_LOGIN_BAD_CREDENTIALS); |
| 194 | } catch (DisabledException disabledException) { | 195 | } catch (DisabledException disabledException) { |
| 195 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.USER_DISABLED); | 196 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.USER_DISABLED); |
| 196 | - throw exception(AUTH_LOGIN_USER_DISABLED); | 197 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.AUTH_LOGIN_USER_DISABLED); |
| 197 | } catch (AuthenticationException authenticationException) { | 198 | } catch (AuthenticationException authenticationException) { |
| 198 | log.error("[login0][username({}) 发生未知异常]", username, authenticationException); | 199 | log.error("[login0][username({}) 发生未知异常]", username, authenticationException); |
| 199 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.UNKNOWN_ERROR); | 200 | this.createLoginLog(username, logTypeEnum, SysLoginResultEnum.UNKNOWN_ERROR); |
| 200 | - throw exception(AUTH_LOGIN_FAIL_UNKNOWN); | 201 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.AUTH_LOGIN_FAIL_UNKNOWN); |
| 201 | } | 202 | } |
| 202 | // 登录成功的日志 | 203 | // 登录成功的日志 |
| 203 | Assert.notNull(authentication.getPrincipal(), "Principal 不会为空"); | 204 | Assert.notNull(authentication.getPrincipal(), "Principal 不会为空"); |
| @@ -248,7 +249,7 @@ public class SysAuthServiceImpl implements SysAuthService { | @@ -248,7 +249,7 @@ public class SysAuthServiceImpl implements SysAuthService { | ||
| 248 | // 重新加载 MbrUserDO 信息 | 249 | // 重新加载 MbrUserDO 信息 |
| 249 | MbrUserDO user = userService.getUser(loginUser.getId()); | 250 | MbrUserDO user = userService.getUser(loginUser.getId()); |
| 250 | if (user == null || CommonStatusEnum.DISABLE.getStatus().equals(user.getStatus())) { | 251 | if (user == null || CommonStatusEnum.DISABLE.getStatus().equals(user.getStatus())) { |
| 251 | - throw exception(AUTH_TOKEN_EXPIRED); // 校验 token 时,用户被禁用的情况下,也认为 token 过期,方便前端跳转到登录界面 | 252 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.AUTH_TOKEN_EXPIRED); // 校验 token 时,用户被禁用的情况下,也认为 token 过期,方便前端跳转到登录界面 |
| 252 | } | 253 | } |
| 253 | 254 | ||
| 254 | // 刷新 LoginUser 缓存 | 255 | // 刷新 LoginUser 缓存 |
| @@ -321,11 +322,11 @@ public class SysAuthServiceImpl implements SysAuthService { | @@ -321,11 +322,11 @@ public class SysAuthServiceImpl implements SysAuthService { | ||
| 321 | public MbrUserDO checkOldPassword(Long id, String oldPassword) { | 322 | public MbrUserDO checkOldPassword(Long id, String oldPassword) { |
| 322 | MbrUserDO user = userMapper.selectById(id); | 323 | MbrUserDO user = userMapper.selectById(id); |
| 323 | if (user == null) { | 324 | if (user == null) { |
| 324 | - throw exception(USER_NOT_EXISTS); | 325 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_NOT_EXISTS); |
| 325 | } | 326 | } |
| 326 | // 参数:未加密密码,编码后的密码 | 327 | // 参数:未加密密码,编码后的密码 |
| 327 | if (!passwordEncoder.matches(oldPassword,user.getPassword())) { | 328 | if (!passwordEncoder.matches(oldPassword,user.getPassword())) { |
| 328 | - throw exception(USER_PASSWORD_FAILED); | 329 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_PASSWORD_FAILED); |
| 329 | } | 330 | } |
| 330 | return user; | 331 | return user; |
| 331 | } | 332 | } |
| @@ -333,7 +334,7 @@ public class SysAuthServiceImpl implements SysAuthService { | @@ -333,7 +334,7 @@ public class SysAuthServiceImpl implements SysAuthService { | ||
| 333 | public MbrUserDO checkUserIfExists(String mobile) { | 334 | public MbrUserDO checkUserIfExists(String mobile) { |
| 334 | MbrUserDO user = userMapper.selectByMobile(mobile); | 335 | MbrUserDO user = userMapper.selectByMobile(mobile); |
| 335 | if (user == null) { | 336 | if (user == null) { |
| 336 | - throw exception(USER_NOT_EXISTS); | 337 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_NOT_EXISTS); |
| 337 | } | 338 | } |
| 338 | return user; | 339 | return user; |
| 339 | } | 340 | } |
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/package-info.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.service; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/sms/SysSmsCodeService.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/sms/SysSmsCodeService.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service.sms; | 1 | +package cn.iocoder.yudao.module.member.service.sms; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.exception.ServiceException; | 3 | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; | 4 | import cn.iocoder.yudao.framework.common.validation.Mobile; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/sms/impl/SysSmsCodeServiceImpl.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/sms/SysSmsCodeServiceImpl.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service.sms.impl; | 1 | +package cn.iocoder.yudao.module.member.service.sms; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.map.MapUtil; | 3 | import cn.hutool.core.map.MapUtil; |
| 4 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 4 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 5 | import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; | 5 | import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; |
| 6 | +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | ||
| 6 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; | 7 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; |
| 7 | import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.sms.SysSmsCodeDO; | 8 | import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.sms.SysSmsCodeDO; |
| 8 | import cn.iocoder.yudao.userserver.modules.system.dal.mysql.sms.SysSmsCodeMapper; | 9 | import cn.iocoder.yudao.userserver.modules.system.dal.mysql.sms.SysSmsCodeMapper; |
| @@ -63,7 +64,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | @@ -63,7 +64,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | ||
| 63 | // 检测手机号是否已被使用 | 64 | // 检测手机号是否已被使用 |
| 64 | MbrUserDO userByMobile = mbrUserService.getUserByMobile(mobile); | 65 | MbrUserDO userByMobile = mbrUserService.getUserByMobile(mobile); |
| 65 | if (userByMobile != null){ | 66 | if (userByMobile != null){ |
| 66 | - throw exception(USER_SMS_CODE_IS_EXISTS); | 67 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_IS_EXISTS); |
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | // 发送短信 | 70 | // 发送短信 |
| @@ -75,11 +76,11 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | @@ -75,11 +76,11 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | ||
| 75 | SysSmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, null,null); | 76 | SysSmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, null,null); |
| 76 | if (lastSmsCode != null) { | 77 | if (lastSmsCode != null) { |
| 77 | if (lastSmsCode.getTodayIndex() >= smsCodeProperties.getSendMaximumQuantityPerDay()) { // 超过当天发送的上限。 | 78 | if (lastSmsCode.getTodayIndex() >= smsCodeProperties.getSendMaximumQuantityPerDay()) { // 超过当天发送的上限。 |
| 78 | - throw exception(USER_SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY); | 79 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY); |
| 79 | } | 80 | } |
| 80 | if (System.currentTimeMillis() - lastSmsCode.getCreateTime().getTime() | 81 | if (System.currentTimeMillis() - lastSmsCode.getCreateTime().getTime() |
| 81 | < smsCodeProperties.getSendFrequency().toMillis()) { // 发送过于频繁 | 82 | < smsCodeProperties.getSendFrequency().toMillis()) { // 发送过于频繁 |
| 82 | - throw exception(USER_SMS_CODE_SEND_TOO_FAST); | 83 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_SEND_TOO_FAST); |
| 83 | } | 84 | } |
| 84 | // TODO 芋艿:提升,每个 IP 每天可发送数量 | 85 | // TODO 芋艿:提升,每个 IP 每天可发送数量 |
| 85 | // TODO 芋艿:提升,每个 IP 每小时可发送数量 | 86 | // TODO 芋艿:提升,每个 IP 每小时可发送数量 |
| @@ -102,7 +103,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | @@ -102,7 +103,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | ||
| 102 | 103 | ||
| 103 | // 判断验证码是否已被使用 | 104 | // 判断验证码是否已被使用 |
| 104 | if (Boolean.TRUE.equals(lastSmsCode.getUsed())) { | 105 | if (Boolean.TRUE.equals(lastSmsCode.getUsed())) { |
| 105 | - throw exception(USER_SMS_CODE_USED); | 106 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_USED); |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | // 使用验证码 | 109 | // 使用验证码 |
| @@ -114,7 +115,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | @@ -114,7 +115,7 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | ||
| 114 | public void sendSmsCodeLogin(Long userId) { | 115 | public void sendSmsCodeLogin(Long userId) { |
| 115 | MbrUserDO user = mbrUserService.getUser(userId); | 116 | MbrUserDO user = mbrUserService.getUser(userId); |
| 116 | if (user == null){ | 117 | if (user == null){ |
| 117 | - throw exception(USER_NOT_EXISTS); | 118 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_NOT_EXISTS); |
| 118 | } | 119 | } |
| 119 | // 发送验证码 | 120 | // 发送验证码 |
| 120 | this.sendSmsCode(user.getMobile(),SysSmsSceneEnum.CHANGE_MOBILE_BY_SMS.getScene(), getClientIP()); | 121 | this.sendSmsCode(user.getMobile(),SysSmsSceneEnum.CHANGE_MOBILE_BY_SMS.getScene(), getClientIP()); |
| @@ -127,11 +128,11 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | @@ -127,11 +128,11 @@ public class SysSmsCodeServiceImpl implements SysSmsCodeService { | ||
| 127 | 128 | ||
| 128 | // 若验证码不存在,抛出异常 | 129 | // 若验证码不存在,抛出异常 |
| 129 | if (lastSmsCode == null) { | 130 | if (lastSmsCode == null) { |
| 130 | - throw exception(USER_SMS_CODE_NOT_FOUND); | 131 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_NOT_FOUND); |
| 131 | } | 132 | } |
| 132 | if (System.currentTimeMillis() - lastSmsCode.getCreateTime().getTime() | 133 | if (System.currentTimeMillis() - lastSmsCode.getCreateTime().getTime() |
| 133 | >= smsCodeProperties.getExpireTimes().toMillis()) { // 验证码已过期 | 134 | >= smsCodeProperties.getExpireTimes().toMillis()) { // 验证码已过期 |
| 134 | - throw exception(USER_SMS_CODE_EXPIRED); | 135 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_EXPIRED); |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | return lastSmsCode; | 138 | return lastSmsCode; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/MbrUserService.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MbrUserService.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.service.user; | 1 | +package cn.iocoder.yudao.module.member.service.user; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 4 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; | 4 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/impl/MbrUserServiceImpl.java renamed to yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/user/MbrUserServiceImpl.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.service.user.impl; | 1 | +package cn.iocoder.yudao.module.member.service.user; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.io.IoUtil; | 3 | import cn.hutool.core.io.IoUtil; |
| 4 | import cn.hutool.core.util.IdUtil; | 4 | import cn.hutool.core.util.IdUtil; |
| 5 | import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; | 5 | import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; |
| 6 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 6 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 7 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | 7 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 8 | +import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | ||
| 8 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; | 9 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; |
| 9 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserUpdateMobileReqVO; | 10 | import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserUpdateMobileReqVO; |
| 10 | import cn.iocoder.yudao.userserver.modules.member.convert.user.UserProfileConvert; | 11 | import cn.iocoder.yudao.userserver.modules.member.convert.user.UserProfileConvert; |
| @@ -135,7 +136,7 @@ public class MbrUserServiceImpl implements MbrUserService { | @@ -135,7 +136,7 @@ public class MbrUserServiceImpl implements MbrUserService { | ||
| 135 | SysSmsCodeDO sysSmsCodeDO = smsCodeService.checkCodeIsExpired(reqVO.getOldMobile(), reqVO.getOldCode(), SysSmsSceneEnum.CHANGE_MOBILE_BY_SMS.getScene()); | 136 | SysSmsCodeDO sysSmsCodeDO = smsCodeService.checkCodeIsExpired(reqVO.getOldMobile(), reqVO.getOldCode(), SysSmsSceneEnum.CHANGE_MOBILE_BY_SMS.getScene()); |
| 136 | // 判断旧code是否未被使用,如果是,抛出异常 | 137 | // 判断旧code是否未被使用,如果是,抛出异常 |
| 137 | if (Boolean.FALSE.equals(sysSmsCodeDO.getUsed())){ | 138 | if (Boolean.FALSE.equals(sysSmsCodeDO.getUsed())){ |
| 138 | - throw exception(USER_SMS_CODE_IS_UNUSED); | 139 | + throw ServiceExceptionUtil.exception(SysErrorCodeConstants.USER_SMS_CODE_IS_UNUSED); |
| 139 | } | 140 | } |
| 140 | 141 | ||
| 141 | // 使用新验证码 | 142 | // 使用新验证码 |
yudao-user-server/src/test/java/cn/iocoder/yudao/userserver/modules/system/service/SysAuthServiceTest.java renamed to yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/SysAuthServiceTest.java
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service; | 1 | +package cn.iocoder.yudao.module.member.service.auth; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | 3 | import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; |
| 4 | import cn.iocoder.yudao.coreservice.modules.system.service.auth.SysUserSessionCoreService; | 4 | import cn.iocoder.yudao.coreservice.modules.system.service.auth.SysUserSessionCoreService; |
| @@ -10,8 +10,8 @@ import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; | @@ -10,8 +10,8 @@ import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; | ||
| 10 | import cn.iocoder.yudao.userserver.BaseDbAndRedisUnitTest; | 10 | import cn.iocoder.yudao.userserver.BaseDbAndRedisUnitTest; |
| 11 | import cn.iocoder.yudao.userserver.modules.member.dal.mysql.user.MbrUserMapper; | 11 | import cn.iocoder.yudao.userserver.modules.member.dal.mysql.user.MbrUserMapper; |
| 12 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; | 12 | import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; |
| 13 | -import cn.iocoder.yudao.userserver.modules.system.controller.auth.vo.MbrAuthResetPasswordReqVO; | ||
| 14 | -import cn.iocoder.yudao.userserver.modules.system.controller.auth.vo.MbrAuthUpdatePasswordReqVO; | 13 | +import cn.iocoder.yudao.module.member.controller.app.auth.vo.MbrAuthResetPasswordReqVO; |
| 14 | +import cn.iocoder.yudao.module.member.controller.app.auth.vo.MbrAuthUpdatePasswordReqVO; | ||
| 15 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; | 15 | import cn.iocoder.yudao.userserver.modules.system.service.auth.SysAuthService; |
| 16 | import cn.iocoder.yudao.userserver.modules.system.service.auth.impl.SysAuthServiceImpl; | 16 | import cn.iocoder.yudao.userserver.modules.system.service.auth.impl.SysAuthServiceImpl; |
| 17 | import cn.iocoder.yudao.userserver.modules.system.service.sms.SysSmsCodeService; | 17 | import cn.iocoder.yudao.userserver.modules.system.service.sms.SysSmsCodeService; |
yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/package-info.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.service; |
yudao-user-server/src/test/java/cn/iocoder/yudao/userserver/modules/member/service/MbrUserServiceImplTest.java renamed to yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MbrUserServiceImplTest.java
| 1 | -package cn.iocoder.yudao.userserver.modules.member.service; | 1 | +package cn.iocoder.yudao.module.member.service.user; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.RandomUtil; | 3 | import cn.hutool.core.util.RandomUtil; |
| 4 | import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; | 4 | import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; |
| @@ -122,7 +122,7 @@ public class MbrUserServiceImplTest extends BaseDbAndRedisUnitTest { | @@ -122,7 +122,7 @@ public class MbrUserServiceImplTest extends BaseDbAndRedisUnitTest { | ||
| 122 | String oldCode = RandomUtil.randomString(4); | 122 | String oldCode = RandomUtil.randomString(4); |
| 123 | codeDO.setMobile(userDO.getMobile()); | 123 | codeDO.setMobile(userDO.getMobile()); |
| 124 | codeDO.setCode(oldCode); | 124 | codeDO.setCode(oldCode); |
| 125 | - codeDO.setScene(CHANGE_MOBILE_BY_SMS.getScene()); | 125 | + codeDO.setScene(SysSmsSceneEnum.CHANGE_MOBILE_BY_SMS.getScene()); |
| 126 | codeDO.setUsed(Boolean.FALSE); | 126 | codeDO.setUsed(Boolean.FALSE); |
| 127 | when(sysSmsCodeService.checkCodeIsExpired(codeDO.getMobile(),codeDO.getCode(),codeDO.getScene())).thenReturn(codeDO); | 127 | when(sysSmsCodeService.checkCodeIsExpired(codeDO.getMobile(),codeDO.getCode(),codeDO.getScene())).thenReturn(codeDO); |
| 128 | 128 |
yudao-user-server/src/test/java/cn/iocoder/yudao/userserver/BaseDbAndRedisUnitTest.java renamed to yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/test/BaseDbAndRedisUnitTest.java
| 1 | -package cn.iocoder.yudao.userserver; | 1 | +package cn.iocoder.yudao.module.member.test; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; | 3 | import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; |
| 4 | import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; | 4 | import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; |
yudao-user-server/src/test/java/cn/iocoder/yudao/userserver/BaseDbUnitTest.java renamed to yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/test/BaseDbUnitTest.java
| 1 | -package cn.iocoder.yudao.userserver; | 1 | +package cn.iocoder.yudao.module.member.test; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; | 3 | import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; |
| 4 | import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; | 4 | import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; |
yudao-user-server/src/test/java/cn/iocoder/yudao/userserver/config/RedisTestConfiguration.java renamed to yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/test/RedisTestConfiguration.java
| 1 | -package cn.iocoder.yudao.userserver.config; | 1 | +package cn.iocoder.yudao.module.member.test; |
| 2 | 2 | ||
| 3 | import com.github.fppt.jedismock.RedisServer; | 3 | import com.github.fppt.jedismock.RedisServer; |
| 4 | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; | 4 | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
yudao-user-server/src/test/resources/application-unit-test.yaml renamed to yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml
yudao-user-server/src/test/resources/file/erweima.jpg renamed to yudao-module-member/yudao-module-member-impl/src/test/resources/file/erweima.jpg
18 KB
yudao-user-server/src/test/resources/logback-spring.xml renamed to yudao-module-member/yudao-module-member-impl/src/test/resources/logback-spring.xml
yudao-user-server/src/test/resources/sql/clean.sql renamed to yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql
yudao-user-server/src/test/resources/sql/create_tables.sql renamed to yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql
yudao-server/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | + <parent> | ||
| 6 | + <artifactId>yudao</artifactId> | ||
| 7 | + <groupId>cn.iocoder.boot</groupId> | ||
| 8 | + <version>${revision}</version> | ||
| 9 | + </parent> | ||
| 10 | + <modelVersion>4.0.0</modelVersion> | ||
| 11 | + | ||
| 12 | + <artifactId>yudao-server</artifactId> | ||
| 13 | + <packaging>jar</packaging> | ||
| 14 | + | ||
| 15 | + <name>${artifactId}</name> | ||
| 16 | + <description> | ||
| 17 | + 后端 Server 的主项目,通过引入需要 yudao-module-xxx 的依赖, | ||
| 18 | + 从而实现提供 RESTful API 给 yudao-ui-admin、yudao-ui-user 等前端项目。 | ||
| 19 | + 本质上来说,它就是个空壳(容器)! | ||
| 20 | + </description> | ||
| 21 | + | ||
| 22 | +</project> |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.member.controller; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/package-info.java deleted
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/user/UserProfileConvert.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.member.convert.user; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.coreservice.modules.member.dal.dataobject.user.MbrUserDO; | ||
| 4 | -import cn.iocoder.yudao.userserver.modules.member.controller.user.vo.MbrUserInfoRespVO; | ||
| 5 | -import org.mapstruct.Mapper; | ||
| 6 | -import org.mapstruct.factory.Mappers; | ||
| 7 | - | ||
| 8 | -@Mapper | ||
| 9 | -public interface UserProfileConvert { | ||
| 10 | - | ||
| 11 | - UserProfileConvert INSTANCE = Mappers.getMapper(UserProfileConvert.class); | ||
| 12 | - | ||
| 13 | - MbrUserInfoRespVO convert(MbrUserDO bean); | ||
| 14 | - | ||
| 15 | -} |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md deleted
| 1 | -<http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao> |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/package-info.java deleted
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.member.service; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/convert/package-info.java deleted
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md deleted
| 1 | -<http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao> |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dal/dataobject/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.system.dal.dataobject; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dal/mysql/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.system.dal.mysql; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/dal/redis/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.system.dal.redis; |
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/framework/package-info.java deleted
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/package-info.java deleted
yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/system/service/package-info.java deleted
| 1 | -package cn.iocoder.yudao.userserver.modules.system.service; |