fix(api): standardize formatting and add missing newlines in API files

This commit is contained in:
Chang lue Tsen 2025-07-05 14:30:05 -04:00
parent 987e25e7ac
commit 1a849fd461
41 changed files with 140 additions and 131 deletions

View File

@ -75,4 +75,5 @@ service ppanel {
@doc "Get Ads Detail"
@handler GetAdsDetail
get /detail (GetAdsDetailRequest) returns (Ads)
}
}

View File

@ -72,4 +72,5 @@ service ppanel {
@doc "Get announcement"
@handler GetAnnouncement
get /detail (GetAnnouncementRequest) returns (Announcement)
}
}

View File

@ -25,7 +25,6 @@ type (
GetAuthMethodListResponse {
List []AuthMethodConfig `json:"list"`
}
TestSmsSendRequest {
AreaCode string `json:"area_code" validate:"required"`
Telephone string `json:"telephone" validate:"required"`
@ -69,4 +68,5 @@ service ppanel {
@doc "Get email support platform"
@handler GetEmailPlatform
get /email_platform returns (PlatformResponse)
}
}

View File

@ -84,4 +84,5 @@ service ppanel {
@doc "Query ticket wait reply"
@handler QueryTicketWaitReply
get /ticket returns (TicketWaitRelpyResponse)
}
}

View File

@ -81,4 +81,5 @@ service ppanel {
@doc "Get coupon list"
@handler GetCouponList
get /list (GetCouponListRequest) returns (GetCouponListResponse)
}
}

View File

@ -1,9 +1,10 @@
syntax = "v1"
info(
info (
title: "Device API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
)

View File

@ -36,4 +36,5 @@ service ppanel {
@doc "Get message log list"
@handler GetMessageLogList
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
}
}

View File

@ -64,4 +64,5 @@ service ppanel {
@doc "Update order status"
@handler UpdateOrderStatus
put /status (UpdateOrderStatusRequest)
}
}

View File

@ -77,4 +77,5 @@ service ppanel {
@doc "Get supported payment platform"
@handler GetPaymentPlatform
get /platform returns (PlatformResponse)
}
}

View File

@ -186,4 +186,5 @@ service ppanel {
@doc "Get rule group list"
@handler GetRuleGroupList
get /rule_group_list returns (GetRuleGroupResponse)
}
}

View File

@ -88,13 +88,10 @@ type (
GroupId int64 `form:"group_id,omitempty"`
Search string `form:"search,omitempty"`
}
SubscribeItem {
Subscribe
Sold int64 `json:"sold"`
}
GetSubscribeListResponse {
List []SubscribeItem `json:"list"`
Total int64 `json:"total"`
@ -160,4 +157,5 @@ service ppanel {
@doc "Subscribe sort"
@handler SubscribeSort
post /sort (SubscribeSortRequest)
}
}

View File

@ -201,4 +201,5 @@ service ppanel {
@doc "Update Verify Code Config"
@handler UpdateVerifyCodeConfig
put /verify_code_config (VerifyCodeConfig)
}
}

View File

@ -58,4 +58,5 @@ service ppanel {
@doc "Create ticket follow"
@handler CreateTicketFollow
post /follow (CreateTicketFollowRequest)
}
}

View File

@ -1,7 +1,7 @@
syntax = "v1"
info(
title: "Tools Api"
info (
title: "Tools Api"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
@ -21,7 +21,6 @@ type (
group: admin/tool
middleware: AuthMiddleware
)
service ppanel {
@doc "Get System Log"
@handler GetSystemLog
@ -30,4 +29,5 @@ service ppanel {
@doc "Restart System"
@handler RestartSystem
get /restart
}
}

View File

@ -274,4 +274,5 @@ service ppanel {
@doc "Get user login logs"
@handler GetUserLoginLogs
get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse)
}
}

View File

@ -19,4 +19,5 @@ service ppanel {
@doc "Query announcement"
@handler QueryAnnouncement
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
}
}

View File

