package com.qmth.teachcloud.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.contant.SystemConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 全局异常错误信息表
 * </p>
 *
 * @author wangliang
 * @since 2021-03-24
 */
@ApiModel(value = "TGError对象", description = "全局异常错误信息表")
public class TGError implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    @TableId(value = "id")
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "学校id")
    @TableField(value = "school_id")
    private Long schoolId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "机构id")
    @TableField(value = "org_id")
    private Long orgId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "实体id")
    @TableField("obj_id")
    private Long objId;

    @ApiModelProperty(value = "实时摘要信息")
    @TableField("summary")
    private String summary;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)//新增执行
    private Long createTime;

    public TGError() {

    }

    public TGError(Long objId, String summary) {
        this.id = SystemConstant.getDbUuid();
        this.objId = objId;
        this.summary = summary;
        this.createTime = System.currentTimeMillis();
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getObjId() {
        return objId;
    }

    public void setObjId(Long objId) {
        this.objId = objId;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
}
