diff --git a/src/main/java/com/gameplatform/server/controller/link/QrProxyController.java b/src/main/java/com/gameplatform/server/controller/link/QrProxyController.java index bfcedc2..f8657a2 100644 --- a/src/main/java/com/gameplatform/server/controller/link/QrProxyController.java +++ b/src/main/java/com/gameplatform/server/controller/link/QrProxyController.java @@ -7,6 +7,7 @@ import com.gameplatform.server.model.dto.link.GameInterfaceResponse; import com.gameplatform.server.model.entity.agent.LinkBatch; import com.gameplatform.server.model.entity.agent.LinkTask; import com.gameplatform.server.service.external.ScriptClient; +import com.gameplatform.server.service.admin.SystemConfigService; import com.gameplatform.server.service.link.LinkStatusService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -39,17 +40,20 @@ public class QrProxyController { private final String appBaseUrl; private final LinkTaskMapper linkTaskMapper; private final LinkBatchMapper linkBatchMapper; + private final SystemConfigService systemConfigService; public QrProxyController(ScriptClient scriptClient, LinkStatusService linkStatusService, @Value("${app.base-url}") String appBaseUrl, LinkTaskMapper linkTaskMapper, - LinkBatchMapper linkBatchMapper) { + LinkBatchMapper linkBatchMapper, + SystemConfigService systemConfigService) { this.scriptClient = scriptClient; this.linkStatusService = linkStatusService; this.appBaseUrl = appBaseUrl; this.linkTaskMapper = linkTaskMapper; this.linkBatchMapper = linkBatchMapper; + this.systemConfigService = systemConfigService; } @GetMapping(value = "/image/{codeNo}/qr.png", produces = MediaType.IMAGE_PNG_VALUE) @@ -268,6 +272,8 @@ public class QrProxyController { response.setFirstRewardUrl(appBaseUrl + "/api/link/image/" + codeNo + "/first-reward.png"); response.setMidRewardUrl(appBaseUrl + "/api/link/image/" + codeNo + "/mid-reward.png"); response.setEndRewardUrl(appBaseUrl + "/api/link/image/" + codeNo + "/end-reward.png"); + // 设置用户进度显示格式(从系统配置读取) + response.setProgressDisplayFormat(systemConfigService.getProgressDisplayFormat()); log.info("游戏界面数据构建完成: codeNo={}, totalPoints={}", codeNo, response.getTotalPoints()); diff --git a/src/main/java/com/gameplatform/server/model/dto/link/GameInterfaceResponse.java b/src/main/java/com/gameplatform/server/model/dto/link/GameInterfaceResponse.java index 2e90f32..5a2a34e 100644 --- a/src/main/java/com/gameplatform/server/model/dto/link/GameInterfaceResponse.java +++ b/src/main/java/com/gameplatform/server/model/dto/link/GameInterfaceResponse.java @@ -47,7 +47,16 @@ public class GameInterfaceResponse { @Schema(description = "已经完成的点数") private Integer completedPoints; - @Schema(description = "操作是否成功", example = "true") + @Schema(description = "用户端进度显示格式:percent 或 ratio", example = "percent") + private String progressDisplayFormat; + + public String getProgressDisplayFormat() { + return progressDisplayFormat; + } + + public void setProgressDisplayFormat(String progressDisplayFormat) { + this.progressDisplayFormat = progressDisplayFormat; + } public String getCodeNo() { return codeNo; diff --git a/src/main/java/com/gameplatform/server/service/admin/SystemConfigService.java b/src/main/java/com/gameplatform/server/service/admin/SystemConfigService.java index e0c86e5..ce5bf0c 100644 --- a/src/main/java/com/gameplatform/server/service/admin/SystemConfigService.java +++ b/src/main/java/com/gameplatform/server/service/admin/SystemConfigService.java @@ -118,6 +118,11 @@ public class SystemConfigService { return getConfigValueAsInt("link.first_region_expire", 600); } + // 获取用户进度显示格式(percent 或 ratio) + public String getProgressDisplayFormat() { + return getConfigValue("user.progress_display_format", "percent"); + } + // 批量更新配置 public boolean updateConfigs(List configs) { if (configs == null || configs.isEmpty()) {