package com.oqpo.api.web.dto.response;

import com.oqpo.api.enums.DataMessageCode;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class DataResponse {
    @ApiModelProperty(value = "결과 코드")
    private String code;

    @ApiModelProperty(value = "결과 메시지")
    private String message;

    public static DataResponse toDTO(DataMessageCode dataMessageCode) {
        return DataResponse.builder()
                .code(dataMessageCode.getId())
                .message(dataMessageCode.getMessage())
                .build();
    }
}
