feat: 在链接生成请求中更新描述,添加链接倍数配置获取方法,并在链接生成服务中应用倍数计算,优化积分需求逻辑
This commit is contained in:
BIN
logs/audit-status.2025-10-05.0.log.gz
Normal file
BIN
logs/audit-status.2025-10-05.0.log.gz
Normal file
Binary file not shown.
BIN
logs/server.2025-10-05.0.log.gz
Normal file
BIN
logs/server.2025-10-05.0.log.gz
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@ package com.gameplatform.server.model.dto.link;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
public class LinkGenerateRequest {
|
public class LinkGenerateRequest {
|
||||||
@Schema(description = "本次打脚本的次数", example = "10")
|
@Schema(description = "本次打脚本的次数(实际使用times*link.scaled作为真实次数)", example = "10")
|
||||||
private Integer times;
|
private Integer times;
|
||||||
@Schema(description = "生成多少个链接", example = "5")
|
@Schema(description = "生成多少个链接", example = "5")
|
||||||
private Integer linkCount = 1; // 默认值为1
|
private Integer linkCount = 1; // 默认值为1
|
||||||
|
|||||||
@@ -152,6 +152,11 @@ public class SystemConfigService {
|
|||||||
return getConfigValueAsInt("link.qr_expire_time", 600);
|
return getConfigValueAsInt("link.qr_expire_time", 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取链接倍数配置
|
||||||
|
public Integer getLinkScaled() {
|
||||||
|
return getConfigValueAsInt("link.scaled", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,12 +71,16 @@ public class LinkGenerationService {
|
|||||||
|
|
||||||
// 从配置表获取每次副本的奖励点数
|
// 从配置表获取每次副本的奖励点数
|
||||||
int perTimeQuantity = systemConfigService.getDefaultQuantity();
|
int perTimeQuantity = systemConfigService.getDefaultQuantity();
|
||||||
long needPoints = (long) times; // 只扣times,不乘以perTimeQuantity
|
// 获取链接倍数配置
|
||||||
|
int linkScaled = systemConfigService.getLinkScaled();
|
||||||
|
// 计算真实的times = times * link.scaled
|
||||||
|
int realTimes = times * linkScaled;
|
||||||
|
long needPoints = (long) realTimes; // 使用真实的times计算需要的积分
|
||||||
// 移除expireHours配置,因为NEW状态不设置过期时间
|
// 移除expireHours配置,因为NEW状态不设置过期时间
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("generateLinks operatorId={} operatorType={} times={} linkCount={} perTimeQuantity={} needPoints={}",
|
log.debug("generateLinks operatorId={} operatorType={} times={} linkScaled={} realTimes={} linkCount={} perTimeQuantity={} needPoints={}",
|
||||||
operatorId, operatorType, times, linkCount, perTimeQuantity, needPoints);
|
operatorId, operatorType, times, linkScaled, realTimes, linkCount, perTimeQuantity, needPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isAdminOperator) {
|
if (!isAdminOperator) {
|
||||||
@@ -90,7 +94,7 @@ public class LinkGenerationService {
|
|||||||
LinkBatch batch = new LinkBatch();
|
LinkBatch batch = new LinkBatch();
|
||||||
batch.setAgentId(operator.getId());
|
batch.setAgentId(operator.getId());
|
||||||
batch.setQuantity(perTimeQuantity); // 每次副本的奖励点数
|
batch.setQuantity(perTimeQuantity); // 每次副本的奖励点数
|
||||||
batch.setTimes(times); // 打副本的次数
|
batch.setTimes(realTimes); // 打副本的次数(应用倍数后的真实次数)
|
||||||
batch.setOperatorId(operatorId);
|
batch.setOperatorId(operatorId);
|
||||||
linkBatchMapper.insert(batch);
|
linkBatchMapper.insert(batch);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user