package com.repair.model.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author ceshi
 * @since 2023-07-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="RepairSystemSetting对象", description="")
public class RepairSystemSetting implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "工单完成后多少小时，用户未评价系统默认好评")
    private Integer hour;

    @ApiModelProperty(value = "工单完成后多少天，用户未评价系统默认好评")
    @TableField(exist = false)
    @NotNull(message = "自动好评时间设置不能为空")
    private Integer day;

    public Integer getDay() {
        return (hour == null ? day : hour / 24);
    }

    public void setDay(Integer day) {
        this.day = day;
    }

    @ApiModelProperty(value = "黄家湖紧急电话")
    @NotBlank(message = "黄家湖紧急电话不能为空")
    private String emergencyCall;

    @ApiModelProperty(value = "墨轩湖紧急电话")
    @NotBlank(message = "墨轩湖紧急电话不能为空")
    private String emergencyMxh;


    @ApiModelProperty(value = "服务监督电话")
    @NotBlank(message = "服务监督电话不能为空")
    private String servicePhone;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "创建人员")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    @ApiModelProperty(value = "更新人员")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    @ApiModelProperty(value = "逻辑删除 未删除：0；删除：1")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleted;


}
