feat(supply-api): 完善domain层和main入口
修改内容: - cmd/supply-api/main.go: 完善HTTP API入口和路由配置 - go.mod: 更新依赖版本 - domain/account.go: 完善账户领域模型 - domain/package.go: 完善套餐领域模型 - domain/settlement.go: 完善结算领域模型 这些是supply-api的核心domain层实现
This commit is contained in:
@@ -3,6 +3,7 @@ package domain
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"lijiaoqiao/supply-api/internal/audit"
|
||||
@@ -21,21 +22,42 @@ const (
|
||||
|
||||
// 套餐
|
||||
type Package struct {
|
||||
ID int64 `json:"package_id"`
|
||||
SupplierID int64 `json:"supply_account_id"`
|
||||
AccountID int64 `json:"account_id,omitempty"`
|
||||
Model string `json:"model"`
|
||||
TotalQuota float64 `json:"total_quota"`
|
||||
AvailableQuota float64 `json:"available_quota"`
|
||||
ID int64 `json:"package_id"`
|
||||
SupplierID int64 `json:"supply_account_id"`
|
||||
AccountID int64 `json:"account_id,omitempty"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
Model string `json:"model"`
|
||||
TotalQuota float64 `json:"total_quota"`
|
||||
AvailableQuota float64 `json:"available_quota"`
|
||||
SoldQuota float64 `json:"sold_quota"`
|
||||
ReservedQuota float64 `json:"reserved_quota"`
|
||||
PricePer1MInput float64 `json:"price_per_1m_input"`
|
||||
PricePer1MOutput float64 `json:"price_per_1m_output"`
|
||||
MinPurchase float64 `json:"min_purchase,omitempty"`
|
||||
StartAt time.Time `json:"start_at,omitempty"`
|
||||
EndAt time.Time `json:"end_at,omitempty"`
|
||||
ValidDays int `json:"valid_days"`
|
||||
MaxConcurrent int `json:"max_concurrent,omitempty"`
|
||||
RateLimitRPM int `json:"rate_limit_rpm,omitempty"`
|
||||
Status PackageStatus `json:"status"`
|
||||
Version int `json:"version"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
TotalOrders int `json:"total_orders"`
|
||||
TotalRevenue float64 `json:"total_revenue"`
|
||||
Rating float64 `json:"rating"`
|
||||
RatingCount int `json:"rating_count"`
|
||||
|
||||
// 单位与币种 (XR-001)
|
||||
QuotaUnit string `json:"quota_unit"`
|
||||
PriceUnit string `json:"price_unit"`
|
||||
CurrencyCode string `json:"currency_code"`
|
||||
|
||||
// 审计字段 (XR-001)
|
||||
Version int `json:"version"`
|
||||
CreatedIP *netip.Addr `json:"created_ip,omitempty"`
|
||||
UpdatedIP *netip.Addr `json:"updated_ip,omitempty"`
|
||||
AuditTraceID string `json:"audit_trace_id,omitempty"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// 套餐服务接口
|
||||
|
||||
Reference in New Issue
Block a user