From 28fdc8e42e17c48b9b214b8ab5c388a0f5527c6e Mon Sep 17 00:00:00 2001 From: wangwenbin10 Date: Sat, 9 Oct 2021 08:24:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=20c=20=E7=AB=AF?= =?UTF-8?q?=E7=9A=84=E7=99=BB=E5=BD=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/loginlog/SysLoginLogCreateReqVO.java | 7 +- .../system/service/auth/SysAuthService.java | 2 +- .../service/auth/impl/SysAuthServiceImpl.java | 11 ++++ .../logger/impl/SysLoginLogServiceImpl.java | 7 -- .../system/service/user/SysUserService.java | 2 +- .../framework/security/core/LoginUser.java | 4 +- .../infra/service/auth/SysAuthService.java | 14 ---- .../service/auth/impl/SysAuthServiceImpl.java | 38 ----------- .../modules/infra/service/package-info.java | 1 + .../controller/auth/MbrAuthController.java | 16 +++-- .../modules/member/convert/package-info.java | 1 + .../member/convert/user/MbrAuthConvert.java | 15 +++++ .../{mysql => dataobject}/user/MbrUserDO.java | 2 +- .../member/dal/mysql/user/MbrUserMapper.java | 19 ++++++ .../member/service/auth/MbrAuthService.java | 27 ++++++++ .../service/auth/impl/MbrAuthServiceImpl.java | 65 +++++++++++++++++++ .../member/service/user/MbrUserService.java | 20 ++++++ .../service/user/impl/MbrUserServiceImpl.java | 30 +++++++++ 更新日志.md | 10 ++- 19 files changed, 221 insertions(+), 70 deletions(-) delete mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/SysAuthService.java delete mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/impl/SysAuthServiceImpl.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/package-info.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/package-info.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/user/MbrAuthConvert.java rename yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/{mysql => dataobject}/user/MbrUserDO.java (95%) create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserMapper.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/MbrAuthService.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/impl/MbrAuthServiceImpl.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/MbrUserService.java create mode 100644 yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/impl/MbrUserServiceImpl.java diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/logger/vo/loginlog/SysLoginLogCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/logger/vo/loginlog/SysLoginLogCreateReqVO.java index 738937806..ab0644a94 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/logger/vo/loginlog/SysLoginLogCreateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/logger/vo/loginlog/SysLoginLogCreateReqVO.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.adminserver.modules.system.controller.logger.vo.loginlog; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,4 +12,8 @@ import lombok.ToString; @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SysLoginLogCreateReqVO extends SysLoginLogBaseVO { -} + + @ApiModelProperty(value = "用户编号", example = "1") + private Long userId; + +} \ No newline at end of file diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/SysAuthService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/SysAuthService.java index 369f7c0b9..2d5fe8c47 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/SysAuthService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/SysAuthService.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkSer import javax.validation.Valid; /** - * 认证 Service 接口 + * 管理后台的认证 Service 接口 * * 提供用户的账号密码登录、token 的校验等认证相关的功能 * diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/impl/SysAuthServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/impl/SysAuthServiceImpl.java index a17042822..14c7c9846 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/impl/SysAuthServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/auth/impl/SysAuthServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.util.Assert; import javax.annotation.Resource; import java.util.List; +import java.util.Objects; import java.util.Set; import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.*; @@ -154,14 +155,24 @@ public class SysAuthServiceImpl implements SysAuthService { } private void createLoginLog(String username, SysLoginLogTypeEnum logTypeEnum, SysLoginResultEnum loginResult) { + // 获得用户 + SysUserDO user = userService.getUserByUsername(username); + // 插入登录日志 SysLoginLogCreateReqVO reqVO = new SysLoginLogCreateReqVO(); reqVO.setLogType(logTypeEnum.getType()); reqVO.setTraceId(TracerUtils.getTraceId()); + if (user != null) { + reqVO.setUserId(user.getId()); + } reqVO.setUsername(username); reqVO.setUserAgent(ServletUtils.getUserAgent()); reqVO.setUserIp(ServletUtils.getClientIP()); reqVO.setResult(loginResult.getResult()); loginLogService.createLoginLog(reqVO); + // 更新最后登录时间 + if (user != null && Objects.equals(SysLoginResultEnum.SUCCESS.getResult(), loginResult.getResult())) { + + } } /** diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/logger/impl/SysLoginLogServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/logger/impl/SysLoginLogServiceImpl.java index b5a7b3500..811b51677 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/logger/impl/SysLoginLogServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/logger/impl/SysLoginLogServiceImpl.java @@ -24,17 +24,10 @@ public class SysLoginLogServiceImpl implements SysLoginLogService { @Resource private SysLoginLogMapper loginLogMapper; - @Resource - private SysUserService userService; @Override public void createLoginLog(SysLoginLogCreateReqVO reqVO) { SysLoginLogDO loginLog = SysLoginLogConvert.INSTANCE.convert(reqVO); - // 获得用户 - SysUserDO user = userService.getUserByUsername(reqVO.getUsername()); - if (user != null) { - loginLog.setUserId(user.getId()); - } loginLog.setUserType(UserTypeEnum.ADMIN.getValue()); // 插入 loginLogMapper.insert(loginLog); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/user/SysUserService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/user/SysUserService.java index 792ea9038..91d9b5a76 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/user/SysUserService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/user/SysUserService.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; /** - * 用户 Service 接口 + * 后台用户 Service 接口 * * @author 芋道源码 */ diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java index 86c82319e..2f9d647c6 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java @@ -24,7 +24,7 @@ public class LoginUser implements UserDetails { */ private Long id; /** - * 科室编号 + * 部门编号 */ private Long deptId; /** @@ -49,6 +49,8 @@ public class LoginUser implements UserDetails { */ private Integer status; + // TODO @芋艿:怎么去掉 deptId + @Override @JsonIgnore// 避免序列化 public String getPassword() { diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/SysAuthService.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/SysAuthService.java deleted file mode 100644 index ba3defa61..000000000 --- a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/SysAuthService.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.iocoder.yudao.userserver.modules.infra.service.auth; - -import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; - -/** - * 认证 Service 接口 - * - * 提供用户的账号密码登录、token 的校验等认证相关的功能 - * - * @author 芋道源码 - */ -public interface SysAuthService extends SecurityAuthFrameworkService { - -} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/impl/SysAuthServiceImpl.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/impl/SysAuthServiceImpl.java deleted file mode 100644 index 6ab606c59..000000000 --- a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/auth/impl/SysAuthServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.yudao.userserver.modules.infra.service.auth.impl; - -import cn.iocoder.yudao.framework.security.core.LoginUser; -import cn.iocoder.yudao.userserver.modules.infra.service.auth.SysAuthService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -/** - * Auth Service 实现类 - * - * @author 芋道源码 - */ -@Service -@Slf4j -public class SysAuthServiceImpl implements SysAuthService { - - @Override - public LoginUser verifyTokenAndRefresh(String token) { - return null; - } - - @Override - public LoginUser mockLogin(Long userId) { - return null; - } - - @Override - public void logout(String token) { - - } - - @Override - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { - return null; - } -} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/package-info.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/package-info.java new file mode 100644 index 000000000..217acf96f --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/infra/service/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.yudao.userserver.modules.infra.service; \ No newline at end of file diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/MbrAuthController.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/MbrAuthController.java index 95f8b6510..cabf98cc3 100644 --- a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/MbrAuthController.java +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/controller/auth/MbrAuthController.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.userserver.modules.member.controller.auth; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.userserver.modules.member.controller.auth.vo.*; +import cn.iocoder.yudao.userserver.modules.member.service.auth.MbrAuthService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -10,8 +11,13 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.validation.Valid; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; +import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUserAgent; + @Api(tags = "认证") @RestController @RequestMapping("/") @@ -19,13 +25,15 @@ import javax.validation.Valid; @Slf4j public class MbrAuthController { + @Resource + private MbrAuthService authService; + @PostMapping("/login") @ApiOperation("使用手机 + 密码登录") public CommonResult login(@RequestBody @Valid MbrAuthLoginReqVO reqVO) { -// String token = authService.login(reqVO, getClientIP(), getUserAgent()); -// // 返回结果 -// return success(MbrAuthLoginRespVO.builder().token(token).build()); - return null; + String token = authService.login(reqVO, getClientIP(), getUserAgent()); + // 返回结果 + return success(MbrAuthLoginRespVO.builder().token(token).build()); } @PostMapping("/sms-login") diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/package-info.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/package-info.java new file mode 100644 index 000000000..57ebab78c --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.yudao.userserver.modules.member.convert; \ No newline at end of file diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/user/MbrAuthConvert.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/user/MbrAuthConvert.java new file mode 100644 index 000000000..9f4d11dd2 --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/convert/user/MbrAuthConvert.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.userserver.modules.member.convert.user; + +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user.MbrUserDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface MbrAuthConvert { + + MbrAuthConvert INSTANCE = Mappers.getMapper(MbrAuthConvert.class); + + LoginUser convert(MbrUserDO bean); + +} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserDO.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/dataobject/user/MbrUserDO.java similarity index 95% rename from yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserDO.java rename to yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/dataobject/user/MbrUserDO.java index d5263d388..f8976723e 100644 --- a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserDO.java +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/dataobject/user/MbrUserDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.userserver.modules.member.dal.mysql.user; +package cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserMapper.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserMapper.java new file mode 100644 index 000000000..7ab5128dc --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/dal/mysql/user/MbrUserMapper.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.userserver.modules.member.dal.mysql.user; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user.MbrUserDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * MbrUserDO Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface MbrUserMapper extends BaseMapperX { + + default MbrUserDO selectByMobile(String mobile) { + return selectOne("mobile", mobile); + } + +} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/MbrAuthService.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/MbrAuthService.java new file mode 100644 index 000000000..3f998ddc4 --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/MbrAuthService.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.userserver.modules.member.service.auth; + +import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; +import cn.iocoder.yudao.userserver.modules.member.controller.auth.vo.MbrAuthLoginReqVO; + +import javax.validation.Valid; + +/** + * 用户前台的认证 Service 接口 + * + * 提供用户的账号密码登录、token 的校验等认证相关的功能 + * + * @author 芋道源码 + */ +public interface MbrAuthService extends SecurityAuthFrameworkService { + + /** + * 手机 + 密码登录 + * + * @param reqVO 登录信息 + * @param userIp 用户 IP + * @param userAgent 用户 UA + * @return 身份令牌,使用 JWT 方式 + */ + String login(@Valid MbrAuthLoginReqVO reqVO, String userIp, String userAgent); + +} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/impl/MbrAuthServiceImpl.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/impl/MbrAuthServiceImpl.java new file mode 100644 index 000000000..0dfce16ec --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/auth/impl/MbrAuthServiceImpl.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.userserver.modules.member.service.auth.impl; + +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.userserver.modules.member.controller.auth.vo.MbrAuthLoginReqVO; +import cn.iocoder.yudao.userserver.modules.member.convert.user.MbrAuthConvert; +import cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user.MbrUserDO; +import cn.iocoder.yudao.userserver.modules.member.service.auth.MbrAuthService; +import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * Auth Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Slf4j +public class MbrAuthServiceImpl implements MbrAuthService { + + @Resource + @Lazy // 延迟加载,因为存在相互依赖的问题 + private AuthenticationManager authenticationManager; + + @Resource + private MbrUserService userService; + + @Override + public UserDetails loadUserByUsername(String mobile) throws UsernameNotFoundException { + // 获取 username 对应的 SysUserDO + MbrUserDO user = userService.getUserByMobile(mobile); + if (user == null) { + throw new UsernameNotFoundException(mobile); + } + // 创建 LoginUser 对象 + return MbrAuthConvert.INSTANCE.convert(user); + } + + @Override + public String login(MbrAuthLoginReqVO reqVO, String userIp, String userAgent) { + return null; + } + + @Override + public LoginUser verifyTokenAndRefresh(String token) { + return null; + } + + @Override + public LoginUser mockLogin(Long userId) { + return null; + } + + @Override + public void logout(String token) { + + } + +} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/MbrUserService.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/MbrUserService.java new file mode 100644 index 000000000..6949248ad --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/MbrUserService.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.userserver.modules.member.service.user; + +import cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user.MbrUserDO; + +/** + * 前台用户 Service 接口 + * + * @author 芋道源码 + */ +public interface MbrUserService { + + /** + * 通过手机查询用户 + * + * @param mobile 手机 + * @return 用户对象 + */ + MbrUserDO getUserByMobile(String mobile); + +} diff --git a/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/impl/MbrUserServiceImpl.java b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/impl/MbrUserServiceImpl.java new file mode 100644 index 000000000..1be87d01b --- /dev/null +++ b/yudao-user-server/src/main/java/cn/iocoder/yudao/userserver/modules/member/service/user/impl/MbrUserServiceImpl.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.userserver.modules.member.service.user.impl; + +import cn.iocoder.yudao.userserver.modules.member.dal.dataobject.user.MbrUserDO; +import cn.iocoder.yudao.userserver.modules.member.dal.mysql.user.MbrUserMapper; +import cn.iocoder.yudao.userserver.modules.member.service.user.MbrUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.validation.Valid; + +/** + * User Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Valid +@Slf4j +public class MbrUserServiceImpl implements MbrUserService { + + @Resource + private MbrUserMapper userMapper; + + @Override + public MbrUserDO getUserByMobile(String mobile) { + return userMapper.selectByMobile(mobile); + } + +} diff --git a/更新日志.md b/更新日志.md index bcf809395..9a56d5f3a 100644 --- a/更新日志.md +++ b/更新日志.md @@ -7,10 +7,16 @@ * 工作流 -## [v1.1.0] 待定 +## [v1.1.1] 待定 * 支付 -* 三方平台接入 + +## [v1.1.0] 待定 + +* 新增管理后台的企业微信、钉钉等社交登录 +* 新增用户前台(例如说,用户使用的小程序)的后端项目 `yudao-user-server` +* 新增用户前台的手机登录、验证码登录、TODO +* 修复管理后台的用户头像上传 404 的问题 ## [v1.0.0] 2021.05.03