package com.xinyilu.system.domain.kindergarteninfo;

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;

/**
 * 幼儿园信息管理对象 kindergarten_info
 *
 * @author jihan
 * @date 2022-07-28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "幼儿园信息管理对象", description = "kindergarten_info")
public class KindergartenInfo extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -7446435726362566607L;
    /**
     * 主键id
     */
    @NotNull(message = "主键id不能为空", groups = {Update.class})
    private Long id;

    /**
     * 用户表id
     */
    private Long userId;

    /**
     * 幼儿园园长id
     */
    @NotNull(message = "幼儿园园长不能为空", groups = {Insert.class, Update.class})
    private Long principalId;

    /**
     * 组织表id
     */
    @ApiModelProperty(value = "组织表id")
    @NotNull(message = "所属组织不能为空", groups = {Insert.class, Update.class})
    private Long organizeId;

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

    /**
     * 幼儿园地址
     */
    @ApiModelProperty(value = "幼儿园地址")
    @NotBlank(message = "幼儿园地址不能为空", groups = {Insert.class, Update.class})
    private String kindergartenAddress;

    /**
     * 类型，public_handle：公办，private_handle：私有
     */
    @ApiModelProperty(value = "类型，public_handle：公办，private_handle：私立")
    @NotBlank(message = "类型不能为空", groups = {Insert.class, Update.class})
    private String kindergartenType;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
    private String phone;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    private String contacts;

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

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("organizeId", getOrganizeId())
                .append("kindergartenName", getKindergartenName())
                .append("kindergartenAddress", getKindergartenAddress())
                .append("kindergartenType", getKindergartenType())
                .append("phone", getPhone())
                .append("contacts", getContacts())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
