package com.xinyilu.system.domain.teacherInfo;

import com.xinyilu.common.core.domain.BaseEntity;
import com.xinyilu.common.custominterface.Insert;
import com.xinyilu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 教师信息管理对象 teacher_info
 *
 * @author jihan
 * @date 2022-08-05
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "教师信息管理对象", description = "teacher_info")
public class TeacherInfo extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -1306348631773114230L;
    /**
     * 主键id
     */
    @NotNull(message = "id不能为空", groups = {Update.class})
    private Long id;

    /**
     * 所属幼儿园id
     */
    @ApiModelProperty(value = "所属幼儿园id")
    @NotNull(message = "所属幼儿园不能位空", groups = {Insert.class, Update.class})
    private Long kindergartenId;

    /**
     * 用户表id
     */
    @ApiModelProperty(value = "用户表id")
    private Long userId;

    /**
     * 教师名称
     */
    @ApiModelProperty(value = "教师名称")
    @NotBlank(message = "教师名称不能为空", groups = {Insert.class, Update.class})
    private String teacherName;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @Size(min = 0, max = 18, message = "身份证最大长度位18位并且只能为数字")
    private String cardNo;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Size(min = 0, max = 11, message = "手机号码最大长度位11位")
    private String teacherPhone;

    /**
     * MALE：男，FEMALE：女
     */
    @ApiModelProperty(value = "MALE：男，FEMALE：女")
    @NotBlank(message = "性别不能为空", groups = {Insert.class, Update.class})
    private String teacherSex;

    /**
     * 是否删除，0：否，1：是
     */
    private Integer delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("kindergartenId", getKindergartenId())
                .append("teacherName", getTeacherName())
                .append("cardNo", getCardNo())
                .append("teacherPhone", getTeacherPhone())
                .append("teacherSex", getTeacherSex())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
