package com.reyun.saas.mob.user.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value="WarningConfig",description="预警配置")
public class WarningConfig {
    @ApiModelProperty(value="主键ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value="预警配置名/模板名称")
    private String name;

    @ApiModelProperty(value="模板名称(同时保存模板时的模板名)")
    @Transient
    private String templateName;

    @ApiModelProperty(value="appkey")
    private String appkey;

    @ApiModelProperty(value="渠道cid")
    @Column(name = "cid")
    private String cid;

    @ApiModelProperty(value="渠道id")
    @Column(name = "channel_id")
    private Long channelId;

    @ApiModelProperty(value="计算规则：day按天、hour按小时")
    @Column(name = "data_cycle_rule")
    private String dataCycleRule;

    @ApiModelProperty(value="表达式")
    private String eval;

    @ApiModelProperty(value="关联用户id")
    @Column(name = "user_id")
    private Long userId;

    @ApiModelProperty(value="主用户id")
    @Column(name = "root_parent")
    private Long rootParent;

    @ApiModelProperty(value="1：启用、0：停用 (仅限配置)")
    private Boolean isusing;

    @ApiModelProperty(value="1：删除、0：正常")
    @Column(name = "del_flag")
    private Boolean delFlag;

    @ApiModelProperty(value="最后修改人email")
    @Column(name = "modify_email")
    private String modifyEmail;

    @ApiModelProperty(value="最后修改时间")
    @Column(name = "modify_time")
    private String modifyTime;

    @ApiModelProperty(value="创建人email")
    @Column(name = "create_email")
    private String createEmail;

    @ApiModelProperty(value="创建时间")
    @Column(name = "create_time")
    private String createTime;

    @ApiModelProperty(value="1为模板，2为正常的配置")
    private Boolean template;

    @ApiModelProperty(value="备注")
    private String remark;

    @ApiModelProperty(value="系统类型：1-iOS;2-Android")
    private String os;
}
