更新代码
This commit is contained in:
1 parent
127fc22de5
commit
45829fa267
26 files changed
+139
-90
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using Store.Management.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using RestSharp;
|
||||
using Store.Management.Api.Transport;
|
||||
@@ -13,15 +14,6 @@ public sealed class LoginRequest
|
||||
[StringLength(100)] public string? DeviceName { get; set; }
|
||||
}
|
||||
|
||||
public sealed class LoginResult
|
||||
{
|
||||
public string TokenType { get; init; } = "Bearer";
|
||||
public string Token { get; init; } = "";
|
||||
public uint ExpiresInMinutes { get; init; }
|
||||
}
|
||||
|
||||
public sealed record CurrentUser(string UserName, string? NickName);
|
||||
|
||||
public sealed class AuthApi(ApiTransport transport, TokenSession session)
|
||||
{
|
||||
// 登录和退出串行执行,避免迟到的登录响应覆盖退出操作。
|
||||
|
||||
@@ -7,7 +7,6 @@ public sealed class ApiResult<T>
|
||||
public string? TraceId { get; init; }
|
||||
public T? Data { get; init; }
|
||||
}
|
||||
|
||||
public sealed record PageResult<T>(long Total, IReadOnlyList<T> Items);
|
||||
|
||||
public class PageRequest
|
||||
|
||||
@@ -4,4 +4,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Store.Management.Models\Store.Management.Models.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +1,7 @@
|
||||
using RestSharp;
|
||||
using Store.Management.Api.Models;
|
||||
using Store.Management.Api.Transport;
|
||||
using Store.Management.Models;
|
||||
|
||||
namespace Store.Management.Api.Users;
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Management.Api.Users
|
||||
{
|
||||
public enum UserGroup : byte
|
||||
{
|
||||
/// <summary>主号。</summary>
|
||||
[Description("主号")] MainAccount = 3,
|
||||
/// <summary>客服。</summary>
|
||||
[Description("客服")] CustomerService = 4,
|
||||
/// <summary>加盟(旧系统分组 5)。</summary>
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Store.Management.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
using Store.Management.Api.Models;
|
||||
@@ -32,12 +33,6 @@ public sealed class UserCreateRequest : UserEditRequest
|
||||
|
||||
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; }
|
||||
@@ -57,28 +52,3 @@ public sealed class UserBillingUpdateRequest
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public decimal? SyncLogisticsPerOrder { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>管理端当前使用的用户资料字段;不接收密码。</summary>
|
||||
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; }
|
||||
[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