package com.backendsys.modules.system.entity;

import com.backendsys.config.Mybatis.handler.timezone.LocalDateTimeAdapter;
import com.backendsys.entity.System.SysUserDTO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.gson.annotations.JsonAdapter;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import jakarta.validation.constraints.NotNull;

import java.time.LocalDateTime;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Data
@TableName("sys_user_info")
public class SysUserInfo {

    private Long id;
    @TableId(type = IdType.AUTO)
    private Long user_id;

    @TableField(exist = false)
    private String username;
    @TableField(exist = false)
    private String phone;
    @TableField(exist = false)
    private String phone_area_code;

    private String nickname;
    private String email;
    private Integer gender;
    private String avatar;
    private String last_login_ip;
    private String last_login_uuid;
    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime last_login_time;
    private Integer is_super;

    @TableField(exist = false)
    private Integer integral;       // 积分

    private Double point_balance;
    private String invite_code;
    private Integer status;
    private Integer audit_status;
    private String audit_note;

    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime create_time;
    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime update_time;

    private Integer del_flag;

    @TableField(exist = false)
    private List<Map<String, Object>> roles;

    @TableField(exist = false)
    private List<Long> role_id;

    @TableField(exist = false)
    private List<String> permission_ids;

    @TableField(exist = false)
    private List<Map<String, Object>> menus;

    @TableField(exist = false)
    private String token_expiration;
    @TableField(exist = false)
    private String token;
}
