package com.takensoft.common.util;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import lombok.Data;
import org.springframework.http.HttpStatus;

import java.time.LocalDateTime;

/**
 * @author  : takensoft
 * @since   : 2025.01.22
 * @modification
 *     since    |    author    | description
 *  2025.01.22  |  takensoft   | 최초 등록
 *
 * 응답 데이터 객체
 */
@Data
public class ResponseData {

    private int status;                 // 상태 코드
    private HttpStatus statusText;      // 상태 메시지
    private String message;             // 전달 메시지
    private Object data;                // 전달 데이터

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime resTime;      // 응답 시간

    public ResponseData() {
        this.status = 0;
        this.statusText = null;
        this.message = null;
        this.data = null;
        this.resTime = LocalDateTime.now();
    }
}
