Browse Source

IrsSealPlatformProperties.java

master
niohe·erbao 1 year ago
parent
commit
381e988667
3 changed files with 53 additions and 3 deletions
  1. +51
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/irs/config/IrsSealPlatformProperties.java
  2. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sms/model/po/ReqVerificationCodePO.java

+ 51
- 0
pmapi/src/main/java/com/ningdatech/pmapi/irs/config/IrsSealPlatformProperties.java View File

@@ -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;
}

}

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java View File

@@ -85,7 +85,6 @@ public class SmsManage {
if (Objects.nonNull(cachePlusOps.get(limitKey))) {
Integer limitCount = cachePlusOps.get(limitKey);
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()) {
cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), request.getMobile());


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sms/model/po/ReqVerificationCodePO.java View File

@@ -19,8 +19,8 @@ public class ReqVerificationCodePO implements Serializable {
@NotBlank(message = "手机号不能为空")
private String mobile;

@ApiModelProperty(value = "短信类型", allowableValues = "LOGIN,RECOMMENDATION_PROOF_FILE_SUBMIT")
@ApiModelProperty(value = "短信类型", allowableValues = "LOGIN")
@NotBlank(message = "短信类型不能为空")
private String verificationType;

}
}

Loading…
Cancel
Save