package com.persagy.proxy.adm.request;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ADM 通用返回结果
 * @author Charlie Yu
 * @date 2021-08-16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdmCountResponse {
    private final static String SUCCESS = "success";
    private final static String FAILURE = "failure";
    
    /** 结果 */
    private String result;
    /** 消息 */
    private String message;
    /** 符合条件的总记录数 */
    private Long count;

    public static AdmCountResponse success() {
        return new AdmCountResponse(SUCCESS, null, null);
    }
    
    public static AdmCountResponse success(Long count) {
        return new AdmCountResponse(SUCCESS, null, count);
    }

    public static AdmCountResponse failure(String message) {
        return new AdmCountResponse(FAILURE, message, null);
    }

}
