package com.vetti.hotake.domain.dto;

import com.vetti.common.annotation.Excel;
import com.vetti.common.utils.bean.BeanUtils;
import com.vetti.hotake.domain.HotakeSysNotice;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author ID
 * @date 2025/11/1 16:50
 */
@Data
public class HotakeSysNoticeDto extends HotakeSysNotice {

    @ApiModelProperty("通知类型名称")
    private String noticeTypeName;

    @ApiModelProperty("图片")
    private String img;

    @ApiModelProperty("招聘企业的名称")
    private Long cvCompanyName;

    @ApiModelProperty("招聘企业的岗位")
    private Long cvPosition;


    public static HotakeSysNoticeDto build(HotakeSysNotice data, Map<Long, String> typeNameMap, String url) {
        HotakeSysNoticeDto dto = new HotakeSysNoticeDto();
        BeanUtils.copyBeanProp(dto, data);
        if (typeNameMap != null) {
            dto.setNoticeTypeName(typeNameMap.get(data.getNoticeTypeId()));
        }
        dto.setImg(url);


        return dto;
    }
}
