提交用户部分代码
This commit is contained in:
1 parent
9b9e4cbd82
commit
127fc22de5
26 files changed
+1110
-206
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
using Store.Management.Api.Models;
|
||||
|
||||
namespace Store.Management.Api.Users;
|
||||
@@ -12,6 +13,10 @@ public sealed class UserSearchRequest : PageRequest
|
||||
|
||||
public class UserEditRequest
|
||||
{
|
||||
public UserGroup? GroupId { get; set; }
|
||||
public UserAdminLevel? SaLevel { get; set; }
|
||||
[StringLength(50)] public string? OemId { get; set; }
|
||||
[StringLength(1000)] public string? Authority { get; set; }
|
||||
[StringLength(50)] public string? NickName { get; set; }
|
||||
[StringLength(30)] public string? Mobile { get; set; }
|
||||
[StringLength(100)] public string? CompanyName { get; set; }
|
||||
@@ -25,11 +30,34 @@ public sealed class UserCreateRequest : UserEditRequest
|
||||
[StringLength(20)] public string? ParentUserName { get; set; }
|
||||
}
|
||||
|
||||
public sealed record ChangePasswordRequest(string UserName, string NewPassword, string? OldPassword = null);
|
||||
|
||||
public enum UserAdminLevel : short
|
||||
{
|
||||
[System.ComponentModel.Description("普通用户")] Normal = 0,
|
||||
[System.ComponentModel.Description("超级管理员")] SuperAdmin = 1
|
||||
}
|
||||
|
||||
public sealed class UserUpdateRequest : UserEditRequest
|
||||
{
|
||||
[Range(1, int.MaxValue)] public int Id { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UserBillingUpdateRequest
|
||||
{
|
||||
[Range(1, int.MaxValue)] public int Id { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? ShopPointsPerMonth { get; set; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public decimal? PostagePerOrder { get; set; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public decimal? RefundPostagePerOrder { get; set; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public decimal? GiftOemAmountPerOrder { get; set; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public decimal? SyncLogisticsPerOrder { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>管理端当前使用的用户资料字段;不接收密码。</summary>
|
||||
public sealed class UserInfo
|
||||
{
|
||||
@@ -41,6 +69,16 @@ public sealed class UserInfo
|
||||
public string? Notes { get; init; }
|
||||
public string? ParentUserName { get; init; }
|
||||
public int GroupId { get; init; }
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public UserGroup? Group => GroupId is >= byte.MinValue and <= byte.MaxValue ? (UserGroup)GroupId : null;
|
||||
public UserAdminLevel? SaLevel { get; init; }
|
||||
public string? OemId { get; init; }
|
||||
public string? Authority { get; init; }
|
||||
public int ShopPointsPerMonth { get; init; }
|
||||
public decimal? PostagePerOrder { get; init; }
|
||||
public decimal? RefundPostagePerOrder { get; init; }
|
||||
public decimal? GiftOemAmountPerOrder { get; init; }
|
||||
public decimal? SyncLogisticsPerOrder { get; init; }
|
||||
public decimal Points { get; init; }
|
||||
public decimal? Balance { get; init; }
|
||||
}
|
||||
Reference in new issue
Block a user