package com.it.rattan.rpc;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Getter
@Setter
public class BaseResponse {

    public static final String SUCCESS = "0000";

    public static final String FAIL = "0001";

    private String msg;

    private String code;

    public BaseResponse(final String code,final String msg){
        this.code = code;
        this.msg = msg;
    }

    public static BaseResponse success(){
        return new BaseResponse(BaseResponse.SUCCESS,"");
    }

    public static BaseResponse fail(final String message){
        return new BaseResponse(BaseResponse.FAIL,message);
    }
    public static BaseResponse fail(final String code,final String message){
        return new BaseResponse(code,message);
    }




}
