From 40f02f4539174f95e5226139a9305ab728677d94 Mon Sep 17 00:00:00 2001 From: yahaozhang Date: Mon, 15 Sep 2025 15:10:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E4=BB=A3=E7=90=86=E6=8E=A7=E5=88=B6=E5=99=A8=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E8=BF=9B=E5=BA=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=BC=E5=BC=8F=E7=9A=84=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=AF=BB=E5=8F=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/controller/link/QrProxyController.java | 8 +++++++- .../server/model/dto/link/GameInterfaceResponse.java | 11 ++++++++++- .../server/service/admin/SystemConfigService.java | 5 +++++ 3 files changed, 22 insertions(+), 2 deletions(-) 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()) {