diff options
| author | sinner <[email protected]> | 2026-08-05 01:21:17 +0000 |
|---|---|---|
| committer | sinner <[email protected]> | 2026-08-05 01:21:17 +0000 |
| commit | 4c6c8e86565ac49d1bd1c64e17c1404f4517d200 (patch) | |
| tree | 9f079e106a3f01f5d227c407e3d984a38bb2a8e9 /internal/models | |
| parent | 2875e578f5e22ae0971d057819f1ab4362b4d115 (diff) | |
| download | dborg-4c6c8e86565ac49d1bd1c64e17c1404f4517d200.tar.gz dborg-4c6c8e86565ac49d1bd1c64e17c1404f4517d200.zip | |
Diffstat (limited to 'internal/models')
| -rw-r--r-- | internal/models/admin.go | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/internal/models/admin.go b/internal/models/admin.go index 7d774a8..96403af 100644 --- a/internal/models/admin.go +++ b/internal/models/admin.go @@ -57,3 +57,57 @@ type AdminResponse struct { Account *Account `json:"account,omitempty"` Accounts []Account `json:"accounts,omitempty"` } + +// credit_usage_log models + +type CreditUsageLog struct { + ID int64 `json:"id"` + AccountID int64 `json:"account_id"` + AccountName string `json:"account_name"` + Endpoint string `json:"endpoint"` + Path string `json:"path"` + Method string `json:"method"` + EndpointCost int64 `json:"endpoint_cost"` + CreditsCharged int64 `json:"credits_charged"` + StatusCode int64 `json:"status_code"` + CreatedAt string `json:"created_at"` +} + +type CreditUsageLogsResponse struct { + Logs []CreditUsageLog `json:"logs"` + Count int `json:"count"` + Error string `json:"error,omitempty"` +} + +type CreditUsageEndpointStat struct { + Endpoint string `json:"endpoint"` + TotalCalls int64 `json:"total_calls"` + SuccessCalls int64 `json:"success_calls"` + EndpointCost int64 `json:"endpoint_cost"` + TotalCharged int64 `json:"total_charged"` +} + +type CreditUsageByEndpointResponse struct { + From string `json:"from"` + To string `json:"to"` + Endpoints []CreditUsageEndpointStat `json:"endpoints"` + Count int `json:"count"` + Error string `json:"error,omitempty"` +} + +type CreditUsageAccountStat struct { + AccountID int64 `json:"account_id"` + AccountName string `json:"account_name"` + Endpoint string `json:"endpoint"` + TotalCalls int64 `json:"total_calls"` + TotalCharged int64 `json:"total_charged"` + LastCall string `json:"last_call"` +} + +type CreditUsageByAccountResponse struct { + From string `json:"from"` + To string `json:"to"` + Accounts []CreditUsageAccountStat `json:"accounts"` + Count int `json:"count"` + Error string `json:"error,omitempty"` +} |
