package com.izouma.wenlvju.dto;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.izouma.wenlvju.domain.performance.Programme;
import com.izouma.wenlvju.enums.SignedIn;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProgrammeScoreDTO {
    private Long id;

    private Long performanceId;

    @ApiModelProperty(value = "分组")
    private String arrangeName;

    @ApiModelProperty(value = "活动名称")
    private String performance;

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

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

    @ApiModelProperty(value = "参赛人数")
    private long quantity;

    @ApiModelProperty(value = "参演人员")
    private List<String> participant;

    @ApiModelProperty(value = "节目视频")
    private String video;

    @ApiModelProperty(value = "节目文件附件")
    private String annex;


    private SignedIn signedIn;

    private Double score;

    private Double myScore;

    private String remark;

    private boolean second;

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