fix: JSON_CONTAINS 参数类型修复 + API sync

- 修复 JSON_CONTAINS(node_group_ids, int64) 类型错误,改为传 JSON 字符串
- 添加 node_group_ids IS NOT NULL 兼容判断,防止 NULL 列报错
- 同步 apis/ 及 routes.go、compat_types.go 改动

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-03-23 06:58:28 -07:00
parent f703b5089a
commit f111b36389
8 changed files with 131 additions and 13 deletions
+4
View File
@@ -163,5 +163,9 @@ service ppanel {
@doc "Query quota task list"
@handler QueryQuotaTaskList
get /quota/list (QueryQuotaTaskListRequest) returns (QueryQuotaTaskListResponse)
@doc "Query quota task status"
@handler QueryQuotaTaskStatus
post /quota/status (QueryQuotaTaskStatusRequest) returns (QueryQuotaTaskStatusResponse)
}
+5 -5
View File
@@ -58,14 +58,14 @@ type (
}
// Email login request
EmailLoginRequest {
Identifier string `json:"identifier"`
Email string `json:"email" validate:"required"`
Code string `json:"code" validate:"required"`
Invite string `json:"invite,optional"`
Identifier string `json:"identifier" form:"identifier"`
Email string `json:"email" form:"email" validate:"required,email"`
Code string `json:"code" form:"code" validate:"required"`
Invite string `json:"invite,optional" form:"invite"`
IP string `header:"X-Original-Forwarded-For"`
UserAgent string `header:"User-Agent"`
LoginType string `header:"Login-Type"`
CfToken string `json:"cf_token,optional"`
CfToken string `json:"cf_token,optional" form:"cf_token"`
}
LoginResponse {
Token string `json:"token"`
+62
View File
@@ -96,6 +96,48 @@ type (
Message string `json:"message,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
}
GetDownloadLinkRequest {
InviteCode string `form:"invite_code,optional"`
Platform string `form:"platform" validate:"required,oneof=windows mac ios android"`
}
GetDownloadLinkResponse {
Url string `json:"url"`
}
ContactRequest {
Name string `json:"name" validate:"required,max=100"`
Email string `json:"email" validate:"required,email"`
OtherContact string `json:"other_contact" validate:"max=200"`
Notes string `json:"notes" validate:"max=2000"`
}
ReportLogMessageRequest {
Platform string `json:"platform" validate:"required,max=32"`
AppVersion string `json:"app_version" validate:"required,max=64"`
OsName string `json:"os_name" validate:"max=64"`
OsVersion string `json:"os_version" validate:"max=64"`
DeviceId string `json:"device_id" validate:"required,max=255"`
UserId int64 `json:"user_id"`
SessionId string `json:"session_id" validate:"max=255"`
Level uint8 `json:"level"`
ErrorCode string `json:"error_code" validate:"max=128"`
Message string `json:"message" validate:"required,max=65535"`
Stack string `json:"stack" validate:"max=1048576"`
Context interface{} `json:"context"`
OccurredAt int64 `json:"occurred_at"`
}
ReportLogMessageResponse {
Id int64 `json:"id"`
}
LegacyCheckVerificationCodeRequest {
Method string `json:"method" form:"method" validate:"omitempty,oneof=email mobile"`
Account string `json:"account" form:"account"`
Email string `json:"email" form:"email"`
Code string `json:"code" form:"code" validate:"required"`
Type uint8 `json:"type" form:"type" validate:"required"`
}
LegacyCheckVerificationCodeResponse {
Status bool `json:"status"`
Exist bool `json:"exist"`
}
)
@server (
@@ -143,5 +185,25 @@ service ppanel {
@doc "Heartbeat"
@handler Heartbeat
get /heartbeat returns (HeartbeatResponse)
@doc "Get Download Link"
@handler GetDownloadLink
get /client/download (GetDownloadLinkRequest) returns (GetDownloadLinkResponse)
@doc "Submit Contact"
@handler SubmitContact
post /contact (ContactRequest)
@doc "Report log message"
@handler ReportLogMessage
post /log/report (ReportLogMessageRequest) returns (ReportLogMessageResponse)
@doc "Check verification code (legacy v1)"
@handler CheckCodeLegacy
post /check_code (LegacyCheckVerificationCodeRequest) returns (LegacyCheckVerificationCodeResponse)
@doc "Check verification code (legacy v2, consume code)"
@handler CheckCodeLegacyV2
post /check_code/v2 (LegacyCheckVerificationCodeRequest) returns (LegacyCheckVerificationCodeResponse)
}
+4
View File
@@ -71,5 +71,9 @@ service ppanel {
@doc "Get user subscribe node info"
@handler QueryUserSubscribeNodeList
get /node/list returns (QueryUserSubscribeNodeListResponse)
@doc "Get subscribe group list"
@handler QuerySubscribeGroupList
get /group/list returns (QuerySubscribeGroupListResponse)
}
+21 -1
View File
@@ -220,6 +220,22 @@ type (
FriendlyCount int64 `json:"friendly_count"`
HistoryCount int64 `json:"history_count"`
}
GetUserTrafficStatsRequest {
UserSubscribeId string `form:"user_subscribe_id" validate:"required"`
Days int `form:"days" validate:"required,oneof=7 30"`
}
DailyTrafficStats {
Date string `json:"date"`
Upload int64 `json:"upload"`
Download int64 `json:"download"`
Total int64 `json:"total"`
}
GetUserTrafficStatsResponse {
List []DailyTrafficStats `json:"list"`
TotalUpload int64 `json:"total_upload"`
TotalDownload int64 `json:"total_download"`
TotalTraffic int64 `json:"total_traffic"`
}
)
@server (
@@ -374,11 +390,15 @@ service ppanel {
@doc "Get Subscribe Status"
@handler GetSubscribeStatus
get /subscribe_status (GetSubscribeStatusRequest) returns (GetSubscribeStatusResponse)
post /subscribe_status (GetSubscribeStatusRequest) returns (GetSubscribeStatusResponse)
@doc "Get User Invite Stats"
@handler GetUserInviteStats
get /invite_stats (GetUserInviteStatsRequest) returns (GetUserInviteStatsResponse)
@doc "Get User Traffic Statistics"
@handler GetUserTrafficStats
get /traffic_stats (GetUserTrafficStatsRequest) returns (GetUserTrafficStatsResponse)
}
@server (