package com.xinelu.manage.domain.nursetype;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.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 org.hibernate.validator.constraints.Length;

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

/**
 * 护理类型信息对象 nurse_type
 *
 * @author 纪寒
 * @date 2022-09-02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "护理类型信息对象", description = "nurse_type")
public class NurseType extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -9129758108652051712L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    @Excel(name = "创建人id")
    private Long userId;

    /**
     * 护理类型编码
     */
    @ApiModelProperty(value = "护理类型编码")
    @Excel(name = "护理类型编码")
    private String nurseTypeCode;

    /**
     * 护理类型名称
     */
    @ApiModelProperty(value = "护理类型名称")
    @Excel(name = "护理类型名称")
    @Length(max = 50, message = "护理类型名称不能超过50个字符", groups = {Insert.class, Update.class})
    @NotBlank(message = "护理类型名称不能为空", groups = {Insert.class, Update.class})
    private String nurseTypeName;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("nurseTypeCode", getNurseTypeCode())
                .append("nurseTypeName", getNurseTypeName())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
