package com.table.transfer.module.enpty;

import lombok.Data;

@Data
public class TransferResponse {
    private boolean success;
    private String message;
    /**
     * 请求方自己携带的用于区分的id
     */
    private String requestId;
    /**
     * 转账服务用来查询的id
     */
    private String responseId;
    private String transactionHash;
    
    public static TransferResponse success(String transactionHash) {
        TransferResponse response = new TransferResponse();
        response.setSuccess(true);
        response.setMessage("转账成功");
        response.setTransactionHash(transactionHash);
        return response;
    }
    
    public static TransferResponse error(String error) {
        TransferResponse response = new TransferResponse();
        response.setSuccess(false);
        response.setMessage(error);
        return response;
    }
}