Commit 7f83165e by renyizhao

1.充值接口金额校验

2.API套餐次数被用作有效天数
parent b67bf3a2
......@@ -475,7 +475,7 @@ public class ApiOrderServiceImpl implements ApiOrderService {
.setUsedTimes(0)
.setPackageValidDays(order.getPackageValidDays())
.setUserId(order.getUserId())
.setExpireTime(DateUtil.offsetDay(new Date(), order.getPackageTimes()).toLocalDateTime())
.setExpireTime(DateUtil.offsetDay(new Date(), order.getPackageValidDays()).toLocalDateTime())
.setPackagePrice(order.getPackagePrice())
);
});
......
......@@ -4,6 +4,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Schema(description = "APP端 - 充值请求 VO")
......@@ -12,6 +16,10 @@ import java.math.BigDecimal;
public class MemberRechargeCreateReqVO {
@Schema(description = "充值金额(元)", required = true, example = "100.00")
@NotNull(message = "充值金额不能为空")
@DecimalMin(value = "0.01", message = "充值金额必须大于0.01元")
@DecimalMax(value = "1000000", message = "充值金额不能超过100万元")
@Digits(integer = 8, fraction = 2, message = "充值金额整数部分最多8位,小数部分最多2位")
private BigDecimal amount;
}
}
\ No newline at end of file
......@@ -39,14 +39,14 @@
<properties>
<revision>2.6.0-jdk8-SNAPSHOT</revision>
<!-- Maven 相关 -->
<java.version>1.8</java.version>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
<!-- maven-surefire-plugin 暂时无法通过 bom 的依赖读取(兼容老版本 IDEA 2024 及以前版本) -->
<lombok.version>1.18.30</lombok.version>
<lombok.version>1.18.34</lombok.version>
<spring.boot.version>2.7.18</spring.boot.version>
<mapstruct.version>1.6.3</mapstruct.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -115,6 +115,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
</plugins>
</pluginManagement>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment