Files
label_backend/src/main/java/com/label/entity/SysUser.java
2026-04-15 15:28:11 +08:00

61 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.label.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 系统用户实体,对应 sys_user 表。
* role 取值UPLOADER / ANNOTATOR / REVIEWER / ADMIN
* status 取值ACTIVE / DISABLED
*/
@Data
@TableName("sys_user")
@Schema(description = "系统用户")
public class SysUser {
/** 用户主键,自增 */
@TableId(type = IdType.AUTO)
@Schema(description = "用户主键", example = "1")
private Long id;
/** 所属公司 ID多租户键 */
@Schema(description = "所属公司 ID", example = "1")
private Long companyId;
/** 登录用户名(同公司内唯一) */
@Schema(description = "登录用户名", example = "admin")
private String username;
/**
* BCrypt 哈希密码strength ≥ 10
* 序列化时排除,防止密码哈希泄漏到 API 响应。
*/
@JsonIgnore
@Schema(description = "密码哈希(不会在响应中返回)")
private String passwordHash;
/** 真实姓名 */
@Schema(description = "真实姓名", example = "张三")
private String realName;
/** 角色UPLOADER / ANNOTATOR / REVIEWER / ADMIN */
@Schema(description = "角色", example = "ADMIN")
private String role;
/** 状态ACTIVE / DISABLED */
@Schema(description = "状态", example = "ACTIVE")
private String status;
@Schema(description = "创建时间", example = "2026-04-15T12:34:56")
private LocalDateTime createdAt;
@Schema(description = "更新时间", example = "2026-04-15T12:34:56")
private LocalDateTime updatedAt;
}