fix: 修复LinkTaskMapper中target_score列不存在的SQL错误
- 移除LinkTaskMapper.xml中所有对不存在的target_score列的引用 - 修复因SQL查询不存在列导致的BadSqlGrammarException - 添加TargetScoreResponse DTO用于目标点数响应 - 更新LinkController添加获取目标点数接口 - 优化UserLinkStatusResponse添加machineId字段 - 更新数据库schema文档 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
package com.gameplatform.server.model.dto.link;
|
||||
|
||||
/**
|
||||
* 目标点数响应DTO
|
||||
*/
|
||||
public class TargetScoreResponse {
|
||||
|
||||
/**
|
||||
* 是否成功获取目标点数
|
||||
*/
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 完成点数值(当success为true时有效)
|
||||
*/
|
||||
private Integer completedPoints;
|
||||
|
||||
/**
|
||||
* 错误消息(当success为false时)
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private String machineId;
|
||||
|
||||
/**
|
||||
* 链接编号
|
||||
*/
|
||||
private String codeNo;
|
||||
|
||||
public TargetScoreResponse() {
|
||||
}
|
||||
|
||||
public TargetScoreResponse(boolean success, Integer completedPoints, String errorMessage) {
|
||||
this.success = success;
|
||||
this.completedPoints = completedPoints;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功响应
|
||||
*/
|
||||
public static TargetScoreResponse success(String codeNo, String machineId, Integer completedPoints) {
|
||||
TargetScoreResponse response = new TargetScoreResponse();
|
||||
response.setSuccess(true);
|
||||
response.setCodeNo(codeNo);
|
||||
response.setMachineId(machineId);
|
||||
response.setCompletedPoints(completedPoints);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败响应
|
||||
*/
|
||||
public static TargetScoreResponse error(String codeNo, String machineId, String errorMessage) {
|
||||
TargetScoreResponse response = new TargetScoreResponse();
|
||||
response.setSuccess(false);
|
||||
response.setCodeNo(codeNo);
|
||||
response.setMachineId(machineId);
|
||||
response.setErrorMessage(errorMessage);
|
||||
return response;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public Integer getCompletedPoints() {
|
||||
return completedPoints;
|
||||
}
|
||||
|
||||
public void setCompletedPoints(Integer completedPoints) {
|
||||
this.completedPoints = completedPoints;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public String getMachineId() {
|
||||
return machineId;
|
||||
}
|
||||
|
||||
public void setMachineId(String machineId) {
|
||||
this.machineId = machineId;
|
||||
}
|
||||
|
||||
public String getCodeNo() {
|
||||
return codeNo;
|
||||
}
|
||||
|
||||
public void setCodeNo(String codeNo) {
|
||||
this.codeNo = codeNo;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,13 @@ public class UserLinkStatusResponse {
|
||||
@Schema(description = "链接状态", example = "NEW", allowableValues = {"NEW", "USING", "LOGGED_IN", "COMPLETED", "REFUNDED", "EXPIRED"})
|
||||
private String status;
|
||||
|
||||
@Schema(description = "机器ID")
|
||||
private String machineId;
|
||||
|
||||
// Getter and Setter
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getMachineId() { return machineId; }
|
||||
public void setMachineId(String machineId) { this.machineId = machineId; }
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ public class LinkTask {
|
||||
|
||||
@TableField("completion_images")
|
||||
private String completionImages; // JSON格式存储4张图片URL
|
||||
|
||||
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
@@ -130,4 +132,6 @@ public class LinkTask {
|
||||
|
||||
public String getCompletionImages() { return completionImages; }
|
||||
public void setCompletionImages(String completionImages) { this.completionImages = completionImages; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user