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

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSON;
import com.yonge.cooleshow.common.enums.ESettlementFrom;
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.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Eric.Shang on 2022/10/8.
 */
@Data
@ApiModel("TeacherWrapper")
public class TeacherWrapper {

    /**
     * 老师统计指标信息
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TeacherStatInfo implements Serializable {

        // 星级
        private Integer starGrade;
        // 粉丝数
        private Integer fansNum;
        // 已上课时
        private Integer expTime;
        // 未上课时
        private Integer unExpTime;
        // 专辑数
        private Integer musicAlbumNum;
        // 曲谱数
        private Integer musicSheetNum;
        // 学生数
        private Integer studentNums;

        public String jsonString() {

            return JSON.toJSONString(this);
        }


        public TeacherStatInfo starGrade(Integer starGrade) {
            this.starGrade = starGrade;
            return this;
        }

        public TeacherStatInfo fansNum(Integer fansNum) {
            this.fansNum = fansNum;
            return this;
        }

        public TeacherStatInfo expTime(Integer expTime) {
            this.expTime = expTime;
            return this;
        }

        public TeacherStatInfo unExpTime(Integer unExpTime) {
            this.unExpTime = unExpTime;
            return this;
        }

        public TeacherStatInfo musicAlbumNum(Integer musicAlbumNum) {
            this.musicAlbumNum = musicAlbumNum;
            return this;
        }

        public TeacherStatInfo musicSheetNum(Integer musicSheetNum) {
            this.musicSheetNum = musicSheetNum;
            return this;
        }

    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("老师设置结算方式模型")
    public static class TeacherSetSettlement {

        @ApiModelProperty("老师ID，批量用数组方式")
        private List<Long> teacherIdList = new ArrayList<>();

        @ApiModelProperty("结算方式")
        private ESettlementFrom settlementFrom;
    }

    @Data
    @ApiModel("解绑机构")
    public static class UnbindTenant {

        @ApiModelProperty("短信验证码")
        @NotNull
        private String code;

        @ApiModelProperty("解绑原因")
        @NotNull
        private String unbindReason;
    }

    @Data
    @ApiModel("修改机构")
    public static class UpdateTenant {

        @ApiModelProperty("老师ID")
        @NotNull
        private Long teacherId;

        @ApiModelProperty("机构ID")
        @NotNull
        private Long tenantId;
    }

    @Data
    public static class ExportTeacherTemplate {

        @ExcelProperty(value = "姓名")
        private String userName;

        @ExcelProperty(value = "手机号")
        private String phone;

        @ExcelProperty(value = "曲谱")
        private String musicSheet;

        @ExcelProperty(value = "声部")
        private String subjectName;

        @ExcelProperty(value = "结算方式")
        private String settlementFrom;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("导出数据")
    public static class ExportFile {

        @ApiModelProperty("文件名称")
        private String fileName;

        @ApiModelProperty("下载地址")
        private String downloadPath;
    }


    @Data
    public static class TeacherFriend implements Comparable<TeacherFriend> {

        private Long teacherId;

        private Integer friendNums;

        @Override
        public int compareTo(TeacherFriend o) {
            return friendNums.compareTo(o.getFriendNums());
        }
    }


    /**
     * 客服发送消息的对象列表
     */
    @Data
    public static class CustomerServiceSendMsg2User {

        @ApiModelProperty("客服ID")
        private Long customerId;

        @ApiModelProperty("老师好友")
        private List<Long> teacherIds = new ArrayList<>();


        @ApiModelProperty("学生好友")
        private List<Long> studentIds = new ArrayList<>();

    }
}
