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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
import java.util.Optional;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yonge.cooleshow.biz.dal.enums.AccompanimentTypeEnum;
import com.yonge.cooleshow.biz.dal.enums.AudioTypeEnum;
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
import com.yonge.cooleshow.biz.dal.enums.ChargeTypeEnum;
import com.yonge.cooleshow.biz.dal.enums.SourceTypeEnum;
import com.yonge.cooleshow.common.enums.YesOrNoEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 曲谱表
 * @author yzp
 * @date 2022-03-25 23:46:28
 * @version v1.0
 **/
@ApiModel(value = "music_sheet-曲谱表")
public class MusicSheet implements Serializable {

    @TableId(value = "id_", type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    private Long id;  //主键ID

    @NotBlank(message = "曲谱名称不能为空!")
    @Size(max = 64, message = "曲谱名称长度不能超过64位!")
    @TableField("music_sheet_name_")
    @ApiModelProperty(value = "曲谱名称")
    private String musicSheetName;  //曲谱名称


	@NotBlank(message = "曲谱封面图不能为空!")
	@TableField("title_img_")
	@ApiModelProperty(value = "封面图")
	private String titleImg;  //曲谱名称

    @TableField("user_id_")
    @ApiModelProperty(value = "曲谱来源(平台用户ID或者是老师ID)")
    private Long userId;  //曲谱来源(平台用户ID或者是老师ID)

	@TableField("notation_")
	@ApiModelProperty("是否可以转简谱（0:否，1：是）")
	private YesOrNoEnum notation;

	@TableField("music_img_")
	@ApiModelProperty("曲目图片")
	private String musicImg;

	@TableField("source_type_")
	@ApiModelProperty(value = "曲目来源类型 TEACHER 老师 PLATFORM 平台")
	private SourceTypeEnum sourceType;

    @NotBlank(message = "艺术家不能为空!")
    @Size(max = 32, message = "艺术家长度不能超过32位!")
    @TableField("composer_")
    @ApiModelProperty(value = "艺术家")
    private String composer;  //音乐家

    @TableField("music_subject_")
    @ApiModelProperty(value = "曲谱声部(适用的乐器,可能是多个,用逗号分隔)")
    private String musicSubject;  //曲谱声部(适用的乐器,可能是多个,用逗号分隔)

    @NotNull(message = "曲谱音频文件类型不能为空!")
    @TableField("audio_type_")
    @ApiModelProperty(value = "曲目音频类型 MP3：mp3, MIDI:midi,")
    private AudioTypeEnum audioType;

	@TableField("mp3_type_")
	@ApiModelProperty(value = "mp3类型 MP3：mp3, MP3_METRONOME:MP3_METRONOME,")
	private AudioTypeEnum mp3Type;

    @NotBlank(message = "曲谱标签不能为空!")
    @TableField("music_tag_")
    @ApiModelProperty(value = "曲谱标签(多个标签用逗号分隔)")
    private String musicTag;  //曲谱标签(多个标签用逗号分隔)

	@NotNull(message = "伴奏类型不能为空!")
	@TableField("accompaniment_type_")
	@ApiModelProperty(value = "伴奏类型 HOMEMODE:自制伴奏  COMMON:普通伴奏")
	private AccompanimentTypeEnum accompanimentType;

    @TableField("play_speed_")
	// @NotNull(message = "默认播放速度不能为空!")
    @ApiModelProperty(value = "默认播放速度")
    private Integer playSpeed;  //默认播放速度

    @TableField("can_evaluate_")
    @ApiModelProperty(value = "是否可以评测(0:否;1:是)")
    private YesOrNoEnum canEvaluate;  //是否可以评测(0:否;1:是)

    @TableField("show_fingering_")
    @ApiModelProperty(value = "是否展示指法(0:否;1:是)")
    private YesOrNoEnum showFingering;  //是否展示指法(0:否;1:是)

    // @NotNull(message = "收费类型不能为空!")
    @TableField("charge_type_")
    @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
    private ChargeTypeEnum chargeType;  //收费类型(0:免费;1:会员;2:单曲收费)

	@NotNull(message = "收费类型不能为空!")
	@TableField("payment_type_")
	@ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
	private String paymentType;


	@TableField("state_")
	@ApiModelProperty(value = "曲目状态(0:停用，1：启用)")
	private YesOrNoEnum state;

	@TableField("reason_")
	@ApiModelProperty(value = "曲目停用原因")
	private String reason;

    @TableField("audit_status_")
    @ApiModelProperty(value = "审核状态(DOING:待审核;PASS:通过;UNPASS:未通过)")
    private AuthStatusEnum auditStatus;

	@TableField("submit_audit_time_")
	@ApiModelProperty(value = "提交审核时间")
	private Date submitAuditTime;

    @TableField("sort_number_")
    @ApiModelProperty(value = "排序号")
    private Integer sortNumber;  //排序号

    @TableField("top_flag_")
    @ApiModelProperty(value = "是否置顶(0:否;1:是)")
    private YesOrNoEnum topFlag;  //是否置顶(0:否;1:是)

    @TableField("hot_flag_")
    @ApiModelProperty(value = "是否热门曲谱(0:否;1:是)")
    private YesOrNoEnum hotFlag;  //是否热门曲谱(0:否;1:是)

    @TableField("exquisite_flag_")
    @ApiModelProperty(value = "精品标志(0:否;1:是)")
    private YesOrNoEnum exquisiteFlag;

    @TableField("music_price_")
    @ApiModelProperty(value = "曲谱价格")
    private java.math.BigDecimal musicPrice;  //曲谱价格

    @TableField("audio_file_url_")
    @ApiModelProperty(value = "音频文件存储路径")
    private String audioFileUrl;  //音频文件存储路径

    @NotBlank(message = "XML文件存储路径不能为空!")
    @TableField("xml_file_url_")
    @ApiModelProperty(value = "XML文件存储路径")
    private String xmlFileUrl;  //XML文件存储路径


	@TableField("midi_url_")
	@ApiModelProperty(value = "midi路径")
	private String midiUrl;  //XML文件存储路径


	@TableField("metronome_url_")
	@ApiModelProperty(value = "伴奏含节拍器路径")
	private String metronomeUrl;  //XML文件存储路径


	@TableField("url_")
	@ApiModelProperty(value = "伴奏（不含节拍器）路径")
	private String url;  //XML文件存储路径

    @TableField("has_beat_")
    @ApiModelProperty(value = "是否自带节拍器(0:否;1:是)")
    private YesOrNoEnum hasBeat;  //是否自带节拍器(0:否;1:是)

	@TableField("audit_version_")
	@ApiModelProperty(value = "是否审核时可见 （0:否  1：是）")
	private YesOrNoEnum auditVersion;

    @TableField("create_time_")
    @ApiModelProperty(value = "创建时间")
    private java.util.Date createTime;  //创建时间

    @TableField("create_by_")
    @ApiModelProperty(value = "创建人(老师或者是后台平台用户)")
    private Long createBy;  //创建人(老师或者是后台平台用户)

    @TableField("update_time_")
    @ApiModelProperty(value = "更新时间")
    private java.util.Date updateTime;  //更新时间

    @TableField("update_by_")
    @ApiModelProperty(value = "更新人(老师或者是后台平台用户)")
    private Long updateBy;  //更新人(老师或者是后台平台用户)

    @TableField("remark_")
    @ApiModelProperty(value = "备注")
    private String remark;  //备注，填写未通过审核的原因


	@TableField("ext_config_json_")
	@ApiModelProperty("曲目配置信息")
	private String extConfigJson;


	@TableField("del_flag_")
	@ApiModelProperty(value = "假删除标识 0：未删除 1：已删除")
	private Boolean delFlag;

	public String getMusicImg() {
		return musicImg;
	}

	public void setMusicImg(String musicImg) {
		this.musicImg = musicImg;
	}

	public AccompanimentTypeEnum getAccompanimentType() {
		return accompanimentType;
	}

	public void setAccompanimentType(AccompanimentTypeEnum accompanimentType) {
		this.accompanimentType = accompanimentType;
	}

	public String getTitleImg() {
		return titleImg;
	}

	public void setTitleImg(String titleImg) {
		this.titleImg = titleImg;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getExtConfigJson() {
		return extConfigJson;
	}

	public void setExtConfigJson(String extConfigJson) {
		this.extConfigJson = extConfigJson;
	}

	public YesOrNoEnum getNotation() {
		return notation;
	}

	public void setNotation(YesOrNoEnum notation) {
		this.notation = notation;
	}

	public String getMidiUrl() {
		return midiUrl;
	}

	public void setMidiUrl(String midiUrl) {
		this.midiUrl = midiUrl;
	}

	public String getMetronomeUrl() {
		return metronomeUrl;
	}

	public void setMetronomeUrl(String metronomeUrl) {
		this.metronomeUrl = metronomeUrl;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMusicSheetName() {
		return musicSheetName;
	}

	public void setMusicSheetName(String musicSheetName) {
		this.musicSheetName = musicSheetName;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getComposer() {
		return composer;
	}

	public void setComposer(String composer) {
		this.composer = composer;
	}

	public String getMusicSubject() {
		return musicSubject;
	}

	public void setMusicSubject(String musicSubject) {
		this.musicSubject = musicSubject;
	}

	public AudioTypeEnum getAudioType() {
		return audioType;
	}

	public void setAudioType(AudioTypeEnum audioType) {
		this.audioType = audioType;
	}

	public String getMusicTag() {
		return musicTag;
	}

	public void setMusicTag(String musicTag) {
		this.musicTag = musicTag;
	}

	public Integer getPlaySpeed() {
		return playSpeed;
	}

	public void setPlaySpeed(Integer playSpeed) {
		this.playSpeed = playSpeed;
	}

	public YesOrNoEnum getCanEvaluate() {
		return canEvaluate;
	}

	public void setCanEvaluate(YesOrNoEnum canEvaluate) {
		this.canEvaluate = canEvaluate;
	}

	public YesOrNoEnum getShowFingering() {
		return showFingering;
	}

	public void setShowFingering(YesOrNoEnum showFingering) {
		this.showFingering = showFingering;
	}

	public ChargeTypeEnum getChargeType() {
		if (Objects.isNull(this.chargeType) && StringUtils.isNotEmpty(getPaymentType())) {

			return ChargeTypeEnum.valueOf(getPaymentType().split(",")[0]);
		}
		return chargeType;
	}

	public void setChargeType(ChargeTypeEnum chargeType) {
		this.chargeType = chargeType;
	}

	public YesOrNoEnum getState() {
		return state;
	}

	public void setState(YesOrNoEnum state) {
		this.state = state;
	}

	public AuthStatusEnum getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(AuthStatusEnum auditStatus) {
		this.auditStatus = auditStatus;
	}

	public Integer getSortNumber() {
		return sortNumber;
	}

	public void setSortNumber(Integer sortNumber) {
		this.sortNumber = sortNumber;
	}

	public YesOrNoEnum getTopFlag() {
		return topFlag;
	}

	public void setTopFlag(YesOrNoEnum topFlag) {
		this.topFlag = topFlag;
	}

	public YesOrNoEnum getExquisiteFlag() {
		return exquisiteFlag;
	}

	public void setExquisiteFlag(YesOrNoEnum exquisiteFlag) {
		this.exquisiteFlag = exquisiteFlag;
	}

	public YesOrNoEnum getHotFlag() {
		return hotFlag;
	}

	public void setHotFlag(YesOrNoEnum hotFlag) {
		this.hotFlag = hotFlag;
	}

	public BigDecimal getMusicPrice() {
		return musicPrice;
	}

	public void setMusicPrice(BigDecimal musicPrice) {
		this.musicPrice = musicPrice;
	}

	public String getAudioFileUrl() {
		return audioFileUrl;
	}

	public void setAudioFileUrl(String audioFileUrl) {
		this.audioFileUrl = audioFileUrl;
	}

	public String getXmlFileUrl() {
		return xmlFileUrl;
	}

	public void setXmlFileUrl(String xmlFileUrl) {
		this.xmlFileUrl = xmlFileUrl;
	}

	public YesOrNoEnum getHasBeat() {
		return hasBeat;
	}

	public void setHasBeat(YesOrNoEnum hasBeat) {
		this.hasBeat = hasBeat;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Long getCreateBy() {
		return createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Boolean getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Boolean delFlag) {
		this.delFlag = delFlag;
	}

	public Date getSubmitAuditTime() {
		return submitAuditTime;
	}

	public void setSubmitAuditTime(Date submitAuditTime) {
		this.submitAuditTime = submitAuditTime;
	}

	public SourceTypeEnum getSourceType() {
		return sourceType;
	}

	public void setSourceType(SourceTypeEnum sourceType) {
		this.sourceType = sourceType;
	}

	public AudioTypeEnum getMp3Type() {
		return mp3Type;
	}

	public void setMp3Type(AudioTypeEnum mp3Type) {
		this.mp3Type = mp3Type;
	}

	public YesOrNoEnum getAuditVersion() {
		return auditVersion;
	}

	public void setAuditVersion(YesOrNoEnum auditVersion) {
		this.auditVersion = auditVersion;
	}

	public String getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(String paymentType) {
		this.paymentType = paymentType;
	}

	public MusicSheet notation(YesOrNoEnum notation) {
		this.notation = notation;
		return this;
	}

	public MusicSheet canEvaluate(YesOrNoEnum canEvaluate) {
		this.canEvaluate = canEvaluate;
		return this;
	}

	public MusicSheet showFingering(YesOrNoEnum showFingering) {
		this.showFingering = showFingering;
		return this;
	}

	public MusicSheet hasBeat(YesOrNoEnum hasBeat) {
		this.hasBeat = hasBeat;
		return this;
	}

	public MusicSheet mp3Type(AudioTypeEnum mp3Type) {
		this.mp3Type = mp3Type;
		return this;
	}

	public MusicSheet audioType(AudioTypeEnum audioType) {
		this.audioType = audioType;
		return this;
	}

	public MusicSheet audioFileUrl(String audioFileUrl) {
		this.audioFileUrl = audioFileUrl;
		return this;
	}
}