package com.gxwebsoft.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 应用成员
 *
 * @author 科技小王子
 * @since 2026-03-28 21:29:44
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "AppUser对象", description = "应用成员")
public class AppUser implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "关联应用ID")
    private Long websiteId;

    @Schema(description = "用户ID")
    private Integer userId;

    @Schema(description = "用户名（冗余）")
    private String username;

    @Schema(description = "昵称（冗余）")
    private String nickname;

    @Schema(description = "头像（冗余）")
    private String avatar;

    @Schema(description = "手机号（冗余，脱敏存储）")
    private String phone;

    @Schema(description = "角色: owner/admin/developer/viewer")
    private String role;

    @Schema(description = "邀请人用户ID")
    private Long inviteBy;

    @Schema(description = "加入时间")
    private LocalDateTime inviteTime;

    @Schema(description = "排序(数字越小越靠前)")
    private Integer sortNumber;

    @Schema(description = "状态, 0正常, 1冻结")
    private Integer status;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}
