package com.persagy.proxy.adm.request;

import lombok.*;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class AdmManualRelCalResponse extends AdmResponse {

    private final static String SUCCESS = "success";
    private final static String FAILURE = "failure";

    /** 方向 Left、right */
    private String direction;

    public AdmManualRelCalResponse(String result, String message, Long total, Integer pageNumber, Integer pageSize, List<?> content, String direction) {
        this.setResult(result);
        this.setMessage(message);
        this.setTotal(total);
        this.setPageNumber(pageNumber);
        this.setPageSize(pageSize);
        this.setContent(content);
        this.setDirection(direction);
    }

    public static AdmResponse success() {
        return new AdmManualRelCalResponse(SUCCESS, null, null, null, null, null,null);
    }

    public static AdmResponse failure(String message, String direction) {
        return new AdmManualRelCalResponse(FAILURE, message, null, null, null, null,direction);
    }

    public static AdmResponse success(List<?> content, String direction) {
        return new AdmManualRelCalResponse(SUCCESS, null, null, null, null, content,direction);
    }
}
