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

import lombok.*;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 会员实体类 - 对应 member_user 表 
 * 
 * @author 付嘉
 * @date 2026-05-01
 */

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

    //会员号
    @Column("member_no")
    private String memberNo;

    //昵称
    @Column("nickname")
    private String nickname;

    //手机号（AES 加密存储
    @Column("phone")
    private String phone;

    //性别
    @Column("gender")
    private Integer gender;

    //生日
    @Column("birthday")
    private LocalDate birthday;

    //地址
    @Column("address")
    private String address;

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

    // 最后登录时间
    @Column("last_login_at")
    private LocalDateTime lastLoginAt;

    // 头像
    @Column("avatar")
    private String avatar;

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

    // 微信OpenID小程序
    @Column("miniapp_open_id")
    private String miniappOpenId;

    // 服务号openid
    @Column("official_open_id")
    private String officialOpenId;

    // 软删除
    @Column("is_deleted")
    private Boolean isDeleted;

}
