package cn.novalon.gym.manage.member.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.time.LocalDateTime;

/**
 * 微信用户信息
 * 
 * @author 付嘉
 * @date 2026-05-01
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("wechat_user")
public class WechatUser extends BaseEntity {

    // 会员 ID
    @Column("member_id")
    private Long memberId;

    // 微信 UnionID
    @Column("union_id")
    private String unionId;

    // 小程序 OpenID
    @Column("miniapp_openid")
    private String miniappOpenid;

    // 服务号 OpenID
    @Column("mp_openid")
    private String mpOpenid;

    // 是否关注服务号
    @Column("is_subscribed")
    private Boolean isSubscribed;

    // 首次关注时间公众号的时间
    @Column("subscribe_time")
    private LocalDateTime subscribeTime;

    // 最后一次取消关注的时间
    @Column("unsubscribe_time")
    private LocalDateTime unsubscribeTime;
}
