package com.izouma.wenlvju.dto;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.wenlvju.domain.performance.Programme;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProgScoreAdminDTO {
    @ExcelProperty(value = "节目编号")
    private Long id;

    @ExcelProperty(value = "节目名称")
    private String name;

    @ExcelProperty(value = "参赛专业")
    private String specialty;

    @ExcelProperty(value = "参赛组别")
    private String competitionGroup;

    @ExcelProperty(value = "考级机构")
    private String gradingOrganization;

    @ExcelProperty(value = "承办单位")
    private String organization;

    @ExcelProperty(value = "考级点")
    private String examPoint;

    @ExcelProperty(value = "参演人数")
    private int quantity;

    @ExcelIgnore
    private List<String> participant;

    @ExcelIgnore
    private String video;

    @ExcelIgnore
    private String annex;

    @ExcelProperty(value = "分数")
    private Double score;

    @ExcelProperty(value = "专家平均分")
    private Double myScore;

    @ExcelIgnore
    private boolean second;

    public ProgScoreAdminDTO(Programme programme) {
        BeanUtil.copyProperties(programme, this);
        if (ObjectUtil.isNotNull(programme.getVideo())) {
            this.video = programme.getVideo().getSrc();
        }
    }
}
