package com.shulead.datasync.bo;

import lombok.Data;

import java.io.Serializable;

/**
 * @Classname Response
 * @Description TODO
 * @Version 1.0.0
 * @Date 2024/5/13 10:00
 * @Created by liuxiangshun
 */
@Data
public class Response implements Serializable {
    private static final long serialVersionUID = -6145302222777770089L;

    private Integer code;

    private String msg;

    private Boolean success;

    private Object data;

    public static Response success(Object data) {
        Response response = new Response();
        response.setCode(200);
        response.setSuccess(true);
        response.setData(data);
        return response;
    }

    public static Response fail(Object data) {
        Response response = new Response();
        response.setCode(500);
        response.setSuccess(false);
        response.setData(data);
        response.setMsg("系统异常");
        return response;
    }
}
