package com.yonge.cooleshow.biz.dal.wrapper;

import com.dayaedu.cbs.openfeign.wrapper.music.CbsSubjectWrapper;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

public class SubjectWrapper {

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SubjectQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("关键字匹配")
        private String keyword;

        @ApiModelProperty("删除标识")
        private Integer delFlag;

        @ApiModelProperty("启用标识")
        private Boolean enableFlag;

        @ApiModelProperty("声部ID")
        private Integer subjectId;

        @ApiModelProperty("父级声部ID")
        private Integer parentSubjectId;

        @ApiModelProperty("多个声部ID")
        private String subjectIds;

        @ApiModelProperty("多个乐器ID")
        private String instrumentIds;

        @ApiModelProperty("有乐器")
        private Boolean hasInstrument;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Subject {

        @ApiModelProperty("主键")
        private Integer id;

        @ApiModelProperty("内容平台声部ID")
        private Long cbsSubjectId;

        @ApiModelProperty("内容平台声部名称")
        private String cbsSubjectName;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("编码")
        private String code;

        @ApiModelProperty(value = "父级编号",required = false)
        private Long parentSubjectId;

        private String parentSubjectName;

        @ApiModelProperty("封面")
        private String img;

        @ApiModelProperty("orientation：1:竖 0:横")
        private Boolean orientation;

        @ApiModelProperty("删除标识")
        private Boolean delFlag;

        @ApiModelProperty("描述信息")
        private String desc;

        @ApiModelProperty("logo")
        private String logo;

        @ApiModelProperty("音频")
        private String media;

        @ApiModelProperty("更新时间")
        private Date updateTime;

        @ApiModelProperty("创建时间")
        private Date createTime;

        @ApiModelProperty("启用标识")
        private Boolean enableFlag;

        @ApiModelProperty("声部列表")
        private List<Subject> subjects;

        @ApiModelProperty("乐器列表")
        private List<InstrumentWrapper.Instrument> instruments;

    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SmallInstrument {

        @ApiModelProperty("乐器ID")
        private Integer id;

        @ApiModelProperty("乐器名称")
        private String name;

        @ApiModelProperty("编码")
        private String code;

        @ApiModelProperty("横竖屏：1:竖 0:横")
        private Boolean orientation;

        @ApiModelProperty("是否可转普")
        private Boolean transferFlag;

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

        @ApiModelProperty("音频")
        private String media;

        @ApiModelProperty("频率")
        private Integer hz;

        @ApiModelProperty("是否启用")
        private Boolean enableFlag = false;

        @ApiModelProperty("操作人")
        private Long operator;
    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SmallSubject {

        @ApiModelProperty("声部ID")
        private Integer id;

        @ApiModelProperty("声部名称")
        private String name;
    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SmallMusicSheet {

        @ApiModelProperty("id")
        private Long id;

        @ApiModelProperty("声部ID")
        private String musicSubject;

        @ApiModelProperty("内容平台声部ID")
        private String cbsSubjectId;
    }

    @Data
    @ApiModel("声部启用")
    public static class SubjectEnable {

        @ApiModelProperty("声部ID")
        @NotNull(message = "声部ID不能为空")
        private Long id;

        @ApiModelProperty("启用标识")
        @NotNull(message = "启用标识不能为空")
        private Boolean enableFlag;
    }


    @Data
    public static class AddSubject {

        @ApiModelProperty("内容平台声部")
        private List<AddSubjectInstrument> subjects;

        @ApiModelProperty("操作人")
        private Long operator;
    }

    @Data
    public static class AddSubjectInstrument {

        @ApiModelProperty("内容平台声部ID")
        @NotNull(message = "内容平台声部ID不能为空")
        private Long cbsSubjectId;

        @ApiModelProperty("乐器ID")
        private List<Long> instrumentIds;
    }

    @Data
    public static class CbsSubject{
        @ApiModelProperty("声部ID")
        private Long id;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("编码")
        private String code;

        @ApiModelProperty("是否启用")
        private Boolean enableFlag;

        @ApiModelProperty("乐器列表")
        private List<Instrument> instruments;
    }


    @Data
    @ApiModel(" Instrument-乐器设置")
    public static class Instrument {

        @ApiModelProperty("乐器ID")
        private Integer id;

        @ApiModelProperty("乐器名称")
        private String name;

        @ApiModelProperty("是否已被添加过")
        private Boolean added = false;
    }

    @Data
    @ApiModel(" SubjectList-声部表")
    public static class CbsSubjectQuery extends CbsSubjectWrapper.SubjectQuery {

        @ApiModelProperty("当前声部ID")
        private Long subjectId;

        @ApiModelProperty("是否移除被使用过的声部")
        private Boolean removeUsed = false;
    }
}
