Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
18c6686f
Unverified
Commit
18c6686f
authored
Dec 28, 2025
by
Wesley Liddick
Committed by
GitHub
Dec 28, 2025
Browse files
Merge branch 'main' into feature/ui-improvements-clean
parents
386f6da1
fd51ff69
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/internal/server/middleware/api_key_auth_google.go
View file @
18c6686f
...
@@ -8,7 +8,6 @@ import (
...
@@ -8,7 +8,6 @@ import (
"github.com/Wei-Shaw/sub2api/internal/service"
"github.com/Wei-Shaw/sub2api/internal/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
)
// ApiKeyAuthGoogle is a Google-style error wrapper for API key auth.
// ApiKeyAuthGoogle is a Google-style error wrapper for API key auth.
...
@@ -30,7 +29,7 @@ func ApiKeyAuthWithSubscriptionGoogle(apiKeyService *service.ApiKeyService, subs
...
@@ -30,7 +29,7 @@ func ApiKeyAuthWithSubscriptionGoogle(apiKeyService *service.ApiKeyService, subs
apiKey
,
err
:=
apiKeyService
.
GetByKey
(
c
.
Request
.
Context
(),
apiKeyString
)
apiKey
,
err
:=
apiKeyService
.
GetByKey
(
c
.
Request
.
Context
(),
apiKeyString
)
if
err
!=
nil
{
if
err
!=
nil
{
if
errors
.
Is
(
err
,
gorm
.
ErrRecord
NotFound
)
{
if
errors
.
Is
(
err
,
service
.
ErrApiKey
NotFound
)
{
abortWithGoogleError
(
c
,
401
,
"Invalid API key"
)
abortWithGoogleError
(
c
,
401
,
"Invalid API key"
)
return
return
}
}
...
...
frontend/src/api/usage.ts
View file @
18c6686f
...
@@ -152,8 +152,8 @@ export async function getStatsByDateRange(
...
@@ -152,8 +152,8 @@ export async function getStatsByDateRange(
/**
/**
* Get usage by date range
* Get usage by date range
* @param startDate - Start date (
ISO
format)
* @param startDate - Start date (
YYYY-MM-DD
format)
* @param endDate - End date (
ISO
format)
* @param endDate - End date (
YYYY-MM-DD
format)
* @param apiKeyId - Optional API key ID filter
* @param apiKeyId - Optional API key ID filter
* @returns Usage logs within date range
* @returns Usage logs within date range
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment