浏览代码

IrsSealPlatformProperties.java

tags/24080901
niohe·erbao 1年前
父节点
当前提交
381e988667
共有 3 个文件被更改,包括 53 次插入3 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

}
}

正在加载...
取消
保存