mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	初始化 c 端的用户相关的表
This commit is contained in:
		| @@ -0,0 +1,100 @@ | ||||
| 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 io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import javax.validation.Valid; | ||||
|  | ||||
| @Api(tags = "认证") | ||||
| @RestController | ||||
| @RequestMapping("/") | ||||
| @Validated | ||||
| @Slf4j | ||||
| public class MbrAuthController { | ||||
|  | ||||
|     @PostMapping("/login") | ||||
|     @ApiOperation("使用手机 + 密码登录") | ||||
|     public CommonResult<MbrAuthLoginRespVO> login(@RequestBody @Valid MbrAuthLoginReqVO reqVO) { | ||||
| //        String token = authService.login(reqVO, getClientIP(), getUserAgent()); | ||||
| //        // 返回结果 | ||||
| //        return success(MbrAuthLoginRespVO.builder().token(token).build()); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/sms-login") | ||||
|     @ApiOperation("使用手机 + 验证码登录") | ||||
|     public CommonResult<MbrAuthLoginRespVO> smsLogin(@RequestBody @Valid MbrAuthLoginReqVO reqVO) { | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/send-sms-code") | ||||
|     @ApiOperation("发送手机验证码") | ||||
|     public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid MbrAuthSendSmsReqVO reqVO) { | ||||
| //        passportManager.sendSmsCode(sendSmsCodeDTO, HttpUtil.getIp(request)); | ||||
| //        // 返回成功 | ||||
| //        return success(true); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/reset-password") | ||||
|     @ApiOperation(value = "重置密码", notes = "用户忘记密码时使用") | ||||
|     public CommonResult<Boolean> resetPassword(@RequestBody @Valid MbrAuthResetPasswordReqVO reqVO) { | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     // ========== 社交登录相关 ========== | ||||
|  | ||||
|     @GetMapping("/social-auth-redirect") | ||||
|     @ApiOperation("社交授权的跳转") | ||||
|     @ApiImplicitParams({ | ||||
|             @ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class), | ||||
|             @ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class) | ||||
|     }) | ||||
|     public CommonResult<String> socialAuthRedirect(@RequestParam("type") Integer type, | ||||
|                                                    @RequestParam("redirectUri") String redirectUri) { | ||||
| //        return CommonResult.success(socialService.getAuthorizeUrl(type, redirectUri)); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/social-login") | ||||
|     @ApiOperation("社交登录,使用 code 授权码") | ||||
|         public CommonResult<MbrAuthLoginRespVO> socialLogin(@RequestBody @Valid MbrAuthSocialLoginReqVO reqVO) { | ||||
| //        String token = authService.socialLogin(reqVO, getClientIP(), getUserAgent()); | ||||
| //        // 返回结果 | ||||
| //        return success(MbrAuthLoginRespVO.builder().token(token).build()); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/social-login2") | ||||
|     @ApiOperation("社交登录,使用 code 授权码 + 账号密码") | ||||
|     public CommonResult<MbrAuthLoginRespVO> socialLogin2(@RequestBody @Valid MbrAuthSocialLogin2ReqVO reqVO) { | ||||
| //        String token = authService.socialLogin2(reqVO, getClientIP(), getUserAgent()); | ||||
| //        // 返回结果 | ||||
| //        return success(MbrAuthLoginRespVO.builder().token(token).build()); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/social-bind") | ||||
|     @ApiOperation("社交绑定,使用 code 授权码") | ||||
|     public CommonResult<Boolean> socialBind(@RequestBody @Valid MbrAuthSocialBindReqVO reqVO) { | ||||
| //        authService.socialBind(getLoginUserId(), reqVO); | ||||
| //        return CommonResult.success(true); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @DeleteMapping("/social-unbind") | ||||
|     @ApiOperation("取消社交绑定") | ||||
|     public CommonResult<Boolean> socialUnbind(@RequestBody MbrAuthSocialUnbindReqVO reqVO) { | ||||
| //        socialService.unbindSocialUser(getLoginUserId(), reqVO.getType(), reqVO.getUnionId()); | ||||
| //        return CommonResult.success(true); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,31 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.Mobile; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.validator.constraints.Length; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
|  | ||||
| @ApiModel("手机 + 密码登录 Request VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthLoginReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "手机号", required = true, example = "15601691300") | ||||
|     @NotEmpty(message = "手机号不能为空") | ||||
|     @Mobile | ||||
|     private String mobile; | ||||
|  | ||||
|     @ApiModelProperty(value = "密码", required = true, example = "buzhidao") | ||||
|     @NotEmpty(message = "密码不能为空") | ||||
|     @Length(min = 4, max = 16, message = "密码长度为 4-16 位") | ||||
|     private String password; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,20 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
|  | ||||
| @ApiModel("手机密码登录 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthLoginRespVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "token", required = true, example = "yudaoyuanma") | ||||
|     private String token; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,32 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.validator.constraints.Length; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.Pattern; | ||||
|  | ||||
| @ApiModel("重置密码 Request VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthResetPasswordReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "新密码", required = true, example = "buzhidao") | ||||
|     @NotEmpty(message = "新密码不能为空") | ||||
|     @Length(min = 4, max = 16, message = "密码长度为 4-16 位") | ||||
|     private String password; | ||||
|  | ||||
|     @ApiModelProperty(value = "手机验证码", required = true, example = "1024") | ||||
|     @NotEmpty(message = "手机验证码不能为空") | ||||
|     @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") | ||||
|     @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") | ||||
|     private String code; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,24 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.Mobile; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| import lombok.experimental.Accessors; | ||||
|  | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| @ApiModel("发送手机验证码 Response VO") | ||||
| @Data | ||||
| @Accessors(chain = true) | ||||
| public class MbrAuthSendSmsReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "手机号", example = "15601691234") | ||||
|     @Mobile | ||||
|     private String mobile; | ||||
|  | ||||
|     @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举") | ||||
|     @NotNull(message = "发送场景不能为空") | ||||
|     private Integer scene; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,38 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.Mobile; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.validator.constraints.Length; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.Pattern; | ||||
|  | ||||
| @ApiModel("手机 + 验证码登录 Request VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthSmsLoginReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "手机号", required = true, example = "15601691300") | ||||
|     @NotEmpty(message = "手机号不能为空") | ||||
|     @Mobile | ||||
|     private String mobile; | ||||
|  | ||||
|     @ApiModelProperty(value = "密码", required = true, example = "buzhidao") | ||||
|     @NotEmpty(message = "密码不能为空") | ||||
|     @Length(min = 4, max = 16, message = "密码长度为 4-16 位") | ||||
|     private String password; | ||||
|  | ||||
|     @ApiModelProperty(value = "手机验证码", required = true, example = "1024") | ||||
|     @NotEmpty(message = "手机验证码不能为空") | ||||
|     @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") | ||||
|     @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") | ||||
|     private String code; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,35 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| @ApiModel("社交绑定 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthSocialBindReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|     @ApiModelProperty(value = "授权码", required = true, example = "1024") | ||||
|     @NotEmpty(message = "授权码不能为空") | ||||
|     private String code; | ||||
|  | ||||
|     @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") | ||||
|     @NotEmpty(message = "state 不能为空") | ||||
|     private String state; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,48 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.validator.constraints.Length; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import javax.validation.constraints.Pattern; | ||||
|  | ||||
| @ApiModel("社交登录 Request VO,使用 code 授权码 + 账号密码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthSocialLogin2ReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|     @ApiModelProperty(value = "授权码", required = true, example = "1024") | ||||
|     @NotEmpty(message = "授权码不能为空") | ||||
|     private String code; | ||||
|  | ||||
|     @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") | ||||
|     @NotEmpty(message = "state 不能为空") | ||||
|     private String state; | ||||
|  | ||||
|     @ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma") | ||||
|     @NotEmpty(message = "登录账号不能为空") | ||||
|     @Length(min = 4, max = 16, message = "账号长度为 4-16 位") | ||||
|     @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") | ||||
|     private String username; | ||||
|  | ||||
|     @ApiModelProperty(value = "密码", required = true, example = "buzhidao") | ||||
|     @NotEmpty(message = "密码不能为空") | ||||
|     @Length(min = 4, max = 16, message = "密码长度为 4-16 位") | ||||
|     private String password; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,35 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| @ApiModel("社交登录 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthSocialLoginReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|     @ApiModelProperty(value = "授权码", required = true, example = "1024") | ||||
|     @NotEmpty(message = "授权码不能为空") | ||||
|     private String code; | ||||
|  | ||||
|     @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") | ||||
|     @NotEmpty(message = "state 不能为空") | ||||
|     private String state; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,31 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.controller.auth.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import cn.iocoder.yudao.userserver.modules.member.enums.social.SysSocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
|  | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | ||||
| @ApiModel("取消社交绑定 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class MbrAuthSocialUnbindReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|     @ApiModelProperty(value = "社交的全局编号", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") | ||||
|     @NotEmpty(message = "社交的全局编号不能为空") | ||||
|     private String unionId; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,63 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.dal.mysql.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.experimental.Accessors; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * 手机验证码 DO | ||||
|  * | ||||
|  * idx_mobile 索引:基于 {@link #mobile} 字段 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("mbr_sms_code") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @Accessors(chain = true) | ||||
| public class MbrSmsCodeDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     private Integer id; | ||||
|     /** | ||||
|      * 手机号 | ||||
|      */ | ||||
|     private String mobile; | ||||
|     /** | ||||
|      * 验证码 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 发送场景 | ||||
|      * | ||||
|      * 枚举 {@link MbrSmsCodeDO} | ||||
|      */ | ||||
|     private Integer scene; | ||||
|     /** | ||||
|      * 创建 IP | ||||
|      */ | ||||
|     private String createIp; | ||||
|     /** | ||||
|      * 今日发送的第几条 | ||||
|      */ | ||||
|     private Integer todayIndex; | ||||
|     /** | ||||
|      * 是否使用 | ||||
|      */ | ||||
|     private Boolean used; | ||||
|     /** | ||||
|      * 使用时间 | ||||
|      */ | ||||
|     private Date usedTime; | ||||
|     /** | ||||
|      * 使用 IP | ||||
|      */ | ||||
|     private String usedIp; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,70 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.dal.mysql.user; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * 会员中心的用户 DO | ||||
|  * | ||||
|  * uk_mobile 索引:基于 {@link #mobile} 字段 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName(value = "mbr_user", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class MbrUserDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 用户ID | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 用户昵称 | ||||
|      */ | ||||
|     private String nickname; | ||||
|     /** | ||||
|      * 用户头像 | ||||
|      */ | ||||
|     private String avatar; | ||||
|     /** | ||||
|      * 帐号状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|  | ||||
|     /** | ||||
|      * 手机 | ||||
|      */ | ||||
|     private String mobile; | ||||
|     /** | ||||
|      * 加密后的密码 | ||||
|      * | ||||
|      * 因为目前使用 {@link BCryptPasswordEncoder} 加密器,所以无需自己处理 salt 盐 | ||||
|      */ | ||||
|     private String password; | ||||
|     /** | ||||
|      * 注册 IP | ||||
|      */ | ||||
|     private String registerIp; | ||||
|     /** | ||||
|      * 最后登录IP | ||||
|      */ | ||||
|     private String loginIp; | ||||
|     /** | ||||
|      * 最后登录时间 | ||||
|      */ | ||||
|     private Date loginDate; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,32 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.enums.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| import java.util.Arrays; | ||||
|  | ||||
| /** | ||||
|  * 用户短信验证码发送场景的枚举 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum MbrSmsSceneEnum implements IntArrayValuable { | ||||
|  | ||||
|     LOGIN_BY_SMS(1, "手机号登陆"), | ||||
|     CHANGE_MOBILE_BY_SMS(2, "更换手机号"), | ||||
|             ; | ||||
|  | ||||
|     public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MbrSmsSceneEnum::getScene).toArray(); | ||||
|  | ||||
|     private final Integer scene; | ||||
|     private final String name; | ||||
|  | ||||
|     @Override | ||||
|     public int[] array() { | ||||
|         return ARRAYS; | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,55 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.member.enums.social; | ||||
|  | ||||
| import cn.hutool.core.collection.ListUtil; | ||||
| import cn.hutool.core.util.ArrayUtil; | ||||
| import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 社交平台的类型枚举 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysSocialTypeEnum implements IntArrayValuable { | ||||
|  | ||||
|     GITEE(10, "GITEE"), // https://gitee.com/api/v5/oauth_doc#/ | ||||
|     DINGTALK(20, "DINGTALK"), // https://developers.dingtalk.com/document/app/obtain-identity-credentials | ||||
|     WECHAT_ENTERPRISE(30, "WECHAT_ENTERPRISE"), // https://xkcoding.com/2019/08/06/use-justauth-integration-wechat-enterprise.html | ||||
|     ; | ||||
|  | ||||
|     public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SysSocialTypeEnum::getType).toArray(); | ||||
|  | ||||
|     public static final List<Integer> WECHAT_ALL = ListUtil.toList(WECHAT_ENTERPRISE.type); | ||||
|  | ||||
|     /** | ||||
|      * 类型 | ||||
|      */ | ||||
|     private final Integer type; | ||||
|     /** | ||||
|      * 类型的标识 | ||||
|      */ | ||||
|     private final String source; | ||||
|  | ||||
|     @Override | ||||
|     public int[] array() { | ||||
|         return ARRAYS; | ||||
|     } | ||||
|  | ||||
|     public static SysSocialTypeEnum valueOfType(Integer type) { | ||||
|         return ArrayUtil.firstMatch(o -> o.getType().equals(type), values()); | ||||
|     } | ||||
|  | ||||
|     public static List<Integer> getRelationTypes(Integer type) { | ||||
|         if (WECHAT_ALL.contains(type)) { | ||||
|             return WECHAT_ALL; | ||||
|         } | ||||
|         return ListUtil.toList(type); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,7 @@ | ||||
| /** | ||||
|  * member 包下,我们放会员业务. | ||||
|  * 例如说:会员中心等等 | ||||
|  * | ||||
|  * 缩写:mbr | ||||
|  */ | ||||
| package cn.iocoder.yudao.userserver.modules.member; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.system.dict; | ||||
| package cn.iocoder.yudao.userserver.modules.system.service.dict; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; | ||||
| 
 | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.system.dict.impl; | ||||
| package cn.iocoder.yudao.userserver.modules.system.service.dict.impl; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; | ||||
| @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.userserver.modules.system.convert.dict.SysDictDataConvert; | ||||
| import cn.iocoder.yudao.userserver.modules.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.userserver.modules.system.dal.mysql.dict.SysDictDataMapper; | ||||
| import cn.iocoder.yudao.userserver.modules.system.dict.SysDictDataService; | ||||
| import cn.iocoder.yudao.userserver.modules.system.service.dict.SysDictDataService; | ||||
| import com.google.common.collect.ImmutableTable; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.scheduling.annotation.Scheduled; | ||||
| @@ -0,0 +1 @@ | ||||
| package cn.iocoder.yudao.userserver.modules.system.service; | ||||
		Reference in New Issue
	
	Block a user
	 wangwenbin10
					wangwenbin10