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

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

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

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

    public static SaveResponse toDTO(SystemMessageCode systemMessageCode) {
        return SaveResponse.builder()
                .code(systemMessageCode.getId())
                .message(systemMessageCode.getMessage())
                .build();
    }
}
