SRMResult.java 706 Bytes
package com.huaheng.api.srm.domain;

import lombok.Data;

@Data
public class SRMResult {
    private boolean Success;
    private String Message;
    private Object Data;



    public SRMResult success(String message){
        SRMResult srmResult = new SRMResult();
        srmResult.setSuccess(true);
        srmResult.setMessage(message);
        srmResult.setData(null);
        return srmResult;
    }


    public SRMResult error(String message){
        SRMResult srmResult = new SRMResult();
        srmResult.setSuccess(false);
        srmResult.setMessage(message);
        srmResult.setData(null);
        return srmResult;
    }

    public boolean hasError(){
        return !Success;
    }
}