package com.liquidnet.service.kylin.dto.vo.returns;

import com.liquidnet.service.kylin.dao.KylinArtistPerformanceDao;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel("演出场次艺人阵容Vo")
public class KylinPerformanceArtistLineupVo implements Serializable {

    @ApiModelProperty(value = "场次ID")
    private String ticketTimesId;

    @ApiModelProperty(value = "场次标题")
    private String timeTitle;

    @ApiModelProperty(value = "艺人列表")
    private List<KylinPerformanceTimeArtist> artists;

    @Data
    @ApiModel("演出场次艺人")
    public static class KylinPerformanceTimeArtist {

        @ApiModelProperty(value = "艺人ID")
        private String artistId;

        @ApiModelProperty(value = "艺人名称")
        private String artistName;

        @ApiModelProperty(value = "艺人头像")
        private String avatarUrl;

        @ApiModelProperty(value = "演出ID")
        private String performanceId;

        @ApiModelProperty(value = "演出标题")
        private String title;

        @ApiModelProperty(value = "艺人排序 越大越靠前")
        private Integer sort;


        // 👇 静态转换方法：从 Dao 转为 Vo
        public static KylinPerformanceTimeArtist from(KylinArtistPerformanceDao dao) {
            if (dao == null) {
                return null;
            }
            KylinPerformanceTimeArtist artist = new KylinPerformanceTimeArtist();
            artist.setArtistId(dao.getArtistId());
            artist.setArtistName(dao.getArtistName());
            artist.setAvatarUrl(dao.getAvatarUrl());
            artist.setPerformanceId(dao.getPerformanceId());
            artist.setTitle(dao.getTitle());
            artist.setSort(dao.getSort());
            return artist;
        }
    }
}
