package com.ruoyi.ss.abnormal.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.utils.RegexpUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 设备故障对象 ss_abnormal
 *
 * @author ruoyi
 * @date 2024-04-30
 */
@Data
public class Abnormal extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 异常id */
    @ApiModelProperty("异常id")
    private Long abnormalId;

    @ApiModelProperty("用户id（提交人）")
    private Long userId;

    @ApiModelProperty("设备ID")
    private Long deviceId;

    /** 故障描述 */
    @ApiModelProperty("故障描述")
    @Excel(name = "故障描述")
    @NotNull(message = "故障描述不允许为空", groups = {ValidGroup.FrontCreate.class})
    @Size(max = 1000, message = "故障描述长度不能超过1000个字符")
    private String content;

    /** 姓名 */
    @ApiModelProperty("姓名")
    @Excel(name = "姓名")
    @Size(max = 60, message = "姓名长度不能超过60个字符")
    private String name;

    /** 联系电话 */
    @ApiModelProperty("联系电话")
    @Excel(name = "联系电话")
    @Size(min = 11, max = 11, message = "联系电话必须是11个字符")
    @Pattern(regexp = RegexpUtils.MOBILE_PHONE_REGEXP, message = "联系电话格式错误")
    private String mobile;

    /** 联系地址 */
    @ApiModelProperty("联系地址")
    @Excel(name = "联系地址")
    @Size(max = 200, message = "联系地址长度不能超过200个字符")
    private String address;

    @ApiModelProperty("状态：1-未读，2-已读")
    private String status;
}
