| package com.example.g8backend.entity; |
| |
| 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 lombok.Data; |
| import lombok.experimental.Accessors; |
| |
| import java.time.LocalDate; |
| import java.time.LocalDateTime; |
| |
| @Data |
| @TableName("users") |
| @Accessors(chain = true) |
| public class User { |
| @TableId(type = IdType.AUTO) |
| private Long userId; |
| |
| private String passkey; |
| private String password; |
| private String userName; |
| private String email; |
| private String userLevel; // 用户等级(lv1/lv2/lv3/vip) |
| private Integer signinCount; |
| private LocalDate lastSigninDate; |
| private String role; |
| // private String avatarUrl; // 头像 URL 或文件名 |
| @TableField("is_banned") |
| private Boolean isBanned = false; |
| |
| @TableField("banned_reason") |
| private String bannedReason; |
| |
| @TableField("banned_at") |
| private LocalDateTime bannedAt; |
| |
| @TableField("banned_by") |
| private Long bannedBy; |
| |
| |
| @Override |
| public String toString() { |
| return "User{" + |
| "id=" + userId + |
| ", name='" + userName + '\'' + |
| ", email='" + email + '\'' + |
| '}'; |
| } |
| } |