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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.oqpo.api.entity.oper.MenuEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

@Getter
@Setter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@JsonInclude(JsonInclude.Include.ALWAYS) //null 값 전송
public class TopMenuListResponse {

    @ApiModelProperty(value = "메뉴번호")
    private int menuNo;

    @ApiModelProperty(value = "메뉴명")
    private String menuNm;


    public static TopMenuListResponse toDTO(MenuEntity entity) {
        if (entity == null) return null;
        return TopMenuListResponse.builder()
                .menuNo(entity.getMenuNo())
                .menuNm(entity.getMenuNm())
                .build();
    }

}
