using System.ComponentModel.DataAnnotations; using Store.Management.Api.Models; namespace Store.Management.Api.Users; public sealed class UserSearchRequest : PageRequest { [StringLength(100)] public string? Keyword { get; set; } public int? GroupId { get; set; } [StringLength(20)] public string? ParentUserName { get; set; } } public class UserEditRequest { [StringLength(50)] public string? NickName { get; set; } [StringLength(30)] public string? Mobile { get; set; } [StringLength(100)] public string? CompanyName { get; set; } [StringLength(255)] public string? Notes { get; set; } } public sealed class UserCreateRequest : UserEditRequest { [Required, StringLength(20)] public string UserName { get; set; } = ""; [Required, StringLength(128, MinimumLength = 6)] public string Password { get; set; } = ""; [StringLength(20)] public string? ParentUserName { get; set; } } public sealed class UserUpdateRequest : UserEditRequest { [Range(1, int.MaxValue)] public int Id { get; set; } } /// 管理端当前使用的用户资料字段;不接收密码。 public sealed class UserInfo { public int Id { get; init; } public string UserName { get; init; } = ""; public string? NickName { get; init; } public string? Mobile { get; init; } public string? CompanyName { get; init; } public string? Notes { get; init; } public string? ParentUserName { get; init; } public int GroupId { get; init; } public decimal Points { get; init; } public decimal? Balance { get; init; } }