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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@ApiModel(value = "TeacherIndexWrapper", description = "首页数据统计")
public class TeacherIndexWrapper {
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SummarySearch {
        @ApiModelProperty("开始时间")
        private String startTime;

        @ApiModelProperty("结束时间")
        private String endTime;

        @ApiModelProperty("乐器")
        private Long subjectId;

        @ApiModelProperty("老师id")
        private Long teacherId;
    }
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class StudentSearch {
        @ApiModelProperty("开始时间")
        private String startTime;

        @ApiModelProperty("结束时间")
        private String endTime;

        @ApiModelProperty("乐器")
        private Long subjectId;

        @ApiModelProperty("老师id")
        private Long teacherId;

        @ApiModelProperty("排序字段")
        private String sortField;

        @ApiModelProperty("排序方式 ,ASC升序,DESC降序")
        private String sortType;
    }

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

        @ApiModelProperty("练习统计")
        private PracticeSummaryDto practiceSummary;

        @ApiModelProperty("练习时长")
        private List<PracticeTimeDto> practiceTimes;

        @ApiModelProperty("练习人数")
        private List<PracticeTimeDto> practiceCounts;

        @ApiModelProperty("学员练习统计")
        private List<StudentPracticeSummaryDto> studentPracticeSummary;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PracticeSummaryDto{
        @ApiModelProperty("练习人数")
        private BigDecimal practiceCount = BigDecimal.ZERO;

        @ApiModelProperty("平均练习时长")
        private BigDecimal averagePracticeTime = BigDecimal.ZERO;

        @ApiModelProperty("练习总时长")
        private BigDecimal totalPracticeTime = BigDecimal.ZERO;
	}

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PracticeTimeDto {
        @ApiModelProperty("日期")
        private String date;

        @ApiModelProperty("练习时长")
        private Long practiceTime;

    }

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

        @ApiModelProperty("学员姓名")
        private String studentName;

        @ApiModelProperty("乐器")
        private String subjectName;

        @ApiModelProperty("练习总时长")
        private Long totalPracticeTime;

        @ApiModelProperty("练习天数")
        private Integer practiceDays;

        @ApiModelProperty("平均练习时长")
        private Long averagePracticeTime;
    }

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

        @ApiModelProperty("日期")
        private String date;

        @ApiModelProperty("曝光数")
        private Integer exposureNum;

        @ApiModelProperty("类型")
        private String type;

        public CourseExposureTotal(String date, String type, Integer exposureNum) {
            this.date = date;
            this.type = type;
            this.exposureNum = exposureNum;
        }
    }

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

        @ApiModelProperty("开始时间")
        private String startTime;

        @ApiModelProperty("结束时间")
        private String endTime;

        @ApiModelProperty("类型MUSIC:乐谱，LIVE:直播课，VIDEO：视频课")
        private String type;

        @ApiModelProperty("老师id")
        private Long teacherId;

        @ApiModelProperty("学员列表")
        private List<Long> studentIds;

    }

}
