package cokr.xit.ens.modules.common.ctgy.intgrnbill.kko.model;

import cokr.xit.ens.modules.common.ctgy.intgrnbill.kko.code.BillKkoErrCd;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

@Getter
@ToString
@EqualsAndHashCode
@Schema(name = "KkoBillPayApiRespVO")
public class BillKkoApiRespDTO<T> {

    @Schema(title = "응답코드", example = " ")
    private String res_code;

    @Schema(title = "응답메시지", example = " ")
    private String message;

    @Schema(title = "응답데이터", example = " ")
    private T data;


    @Builder(builderClassName = "okBuilder", builderMethodName = "okBuilder")
    BillKkoApiRespDTO(T data) {
        this.res_code = BillKkoErrCd.OK.getCode();
        this.message = BillKkoErrCd.OK.getCodeNm();
        this.data = data;
    }

    @Builder(builderClassName = "errBuilder", builderMethodName = "errBuilder")
    BillKkoApiRespDTO(String resCode, String message) {
        this.res_code = resCode;
        this.message = message;
        this.data = null;
    }

    @Builder(builderClassName = "errDataBuilder", builderMethodName = "errDataBuilder")
    BillKkoApiRespDTO(String resCode, String message, T data) {
        this.res_code = resCode;
        this.message = message;
        this.data = data;
    }

}
