feat: 在QrProxyController中添加自定义扫码内容的设置,更新GameInterfaceResponse以支持该内容,增强用户体验

This commit is contained in:
zyh
2025-10-03 11:08:19 +08:00
parent 29742cb732
commit 4c4782b57f
3 changed files with 18 additions and 0 deletions

View File

@@ -274,6 +274,8 @@ public class QrProxyController {
response.setEndRewardUrl(appBaseUrl + "/api/link/image/" + codeNo + "/end-reward.png"); response.setEndRewardUrl(appBaseUrl + "/api/link/image/" + codeNo + "/end-reward.png");
// 设置用户进度显示格式(从系统配置读取) // 设置用户进度显示格式(从系统配置读取)
response.setProgressDisplayFormat(systemConfigService.getProgressDisplayFormat()); response.setProgressDisplayFormat(systemConfigService.getProgressDisplayFormat());
// 设置自定义扫码内容(从系统配置读取)
response.setCustomScanContent(systemConfigService.getCustomScanContent());
log.info("游戏界面数据构建完成: codeNo={}, totalPoints={}", codeNo, response.getTotalPoints()); log.info("游戏界面数据构建完成: codeNo={}, totalPoints={}", codeNo, response.getTotalPoints());

View File

@@ -50,6 +50,9 @@ public class GameInterfaceResponse {
@Schema(description = "用户端进度显示格式percent 或 ratio", example = "percent") @Schema(description = "用户端进度显示格式percent 或 ratio", example = "percent")
private String progressDisplayFormat; private String progressDisplayFormat;
@Schema(description = "自定义扫码界面内容")
private String customScanContent;
public String getProgressDisplayFormat() { public String getProgressDisplayFormat() {
return progressDisplayFormat; return progressDisplayFormat;
} }
@@ -58,6 +61,14 @@ public class GameInterfaceResponse {
this.progressDisplayFormat = progressDisplayFormat; this.progressDisplayFormat = progressDisplayFormat;
} }
public String getCustomScanContent() {
return customScanContent;
}
public void setCustomScanContent(String customScanContent) {
this.customScanContent = customScanContent;
}
public String getCodeNo() { public String getCodeNo() {
return codeNo; return codeNo;
} }

View File

@@ -123,6 +123,11 @@ public class SystemConfigService {
return getConfigValue("user.progress_display_format", "percent"); return getConfigValue("user.progress_display_format", "percent");
} }
// 获取用户端自定义扫码内容
public String getCustomScanContent() {
return getConfigValue("user.custom_scan_content", "");
}
// 批量更新配置 // 批量更新配置
public boolean updateConfigs(List<SystemConfig> configs) { public boolean updateConfigs(List<SystemConfig> configs) {
if (configs == null || configs.isEmpty()) { if (configs == null || configs.isEmpty()) {