@ -1,10 +1,10 @@
syntax = "v1"
info(
title: "App Auth Api"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
info (
title: "App Auth Api"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
@ -75,7 +75,7 @@ type (
}
)
@server(
@server (
prefix: v1/app/auth
group: app/auth
middleware: AppMiddleware
@ -100,4 +100,5 @@ service ppanel {
@doc "GetAppConfig"
@handler GetAppConfig
post /config (AppConfigRequest) returns (AppConfigResponse)
}
}

View File

@ -1,6 +1,6 @@
syntax = "v1"
info(
info (
title: "Document API"
desc: "API for ppanel"
author: "Tension"
@ -15,7 +15,6 @@ import "../types.api"
group: app/document
middleware: AppMiddleware,AuthMiddleware
)
service ppanel {
@doc "Get document list"
@handler QueryDocumentList
@ -24,4 +23,5 @@ service ppanel {
@doc "Get document detail"
@handler QueryDocumentDetail
get /detail (QueryDocumentDetailRequest) returns (Document)
}
}

View File

@ -1,7 +1,7 @@
syntax = "v1"
info(
title: "App Node Api"
info (
title: "App Node Api"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
@ -15,11 +15,9 @@ type (
Total int64 `json:"total"`
List []ServerRuleGroup `json:"list"`
}
AppUserSubscbribeNodeRequest {
Id int64 `form:"id" validate:"required"`
}
AppUserSubscbribeNodeResponse {
List []AppUserSubscbribeNode `json:"list"`
}
@ -30,15 +28,13 @@ type (
group: app/node
middleware: AppMiddleware,AuthMiddleware
)
service ppanel {
@doc "Get Node list"
@handler GetNodeList
get /list (AppUserSubscbribeNodeRequest) returns(AppUserSubscbribeNodeResponse)
get /list (AppUserSubscbribeNodeRequest) returns (AppUserSubscbribeNodeResponse)
@doc "Get rule group list"
@handler GetRuleGroupList
get /rule_group_list returns (AppRuleGroupListResponse)
get /rule_group_list returns (AppRuleGroupListResponse)
}
}

View File

@ -53,4 +53,5 @@ service ppanel {
@doc "Get order list"
@handler QueryOrderList
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
}
}

View File

@ -19,4 +19,5 @@ service ppanel {
@doc "Get available payment methods"
@handler GetAvailablePaymentMethods
get /methods returns (GetAvailablePaymentMethodsResponse)
}
}

View File

@ -1,10 +1,10 @@
syntax = "v1"
info(
title: "Subscribe API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
info (
title: "Subscribe API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
@ -14,35 +14,29 @@ type (
QueryUserSubscribeResp {
Data []UserSubscribeData `json:"data"`
}
UserSubscribeData {
SubscribeId int64 `json:"subscribe_id"`
UserSubscribeId int64 `json:"user_subscribe_id"`
}
UserSubscribeResetPeriodRequest {
UserSubscribeId int64 `json:"user_subscribe_id"`
}
UserSubscribeResetPeriodResponse {
Status bool `json:"status"`
}
AppUserSubscribeRequest {
ContainsNodes *bool `form:"contains_nodes"`
}
AppUserSubscbribeResponse {
List []AppUserSubcbribe `json:"list"`
}
)
@server(
@server (
prefix: v1/app/subscribe
group: app/subscribe
middleware: AppMiddleware,AuthMiddleware
)
service ppanel {
@doc "Get subscribe list"
@handler QuerySubscribeList
@ -67,4 +61,5 @@ service ppanel {
@doc "Reset user subscription period"
@handler ResetUserSubscribePeriod
post /reset/period (UserSubscribeResetPeriodRequest) returns (UserSubscribeResetPeriodResponse)
}
}

View File

@ -33,12 +33,10 @@ type (
Method string `json:"method" validate:"required" validate:"required,oneof=email telephone device"`
Code string `json:"code"`
}
GetUserOnlineTimeStatisticsResponse {
WeeklyStats []WeeklyStat `json:"weekly_stats"`
ConnectionRecords ConnectionRecords `json:"connection_records"`
}
WeeklyStat {
Day int `json:"day"`
DayName string `json:"day_name"`
@ -84,5 +82,5 @@ service ppanel {
@doc "Query User Affiliate Count"
@handler QueryUserAffiliate
get /affiliate/count returns (QueryUserAffiliateCountResponse)
}
}

View File

@ -1,21 +1,21 @@
syntax = "v1"
info(
title: "App Heartbeat Api"
info (
title: "App Heartbeat Api"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
@server(
@server (
prefix: v1/app/ws
group: app/ws
middleware: AuthMiddleware
)
service ppanel {
@doc "App heartbeat"
@handler AppWs
get /:userid/:identifier
}
}

View File

@ -54,12 +54,10 @@ type (
OAuthLoginResponse {
Redirect string `json:"redirect"`
}
OAuthLoginGetTokenRequest {
Method string `json:"method" validate:"required"` // google, facebook, apple, telegram, github etc.
Callback interface{} `json:"callback" validate:"required"`
}
// login request
TelephoneLoginRequest {
Telephone string `json:"telephone" validate:"required"`
@ -162,4 +160,5 @@ service ppanel {
@doc "Apple Login Callback"
@handler AppleLoginCallback
post /callback/apple (AppleLoginCallbackRequest)
}
}

View File

@ -75,7 +75,6 @@ type (
Code string `json:"code" validate:"required"`
Type uint8 `json:"type" validate:"required"`
}
CheckVerificationCodeRespone {
Status bool `json:"status"`
}
@ -121,4 +120,5 @@ service ppanel {
@doc "Check verification code"
@handler CheckVerificationCode
post /check_verification_code (CheckVerificationCodeRequest) returns (CheckVerificationCodeRespone)
}
}

View File

@ -78,7 +78,6 @@ type (
ServerCommon
Traffic []UserTraffic `json:"traffic"`
}
ServerPushStatusRequest {
ServerCommon
Cpu float64 `json:"cpu"`
@ -93,8 +92,8 @@ type (
)
@server (
prefix: v1/server
group: server
prefix: v1/server
group: server
middleware: ServerMiddleware
)
service ppanel {
@ -117,4 +116,5 @@ service ppanel {
@doc "Push online users"
@handler PushOnlineUsers
post /online (OnlineUsersRequest)
}
}

View File

@ -19,4 +19,5 @@ service ppanel {
@doc "Query announcement"
@handler QueryAnnouncement
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
}
}

View File

@ -1,6 +1,6 @@
syntax = "v1"
info(
info (
title: "Document API"
desc: "API for ppanel"
author: "Tension"
@ -15,7 +15,6 @@ import "../types.api"
group: public/document
middleware: AuthMiddleware
)
service ppanel {
@doc "Get document list"
@handler QueryDocumentList
@ -24,4 +23,5 @@ service ppanel {
@doc "Get document detail"
@handler QueryDocumentDetail
get /detail (QueryDocumentDetailRequest) returns (Document)
}
}

View File

@ -47,4 +47,5 @@ service ppanel {
@doc "Get order list"
@handler QueryOrderList
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
}
}

View File

@ -19,4 +19,5 @@ service ppanel {
@doc "Get available payment methods"
@handler GetAvailablePaymentMethods
get /methods returns (GetAvailablePaymentMethodsResponse)
}
}

View File

@ -92,4 +92,5 @@ service ppanel {
@doc "Purchase Checkout"
@handler PurchaseCheckout
post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
}
}

View File

@ -27,4 +27,5 @@ service ppanel {
@doc "Get application config"
@handler QueryApplicationConfig
get /application/config returns (ApplicationResponse)
}
}

View File

@ -65,4 +65,5 @@ service ppanel {
@doc "Create ticket"
@handler CreateUserTicket
post / (CreateUserTicketRequest)
}
}

View File

@ -28,7 +28,6 @@ type (
List []UserBalanceLog `json:"list"`
Total int64 `json:"total"`
}
CommissionLog {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
@ -77,37 +76,30 @@ type (
ResetUserSubscribeTokenRequest {
UserSubscribeId int64 `json:"user_subscribe_id"`
}
GetLoginLogRequest {
Page int `form:"page"`
Size int `form:"size"`
}
GetLoginLogResponse {
List []UserLoginLog `json:"list"`
Total int64 `json:"total"`
}
GetSubscribeLogRequest {
Page int `form:"page"`
Size int `form:"size"`
}
GetSubscribeLogResponse {
List []UserSubscribeLog `json:"list"`
Total int64 `json:"total"`
}
UpdateBindMobileRequest {
AreaCode string `json:"area_code" validate:"required"`
Mobile string `json:"mobile" validate:"required"`
Code string `json:"code" validate:"required"`
}
UpdateBindEmailRequest {
Email string `json:"email" validate:"required"`
}
VerifyEmailRequest {
Email string `json:"email" validate:"required"`
Code string `json:"code" validate:"required"`
@ -207,4 +199,5 @@ service ppanel {
@doc "Update Bind Email"
@handler UpdateBindEmail
put /bind_email (UpdateBindEmailRequest)
}
}

View File

@ -1,26 +1,28 @@
syntax = "v1"
info(
title: "admin API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
info (
title: "admin API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
import (
"./admin/system.api"
"./admin/user.api"
"./admin/server.api"
"./admin/subscribe.api"
"./admin/payment.api"
"./admin/coupon.api"
"./admin/order.api"
"./admin/ticket.api"
"./admin/announcement.api"
"./admin/document.api"
"./admin/tool.api"
"./admin/console.api"
"./admin/auth.api"
"./admin/log.api"
"./admin/ads.api"
)
"./admin/system.api"
"./admin/user.api"
"./admin/server.api"
"./admin/subscribe.api"
"./admin/payment.api"
"./admin/coupon.api"
"./admin/order.api"
"./admin/ticket.api"
"./admin/announcement.api"
"./admin/document.api"
"./admin/tool.api"
"./admin/console.api"
"./admin/auth.api"
"./admin/log.api"
"./admin/ads.api"
)

View File

@ -1,6 +1,6 @@
syntax = "v1"
info(
info (
title: "App API"
desc: "API for ppanel"
author: "Tension"
@ -18,4 +18,5 @@ import (
"./app/payment.api"
"./app/document.api"
"./app/subscribe.api"
)
)

View File

@ -1,6 +1,6 @@
syntax = "v1"
info(
info (
title: "common API"
desc: "API for ppanel"
author: "Tension"
@ -11,4 +11,5 @@ info(
import (
"./common.api"
"./auth/auth.api"
)
)

View File

@ -1,6 +1,6 @@
syntax = "v1"
info(
info (
title: "Node API"
desc: "API for ppanel"
author: "Tension"
@ -8,4 +8,4 @@ info(
version: "0.0.1"
)
import "./node/node.api"
import "./node/node.api"

View File

@ -1,12 +1,13 @@
syntax = "v1"
info(
info (
title: "User API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
import (
"./public/user.api"
"./public/subscribe.api"
@ -16,4 +17,5 @@ import (
"./public/payment.api"
"./public/document.api"
"./public/portal.api"
)
)

View File

@ -246,11 +246,15 @@ type (
SecurityConfig SecurityConfig `json:"security_config"`
}
Tuic {
Port int `json:"port" validate:"required"`
DisableSNI bool `json:"disable_sni"`
ReduceRtt bool `json:"reduce_rtt"`
UDPRelayMode string `json:"udp_relay_mode"`
CongestionController string `json:"congestion_controller"`
SecurityConfig SecurityConfig `json:"security_config"`
}
AnyTLS {
Port int `json:"port" validate:"required"`
DisableSNI bool `json:"disable_sni"`
ReduceRtt bool `json:"reduce_rtt"`
UDPRelayMode string `json:"udp_relay_mode"`
CongestionController string `json:"congestion_controller"`
SecurityConfig SecurityConfig `json:"security_config"`
}
SecurityConfig {
@ -711,12 +715,10 @@ type (
Telephone string `json:"telephone"`
Address string `json:"address"`
}
QueryUserAffiliateCountResponse {
Registers int64 `json:"registers"`
TotalCommission int64 `json:"total_commission"`
}
AppUserSubcbribe {
Id int64 `json:"id"`
Name string `json:"name"`
@ -728,7 +730,6 @@ type (
ExpireTime string `json:"expire_time"`
List []AppUserSubscbribeNode `json:"list"`
}
AppUserSubscbribeNode {
Id int64 `json:"id"`
Name string `json:"name"`
@ -750,4 +751,5 @@ type (
CreatedAt int64 `json:"created_at"`
Download int64 `json:"download"`
}
)
)