package com.app.entity.basics;

import com.app.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

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

/**
 * 功能描述：开课
 *
 * @Auther: 梁展鹏
 * @Date: 2018/7/17 14:03
 */
@ApiModel("开课")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("t_open_course")
public class OpenCourse extends BaseEntity {

    @ApiModelProperty("机构id")
    @NotEmpty
    @TableField(value = "organ_id")
    private String organId;

    @ApiModelProperty("课程标识")
    @NotEmpty
    @TableField("course_id")
    private String courseId;

    @ApiModelProperty("课程名称")
    @NotEmpty
    @TableField("name")
    private String name;

    @ApiModelProperty("缩略图")
    @TableField("thumbnail")
    private String thumbnail;

    @ApiModelProperty("横幅")
    @TableField("banner")
    private String banner;

    @ApiModelProperty("课程介绍")
    @TableField("introduce_url")
    private String introduceUrl;

    /**
     * 课程价格
     * 基本都是整数场景，暂不考虑使用BigDecimal
     */
    @ApiModelProperty("课程价格")
    @NotNull
    @TableField("price")
    private Double price;

    @ApiModelProperty("学年")
    @NotNull
    @TableField("school_year")
    private Integer schoolYear;

    @ApiModelProperty("学期")
    @NotNull
    @TableField("semester")
    private Integer semester;

    @ApiModelProperty("学校标识")
    @NotEmpty
    @TableField("school_id")
    private String schoolId;

    @ApiModelProperty("学校名称")
    @NotEmpty
    @TableField("school_name")
    private String schoolName;

    /**
     * 年级名称
     *
     * @see com.app.constant.SchoolConstant#PRIMARY_SCHOOL
     * @see com.app.constant.SchoolConstant#MIDDLE_SCHOOL
     * @see com.app.constant.SchoolConstant#HIGH_SCHOOL
     */
    @ApiModelProperty("年级名称")
    @NotEmpty
    @TableField("grade_name")
    private String gradeName;

    /**
     * @see com.app.constant.OpenCourseConstant.OpenCourseType
     */
    @ApiModelProperty("课程类型")
    @NotNull
    @TableField("type")
    private String type;

    @ApiModelProperty("星期X")
    @NotEmpty
    @TableField("cycle")
    private String cycle;

    @ApiModelProperty("时间段")
    @NotEmpty
    @TableField("hours")
    private String hours;

    @ApiModelProperty("开班人数")
    @NotNull
    @TableField("open_course_number")
    private Integer openCourseNumber;

    @ApiModelProperty("空闲人数")
    @NotNull
    @TableField("free_course_number")
    private Integer freeCourseNumber;

    @ApiModelProperty("报名开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @NotNull
    @TableField("sign_up_start_time")
    private Date signUpStartTime;

    @ApiModelProperty("报名结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @NotNull
    @TableField("sign_up_end_time")
    private Date signUpEndTime;

    /**
     * 微信群二维码
     * 支付成功后展示该图片(方便运营人员管理)
     */
    @ApiModelProperty("微信群二维码")
    @TableField("wx_group_qr_url")
    private String wxGroupQRUrl;

    @ApiModelProperty("备注")
    @TableField("remarks")
    private String remarks;


}
