对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; |
| | | import com.iailab.module.system.api.sms.dto.code.SmsCodeSendReqDTO; |
| | | import com.iailab.module.system.api.sms.dto.code.SmsCodeUseReqDTO; |
| | | import com.iailab.module.system.enums.ApiConstants; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @FeignClient(name = ApiConstants.NAME) |
| | | @Tag(name = "RPC 服务 - 短信验证码") |
| | | public interface SmsCodeApi { |
| | | |
| | | String PREFIX = ApiConstants.PREFIX + "/oauth2/sms/code"; |
| | | |
| | | @PostMapping(PREFIX + "/send") |
| | | @Operation(summary = "创建短信验证码,并进行发送") |
| | | CommonResult<Boolean> sendSmsCode(@Valid @RequestBody SmsCodeSendReqDTO reqDTO); |
| | | |
| | | @PutMapping(PREFIX + "/use") |
| | | @Operation(summary = "验证短信验证码,并进行使用") |
| | | CommonResult<Boolean> useSmsCode(@Valid @RequestBody SmsCodeUseReqDTO reqDTO); |
| | | |
| | | @GetMapping(PREFIX + "/validate") |
| | | @Operation(summary = "检查验证码是否有效") |
| | | CommonResult<Boolean> validateSmsCode(@Valid @RequestBody SmsCodeValidateReqDTO reqDTO); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO; |
| | | import com.iailab.module.system.enums.ApiConstants; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @FeignClient(name = ApiConstants.NAME) |
| | | @Tag(name = "RPC 服务 - 短信发送") |
| | | public interface SmsSendApi { |
| | | |
| | | String PREFIX = ApiConstants.PREFIX + "/sms/send"; |
| | | |
| | | @PostMapping(PREFIX + "/send-single-admin") |
| | | @Operation(summary = "发送单条短信给 Admin 用户", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号") |
| | | CommonResult<Long> sendSingleSmsToAdmin(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO); |
| | | |
| | | @PostMapping(PREFIX + "/send-single-member") |
| | | @Operation(summary = "发送单条短信给 Member 用户", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号") |
| | | CommonResult<Long> sendSingleSmsToMember(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms.dto.code; |
| | | |
| | | import com.iailab.framework.common.validation.InEnum; |
| | | import com.iailab.framework.common.validation.Mobile; |
| | | import com.iailab.module.system.enums.sms.SmsSceneEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Schema(description = "RPC 服务 - 短信验证码的发送 Request DTO") |
| | | @Data |
| | | public class SmsCodeSendReqDTO { |
| | | |
| | | @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") |
| | | @Mobile |
| | | @NotEmpty(message = "手机号不能为空") |
| | | private String mobile; |
| | | |
| | | @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "发送场景不能为空") |
| | | @InEnum(SmsSceneEnum.class) |
| | | |
| | | private Integer scene; |
| | | @Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40") |
| | | @NotEmpty(message = "发送 IP 不能为空") |
| | | private String createIp; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms.dto.code; |
| | | |
| | | import com.iailab.framework.common.validation.InEnum; |
| | | import com.iailab.framework.common.validation.Mobile; |
| | | import com.iailab.module.system.enums.sms.SmsSceneEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Schema(description = "RPC 服务 - 短信验证码的使用 Request DTO") |
| | | @Data |
| | | public class SmsCodeUseReqDTO { |
| | | |
| | | @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") |
| | | @Mobile |
| | | @NotEmpty(message = "手机号不能为空") |
| | | private String mobile; |
| | | |
| | | @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "发送场景不能为空") |
| | | @InEnum(SmsSceneEnum.class) |
| | | private Integer scene; |
| | | |
| | | @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @NotEmpty(message = "验证码") |
| | | private String code; |
| | | |
| | | @Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40") |
| | | @NotEmpty(message = "使用 IP 不能为空") |
| | | private String usedIp; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms.dto.code; |
| | | |
| | | import com.iailab.framework.common.validation.InEnum; |
| | | import com.iailab.framework.common.validation.Mobile; |
| | | import com.iailab.module.system.enums.sms.SmsSceneEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Schema(description = "RPC 服务 - 短信验证码的校验 Request DTO") |
| | | @Data |
| | | public class SmsCodeValidateReqDTO { |
| | | |
| | | @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") |
| | | @Mobile |
| | | @NotEmpty(message = "手机号不能为空") |
| | | private String mobile; |
| | | |
| | | @Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "发送场景不能为空") |
| | | @InEnum(SmsSceneEnum.class) |
| | | private Integer scene; |
| | | |
| | | @Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @NotEmpty(message = "验证码") |
| | | private String code; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.system.api.sms.dto.send; |
| | | |
| | | import com.iailab.framework.common.validation.Mobile; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.Map; |
| | | |
| | | @Schema(description = "RPC 服务 - 短信发送给 Admin 或者 Member 用户 Request DTO") |
| | | @Data |
| | | public class SmsSendSingleToUserReqDTO { |
| | | |
| | | @Schema(description = "用户编号", example = "1024") |
| | | private Long userId; |
| | | @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300") |
| | | @Mobile |
| | | private String mobile; |
| | | |
| | | @Schema(description = "短信模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND") |
| | | @NotEmpty(message = "短信模板编号不能为空") |
| | | private String templateCode; |
| | | @Schema(description = "短信模板参数") |
| | | private Map<String, Object> templateParams; |
| | | |
| | | } |
| | |
| | | * 所属岗位数组 |
| | | */ |
| | | private List<PostSimpleRespVO> posts; |
| | | /** |
| | | * 社交用户数组 |
| | | */ |
| | | private List<SocialUser> socialUsers; |
| | | |
| | | @Schema(description = "社交用户") |
| | | @Data |
| | | public static class SocialUser { |
| | | |
| | | @Schema(description = "社交平台的类型,参见 SocialTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| | | private Integer type; |
| | | |
| | | @Schema(description = "社交用户的 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") |
| | | private String openid; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.system.api.social.dto.SocialUserBindReqDTO; |
| | | import com.iailab.module.system.controller.admin.auth.vo.*; |
| | | import com.iailab.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; |
| | | import com.iailab.module.system.dal.dataobject.permission.MenuDO; |
| | |
| | | } |
| | | return menuVOS; |
| | | } |
| | | |
| | | SocialUserBindReqDTO convert(Long userId, Integer userType, AuthSocialLoginReqVO reqVO); |
| | | |
| | | } |
| | |
| | | import com.iailab.module.infra.api.config.ConfigApi; |
| | | import com.iailab.module.infra.api.db.DataSourceConfigServiceApi; |
| | | import com.iailab.module.infra.api.file.FileApi; |
| | | import com.iailab.module.infra.api.monitor.MonitorApi; |
| | | import com.iailab.module.infra.api.websocket.WebSocketSenderApi; |
| | | import com.iailab.module.system.api.tenant.TenantApi; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration(proxyBeanMethods = false) |
| | | @EnableFeignClients(clients = {FileApi.class, MonitorApi.class, WebSocketSenderApi.class, DataSourceConfigServiceApi.class, ConfigApi.class, TenantApi.class}) |
| | | @EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, DataSourceConfigServiceApi.class, ConfigApi.class, TenantApi.class}) |
| | | public class RpcConfiguration { |
| | | } |