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

import com.alibaba.fastjson.JSON;
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;

/**
 * 乐器设置
 * 2024-04-22 16:55:18
 */
@ApiModel(value = "InstrumentWrapper对象", description = "乐器设置查询对象")
public class InstrumentWrapper {

    @Data
	@Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" InstrumentQuery-乐器设置")
    public static class InstrumentQuery implements QueryInfo {

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

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


        @ApiModelProperty("声部")
        private Integer subjectId;
        @ApiModelProperty("声部")
        private List<Integer> subjectIds;
        @ApiModelProperty("是否启用")
        private Boolean enableFlag;



        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static InstrumentQuery from(String json) {
            return JSON.parseObject(json, InstrumentQuery.class);
        }
    }

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

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

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

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

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

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

        @ApiModelProperty("启用/停用")
        private Boolean enableFlag;

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

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

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

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


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

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

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

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

        @ApiModelProperty("默认谱面(STAVE: 五线谱; JIAN: 固定调; FIRST: 首调)")
        private String defaultScore;
        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static Instrument from(String json) {
            return JSON.parseObject(json, Instrument.class);
        }
	}

    @Data
    public static class Update {

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

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

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

        @ApiModelProperty("启用/停用")
        private Boolean enableFlag;
    }
}
