This commit is contained in:
南浔
2025-08-13 13:39:01 +08:00
43 changed files with 534 additions and 44 deletions
+8 -3
View File
@@ -1,5 +1,6 @@
using Apimanager_backend.Data;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
@@ -57,9 +58,13 @@ namespace Apimanager_backend.Models
public DateTime CreatedAt { get; set; } = DateTime.UtcNow; // timestamp
//导航属性
[JsonIgnore]
public Apipackage? Package { get; set; }
public ICollection<ApiPackageItem> ApiPackageItems { get; set; }
public ICollection<ApiCallLog> ApiCalls { get; set; }
public ICollection<ApiRequestExample> ApiRequestExamples { get; set; }
[JsonIgnore]
public ICollection<ApiPackageItem>? ApiPackageItems { get; set; }
[JsonIgnore]
public ICollection<ApiCallLog>? ApiCalls { get; set; }
[JsonIgnore]
public ICollection<ApiRequestExample>? ApiRequestExamples { get; set; }
}
}
+4 -2
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
@@ -8,9 +9,10 @@ namespace Apimanager_backend.Models
public int Id { get; set; }
public int ApiPackageId { get; set; }
public Apipackage ApiPackage { get; set; } = null!;
[JsonIgnore]
public Apipackage? ApiPackage { get; set; } = null!;
public int ApiId { get; set; }
public Api Api { get; set; } = null!;
public Api? Api { get; set; } = null!;
}
}
+2
View File
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
@@ -45,6 +46,7 @@ namespace Apimanager_backend.Models
//导航属性
public ICollection<Api> Apis { get; set; }
public ICollection<ApiPackageItem> ApiPackageItems { get; set; }
[JsonIgnore]
public ICollection<UserPackage> Packages { get; set; }
}
+3 -3
View File
@@ -2,8 +2,8 @@
{
public enum OrderType
{
Recharge,
Purchase,
Refund
Purchase = 0,
Recharge = 1,
Refund = 2
}
}
+2 -1
View File
@@ -5,6 +5,7 @@
AliPay = 0,
WxPay = 1,
Bank = 2,
QQPay =3
QQPay =3,
balance = 4
}
}
+4
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
@@ -57,9 +58,12 @@ namespace Apimanager_backend.Models
public DateTime CreatedAt { get; set; } = DateTime.UtcNow; // Timestamp
//导航属性
[JsonIgnore]
public ICollection<UserPackage> Packages { get; set; }
[JsonIgnore]
public ICollection<OperationLog> operationLogs { get; set; }
public ICollection<ApiCallLog> CallLogs { get; set; }
[JsonIgnore]
public ICollection<Order> Orders { get; set; }
public ICollection<UserRole> Roles { get; set; } = new List<UserRole>();
public User(int id,string username,string email,string passHash)
+3 -1
View File
@@ -1,4 +1,6 @@
namespace Apimanager_backend.Models
using System.Text.Json.Serialization;
namespace Apimanager_backend.Models
{
public class UserPackage
{/// <summary>