feat: 增强二维码和图片代理功能
主要修改: 1. 在QrProxyController中新增多个图片代理接口,包括首页、首次赏金、中途赏金和结束赏金图片的获取。 2. 更新LinkController中的链接状态查询逻辑,简化日志输出。 3. 在LinkStatusService中优化链接状态处理逻辑,增加对USING状态的过期检查。 4. 在ScriptClient中新增通用图片获取方法,支持从脚本端获取图片数据。 5. 更新SecurityConfig,允许公开访问二维码和游戏界面数据接口。 技术细节: - 新增GameInterfaceResponse DTO以支持游戏界面数据的返回格式。 - 通过脚本端接口实现图片的动态获取和链接状态的自动刷新。
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
package com.gameplatform.server.model.dto.link;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 游戏界面数据响应
|
||||
*/
|
||||
@Schema(description = "游戏界面数据")
|
||||
public class GameInterfaceResponse {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private String codeNo;
|
||||
|
||||
@Schema(description = "总点数 (quantity * times)")
|
||||
private Integer totalPoints;
|
||||
|
||||
@Schema(description = "每次副本奖励点数")
|
||||
private Integer quantity;
|
||||
|
||||
@Schema(description = "副本次数")
|
||||
private Integer times;
|
||||
|
||||
@Schema(description = "游戏区域", example = "Q表示QQ区,V表示微信区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "游戏区域描述", example = "QQ区")
|
||||
private String regionDesc;
|
||||
|
||||
@Schema(description = "二维码图片链接")
|
||||
private String qrCodeUrl;
|
||||
|
||||
@Schema(description = "首次主页图片链接")
|
||||
private String homepageUrl;
|
||||
|
||||
@Schema(description = "首次赏金图片链接")
|
||||
private String firstRewardUrl;
|
||||
|
||||
@Schema(description = "中途赏金图片链接")
|
||||
private String midRewardUrl;
|
||||
|
||||
@Schema(description = "结束赏金图片链接")
|
||||
private String endRewardUrl;
|
||||
|
||||
public String getCodeNo() {
|
||||
return codeNo;
|
||||
}
|
||||
|
||||
public void setCodeNo(String codeNo) {
|
||||
this.codeNo = codeNo;
|
||||
}
|
||||
|
||||
public Integer getTotalPoints() {
|
||||
return totalPoints;
|
||||
}
|
||||
|
||||
public void setTotalPoints(Integer totalPoints) {
|
||||
this.totalPoints = totalPoints;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Integer getTimes() {
|
||||
return times;
|
||||
}
|
||||
|
||||
public void setTimes(Integer times) {
|
||||
this.times = times;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getRegionDesc() {
|
||||
return regionDesc;
|
||||
}
|
||||
|
||||
public void setRegionDesc(String regionDesc) {
|
||||
this.regionDesc = regionDesc;
|
||||
}
|
||||
|
||||
public String getQrCodeUrl() {
|
||||
return qrCodeUrl;
|
||||
}
|
||||
|
||||
public void setQrCodeUrl(String qrCodeUrl) {
|
||||
this.qrCodeUrl = qrCodeUrl;
|
||||
}
|
||||
|
||||
public String getHomepageUrl() {
|
||||
return homepageUrl;
|
||||
}
|
||||
|
||||
public void setHomepageUrl(String homepageUrl) {
|
||||
this.homepageUrl = homepageUrl;
|
||||
}
|
||||
|
||||
public String getFirstRewardUrl() {
|
||||
return firstRewardUrl;
|
||||
}
|
||||
|
||||
public void setFirstRewardUrl(String firstRewardUrl) {
|
||||
this.firstRewardUrl = firstRewardUrl;
|
||||
}
|
||||
|
||||
public String getMidRewardUrl() {
|
||||
return midRewardUrl;
|
||||
}
|
||||
|
||||
public void setMidRewardUrl(String midRewardUrl) {
|
||||
this.midRewardUrl = midRewardUrl;
|
||||
}
|
||||
|
||||
public String getEndRewardUrl() {
|
||||
return endRewardUrl;
|
||||
}
|
||||
|
||||
public void setEndRewardUrl(String endRewardUrl) {
|
||||
this.endRewardUrl = endRewardUrl;
|
||||
}
|
||||
}
|
||||
@@ -8,91 +8,7 @@ public class UserLinkStatusResponse {
|
||||
@Schema(description = "链接状态", example = "NEW", allowableValues = {"NEW", "USING", "LOGGED_IN", "REFUNDED", "EXPIRED"})
|
||||
private String status;
|
||||
|
||||
@Schema(description = "是否需要刷新", example = "false")
|
||||
private Boolean needRefresh;
|
||||
|
||||
@Schema(description = "选择的区域", example = "Q", allowableValues = {"Q", "V"})
|
||||
private String region;
|
||||
|
||||
@Schema(description = "二维码信息")
|
||||
private QrInfo qr;
|
||||
|
||||
@Schema(description = "视图类型", example = "FIRST", allowableValues = {"FIRST", "SCAN", "SECOND"})
|
||||
private String view;
|
||||
|
||||
@Schema(description = "静态资源信息")
|
||||
private AssetsInfo assets;
|
||||
|
||||
@Schema(description = "二维码信息")
|
||||
public static class QrInfo {
|
||||
@Schema(description = "二维码URL", example = "http://36.138.184.60:12345/{编号}/二维码.png")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "创建时间戳", example = "1730000000000")
|
||||
private Long createdAt;
|
||||
|
||||
@Schema(description = "过期时间戳", example = "1730000060000")
|
||||
private Long expireAt;
|
||||
|
||||
public String getUrl() { return url; }
|
||||
public void setUrl(String url) { this.url = url; }
|
||||
|
||||
public Long getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Long createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public Long getExpireAt() { return expireAt; }
|
||||
public void setExpireAt(Long expireAt) { this.expireAt = expireAt; }
|
||||
}
|
||||
|
||||
@Schema(description = "静态资源信息")
|
||||
public static class AssetsInfo {
|
||||
@Schema(description = "基础URL", example = "http://36.138.184.60:12345/{编号}/")
|
||||
private String base;
|
||||
|
||||
@Schema(description = "首次主页图片", example = "首次主页.png")
|
||||
private String firstHome;
|
||||
|
||||
@Schema(description = "首次赏金图片", example = "首次赏金.png")
|
||||
private String firstBonus;
|
||||
|
||||
@Schema(description = "中途赏金图片", example = "中途赏金.png")
|
||||
private String midBonus;
|
||||
|
||||
@Schema(description = "结束赏金图片", example = "结束赏金.png")
|
||||
private String endBonus;
|
||||
|
||||
public String getBase() { return base; }
|
||||
public void setBase(String base) { this.base = base; }
|
||||
|
||||
public String getFirstHome() { return firstHome; }
|
||||
public void setFirstHome(String firstHome) { this.firstHome = firstHome; }
|
||||
|
||||
public String getFirstBonus() { return firstBonus; }
|
||||
public void setFirstBonus(String firstBonus) { this.firstBonus = firstBonus; }
|
||||
|
||||
public String getMidBonus() { return midBonus; }
|
||||
public void setMidBonus(String midBonus) { this.midBonus = midBonus; }
|
||||
|
||||
public String getEndBonus() { return endBonus; }
|
||||
public void setEndBonus(String endBonus) { this.endBonus = endBonus; }
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
// Getter and Setter
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public Boolean getNeedRefresh() { return needRefresh; }
|
||||
public void setNeedRefresh(Boolean needRefresh) { this.needRefresh = needRefresh; }
|
||||
|
||||
public String getRegion() { return region; }
|
||||
public void setRegion(String region) { this.region = region; }
|
||||
|
||||
public QrInfo getQr() { return qr; }
|
||||
public void setQr(QrInfo qr) { this.qr = qr; }
|
||||
|
||||
public String getView() { return view; }
|
||||
public void setView(String view) { this.view = view; }
|
||||
|
||||
public AssetsInfo getAssets() { return assets; }
|
||||
public void setAssets(AssetsInfo assets) { this.assets = assets; }
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@ public class LinkTask {
|
||||
|
||||
@TableField("qr_expire_at")
|
||||
private LocalDateTime qrExpireAt;
|
||||
|
||||
@TableField("first_region_select_at")
|
||||
private LocalDateTime firstRegionSelectAt;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
@@ -112,4 +115,7 @@ public class LinkTask {
|
||||
|
||||
public LocalDateTime getQrExpireAt() { return qrExpireAt; }
|
||||
public void setQrExpireAt(LocalDateTime qrExpireAt) { this.qrExpireAt = qrExpireAt; }
|
||||
|
||||
public LocalDateTime getFirstRegionSelectAt() { return firstRegionSelectAt; }
|
||||
public void setFirstRegionSelectAt(LocalDateTime firstRegionSelectAt) { this.firstRegionSelectAt = firstRegionSelectAt; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user