campus-errand/server/Models/User.cs
2026-04-01 12:50:17 +08:00

45 lines
1.1 KiB
C#
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.

using System.ComponentModel.DataAnnotations;
namespace CampusErrand.Models;
/// <summary>
/// 用户表
/// </summary>
public class User
{
[Key]
public int Id { get; set; }
/// <summary>展示用 UID随机6位数字</summary>
[MaxLength(10)]
public string Uid { get; set; } = string.Empty;
/// <summary>微信 OpenID</summary>
[MaxLength(128)]
public string OpenId { get; set; } = string.Empty;
/// <summary>手机号</summary>
[MaxLength(20)]
public string Phone { get; set; } = string.Empty;
/// <summary>昵称</summary>
[MaxLength(64)]
public string Nickname { get; set; } = string.Empty;
/// <summary>头像</summary>
[MaxLength(512)]
public string AvatarUrl { get; set; } = string.Empty;
/// <summary>角色</summary>
public UserRole Role { get; set; } = UserRole.User;
/// <summary>跑腿评分,默认 80</summary>
public int RunnerScore { get; set; } = 80;
/// <summary>是否被封禁</summary>
public bool IsBanned { get; set; }
/// <summary>创建时间</summary>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}