package com.kym.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 故障通知订阅表
 *
 * @author skyline
 */
@Getter
@Setter
@TableName("t_fault_subscriber")
@Accessors(chain = true)
public class FaultSubscriber extends BaseEntity<FaultSubscriber> {

    private static final long serialVersionUID = 1L;

    public static final int STATUS_已解绑 = 0;
    public static final int STATUS_已订阅 = 1;

    /**
     * 微信公众号openid
     */
    private String openid;

    /**
     * 微信昵称（冗余显示）
     */
    private String nickname;

    /**
     * 站点ID
     */
    private String stationId;

    /**
     * 状态：0-已解绑，1-已订阅
     */
    private Integer status;

    /**
     * 绑定时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime subscribeTime;

    /**
     * 解绑时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime unbindTime;

    /**
     * 站点名称（非数据库字段，仅用于前端展示）
     */
    @TableField(exist = false)
    private String stationName;
}
