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;
    }
}
