@@ -0,0 +1,51 @@ | |||||
package com.ningdatech.pmapi.irs.config; | |||||
import lombok.Data; | |||||
import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.stereotype.Component; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2023/3/16 下午6:03 | |||||
*/ | |||||
@Component | |||||
@Data | |||||
public class IrsSealPlatformProperties { | |||||
public static String projectId; | |||||
public static String projectSecret; | |||||
public static String accessKey; | |||||
public static String secretKey; | |||||
public static String apiUrl; | |||||
@Value("${irs.seal-platform.project-id}") | |||||
public void setProjectId(String projectId) { | |||||
IrsSealPlatformProperties.projectId = projectId; | |||||
} | |||||
@Value("${irs.seal-platform.project-secret}") | |||||
public void setProjectSecret(String projectSecret) { | |||||
IrsSealPlatformProperties.projectSecret = projectSecret; | |||||
} | |||||
@Value("${irs.seal-platform.access-key}") | |||||
public void setAccessKey(String accessKey) { | |||||
IrsSealPlatformProperties.accessKey = accessKey; | |||||
} | |||||
@Value("${irs.seal-platform.secret-key}") | |||||
public void setSecretKey(String secretKey) { | |||||
IrsSealPlatformProperties.secretKey = secretKey; | |||||
} | |||||
@Value("${irs.seal-platform.api-url}") | |||||
public void setApiUrl(String apiUrl) { | |||||
IrsSealPlatformProperties.apiUrl = apiUrl; | |||||
} | |||||
} |
@@ -85,7 +85,6 @@ public class SmsManage { | |||||
if (Objects.nonNull(cachePlusOps.get(limitKey))) { | if (Objects.nonNull(cachePlusOps.get(limitKey))) { | ||||
Integer limitCount = cachePlusOps.get(limitKey); | Integer limitCount = cachePlusOps.get(limitKey); | ||||
cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), limitCount++); | cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), limitCount++); | ||||
// long limitCount = cachePlusOps.incr(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon()))); | |||||
// 超出单日发送次数之后直接锁定 | // 超出单日发送次数之后直接锁定 | ||||
if (limitCount >= verificationCodeTypeEnum.getSendTimesByDay().longValue()) { | if (limitCount >= verificationCodeTypeEnum.getSendTimesByDay().longValue()) { | ||||
cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), request.getMobile()); | cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), request.getMobile()); | ||||
@@ -19,8 +19,8 @@ public class ReqVerificationCodePO implements Serializable { | |||||
@NotBlank(message = "手机号不能为空") | @NotBlank(message = "手机号不能为空") | ||||
private String mobile; | private String mobile; | ||||
@ApiModelProperty(value = "短信类型", allowableValues = "LOGIN,RECOMMENDATION_PROOF_FILE_SUBMIT") | |||||
@ApiModelProperty(value = "短信类型", allowableValues = "LOGIN") | |||||
@NotBlank(message = "短信类型不能为空") | @NotBlank(message = "短信类型不能为空") | ||||
private String verificationType; | private String verificationType; | ||||
} | |||||
} |