This commit is contained in:
南浔
2025-07-31 22:52:41 +08:00
73 changed files with 7108 additions and 16 deletions
+1
View File
@@ -58,6 +58,7 @@ namespace Apimanager_backend.Models
//导航属性
public Apipackage? Package { get; set; }
public ICollection<ApiPackageItem> ApiPackageItems { get; set; }
public ICollection<ApiCallLog> ApiCalls { get; set; }
public ICollection<ApiRequestExample> ApiRequestExamples { get; set; }
}
@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Apimanager_backend.Models
{
[Table("ApiPackageItem")]
public class ApiPackageItem
{
public int Id { get; set; }
public int ApiPackageId { get; set; }
public Apipackage ApiPackage { get; set; } = null!;
public int ApiId { get; set; }
public Api Api { get; set; } = null!;
}
}
+2
View File
@@ -44,6 +44,8 @@ namespace Apimanager_backend.Models
//导航属性
public ICollection<Api> Apis { get; set; }
public ICollection<ApiPackageItem> ApiPackageItems { get; set; }
public ICollection<UserPackage> Packages { get; set; }
}
}
+13 -1
View File
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace Apimanager_backend.Models
{
[Index(nameof(OrderNumber), IsUnique = true)]
public class Order
{
/// <summary>
@@ -30,6 +31,9 @@ namespace Apimanager_backend.Models
/// 订单金额
/// </summary>
public decimal Amount { get; set; } // decimal(10, 2)
//支付方式
public PaymentType PaymentType { get; set; }
/// <summary>
/// 订单类型
@@ -46,16 +50,24 @@ namespace Apimanager_backend.Models
/// </summary>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow; // timestamp
//支付完成时间
public DateTime? PaiAt { get; set; }
/// <summary>
/// 更新时间,订单状态更新时间
/// </summary>
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; // timestamp
public DateTime? UpdatedAt { get; set; } = DateTime.UtcNow; // timestamp
/// <summary>
/// 订单描述,可选的详细信息
/// </summary>
public string? Description { get; set; } // varchar(255)
/// <summary>
/// 软删除
/// </summary>
public bool IsDeleted { get; set; } = false;
//导航属性
public User? User { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
namespace Apimanager_backend.Models
{
public enum PayType
{
None = 0,
Official = 1,
Epay = 2
}
}
@@ -0,0 +1,43 @@
using System.ComponentModel.DataAnnotations;
namespace Apimanager_backend.Models
{
public class PaymentConfig
{
public int Id { get; set; }
/// <summary>支付方式(如 Alipay、WeChat、Stripe...</summary>
[Required]
public PaymentType Method { get; set; } // varchar(50)
//接口类型:官方/易支付等
public string? Url { get; set; }
[Required]
public PayType PayType { get; set; }
/// <summary>商户号或 AppId</summary>
public string? AppId { get; set; }
/// <summary>商户密钥 / 私钥</summary>
public string? SecretKey { get; set; }
/// <summary>公钥(如支付宝公钥)</summary>
public string? PublicKey { get; set; }
/// <summary>回调地址(notify_url</summary>
public string? NotifyUrl { get; set; }
/// <summary>支付网关地址(gateway URL</summary>
public string? GatewayUrl { get; set; }
/// <summary>是否启用此配置</summary>
public bool IsEnabled { get; set; } = true;
/// <summary>额外配置项,JSON 格式可扩展</summary>
public string? ExtraSettingsJson { get; set; } // 可包含 cert 路径、支付版本等
/// <summary>备注</summary>
public string? Description { get; set; }
}
}
@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace Apimanager_backend.Models
{
public class PaymentConfigDto
{
public int Id { get; set; }
/// <summary>支付方式(如 Alipay、WeChat、Stripe...</summary>
public PaymentType Method { get; set; } // varchar(50)
/// <summary>备注</summary>
public string? Description { get; set; }
}
}
+10
View File
@@ -0,0 +1,10 @@
namespace Apimanager_backend.Models
{
public enum PaymentType
{
AliPay = 0,
WxPay = 1,
Bank = 2,
QQPay =3
}
}
+1
View File
@@ -14,6 +14,7 @@ namespace Apimanager_backend.Models
/// </summary>
[Required]
public string Username { get; set; } // varchar(20)
public string? Avatar { get; set; }
/// <summary>
/// 邮箱,唯一
+1 -1
View File
@@ -10,6 +10,6 @@ namespace Apimanager_backend.Models
//导航属性
[JsonIgnore]
public User User { get; set; }
public User? User { get; set; }
}
}