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

@ -76,3 +76,4 @@ service ppanel {
@handler GetAdsDetail @handler GetAdsDetail
get /detail (GetAdsDetailRequest) returns (Ads) get /detail (GetAdsDetailRequest) returns (Ads)
} }

View File

@ -73,3 +73,4 @@ service ppanel {
@handler GetAnnouncement @handler GetAnnouncement
get /detail (GetAnnouncementRequest) returns (Announcement) get /detail (GetAnnouncementRequest) returns (Announcement)
} }

View File

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

View File

@ -85,3 +85,4 @@ service ppanel {
@handler QueryTicketWaitReply @handler QueryTicketWaitReply
get /ticket returns (TicketWaitRelpyResponse) get /ticket returns (TicketWaitRelpyResponse)
} }

View File

@ -82,3 +82,4 @@ service ppanel {
@handler GetCouponList @handler GetCouponList
get /list (GetCouponListRequest) returns (GetCouponListResponse) get /list (GetCouponListRequest) returns (GetCouponListResponse)
} }

View File

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

View File

@ -37,3 +37,4 @@ service ppanel {
@handler GetMessageLogList @handler GetMessageLogList
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse) get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
} }

View File

@ -65,3 +65,4 @@ service ppanel {
@handler UpdateOrderStatus @handler UpdateOrderStatus
put /status (UpdateOrderStatusRequest) put /status (UpdateOrderStatusRequest)
} }

View File

@ -78,3 +78,4 @@ service ppanel {
@handler GetPaymentPlatform @handler GetPaymentPlatform
get /platform returns (PlatformResponse) get /platform returns (PlatformResponse)
} }

View File

@ -187,3 +187,4 @@ service ppanel {
@handler GetRuleGroupList @handler GetRuleGroupList
get /rule_group_list returns (GetRuleGroupResponse) get /rule_group_list returns (GetRuleGroupResponse)
} }

View File

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

View File

@ -202,3 +202,4 @@ service ppanel {
@handler UpdateVerifyCodeConfig @handler UpdateVerifyCodeConfig
put /verify_code_config (VerifyCodeConfig) put /verify_code_config (VerifyCodeConfig)
} }

View File

@ -59,3 +59,4 @@ service ppanel {
@handler CreateTicketFollow @handler CreateTicketFollow
post /follow (CreateTicketFollowRequest) post /follow (CreateTicketFollowRequest)
} }

View File

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

View File

@ -275,3 +275,4 @@ service ppanel {
@handler GetUserLoginLogs @handler GetUserLoginLogs
get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse) get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse)
} }

View File

@ -20,3 +20,4 @@ service ppanel {
@handler QueryAnnouncement @handler QueryAnnouncement
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse) get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
} }

View File

@ -1,6 +1,6 @@
syntax = "v1" syntax = "v1"
info( info (
title: "App Auth Api" title: "App Auth Api"
desc: "API for ppanel" desc: "API for ppanel"
author: "Tension" author: "Tension"
@ -75,7 +75,7 @@ type (
} }
) )
@server( @server (
prefix: v1/app/auth prefix: v1/app/auth
group: app/auth group: app/auth
middleware: AppMiddleware middleware: AppMiddleware
@ -101,3 +101,4 @@ service ppanel {
@handler GetAppConfig @handler GetAppConfig
post /config (AppConfigRequest) returns (AppConfigResponse) post /config (AppConfigRequest) returns (AppConfigResponse)
} }

View File

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

View File

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

View File

@ -54,3 +54,4 @@ service ppanel {
@handler QueryOrderList @handler QueryOrderList
get /list (QueryOrderListRequest) returns (QueryOrderListResponse) get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
} }

View File

@ -20,3 +20,4 @@ service ppanel {
@handler GetAvailablePaymentMethods @handler GetAvailablePaymentMethods
get /methods returns (GetAvailablePaymentMethodsResponse) get /methods returns (GetAvailablePaymentMethodsResponse)
} }

View File

@ -1,6 +1,6 @@
syntax = "v1" syntax = "v1"
info( info (
title: "Subscribe API" title: "Subscribe API"
desc: "API for ppanel" desc: "API for ppanel"
author: "Tension" author: "Tension"
@ -14,35 +14,29 @@ type (
QueryUserSubscribeResp { QueryUserSubscribeResp {
Data []UserSubscribeData `json:"data"` Data []UserSubscribeData `json:"data"`
} }
UserSubscribeData { UserSubscribeData {
SubscribeId int64 `json:"subscribe_id"` SubscribeId int64 `json:"subscribe_id"`
UserSubscribeId int64 `json:"user_subscribe_id"` UserSubscribeId int64 `json:"user_subscribe_id"`
} }
UserSubscribeResetPeriodRequest { UserSubscribeResetPeriodRequest {
UserSubscribeId int64 `json:"user_subscribe_id"` UserSubscribeId int64 `json:"user_subscribe_id"`
} }
UserSubscribeResetPeriodResponse { UserSubscribeResetPeriodResponse {
Status bool `json:"status"` Status bool `json:"status"`
} }
AppUserSubscribeRequest { AppUserSubscribeRequest {
ContainsNodes *bool `form:"contains_nodes"` ContainsNodes *bool `form:"contains_nodes"`
} }
AppUserSubscbribeResponse { AppUserSubscbribeResponse {
List []AppUserSubcbribe `json:"list"` List []AppUserSubcbribe `json:"list"`
} }
) )
@server( @server (
prefix: v1/app/subscribe prefix: v1/app/subscribe
group: app/subscribe group: app/subscribe
middleware: AppMiddleware,AuthMiddleware middleware: AppMiddleware,AuthMiddleware
) )
service ppanel { service ppanel {
@doc "Get subscribe list" @doc "Get subscribe list"
@handler QuerySubscribeList @handler QuerySubscribeList
@ -68,3 +62,4 @@ service ppanel {
@handler ResetUserSubscribePeriod @handler ResetUserSubscribePeriod
post /reset/period (UserSubscribeResetPeriodRequest) returns (UserSubscribeResetPeriodResponse) 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"` Method string `json:"method" validate:"required" validate:"required,oneof=email telephone device"`
Code string `json:"code"` Code string `json:"code"`
} }
GetUserOnlineTimeStatisticsResponse { GetUserOnlineTimeStatisticsResponse {
WeeklyStats []WeeklyStat `json:"weekly_stats"` WeeklyStats []WeeklyStat `json:"weekly_stats"`
ConnectionRecords ConnectionRecords `json:"connection_records"` ConnectionRecords ConnectionRecords `json:"connection_records"`
} }
WeeklyStat { WeeklyStat {
Day int `json:"day"` Day int `json:"day"`
DayName string `json:"day_name"` DayName string `json:"day_name"`
@ -84,5 +82,5 @@ service ppanel {
@doc "Query User Affiliate Count" @doc "Query User Affiliate Count"
@handler QueryUserAffiliate @handler QueryUserAffiliate
get /affiliate/count returns (QueryUserAffiliateCountResponse) get /affiliate/count returns (QueryUserAffiliateCountResponse)
} }

View File

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

View File

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

View File

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

View File

@ -78,7 +78,6 @@ type (
ServerCommon ServerCommon
Traffic []UserTraffic `json:"traffic"` Traffic []UserTraffic `json:"traffic"`
} }
ServerPushStatusRequest { ServerPushStatusRequest {
ServerCommon ServerCommon
Cpu float64 `json:"cpu"` Cpu float64 `json:"cpu"`
@ -118,3 +117,4 @@ service ppanel {
@handler PushOnlineUsers @handler PushOnlineUsers
post /online (OnlineUsersRequest) post /online (OnlineUsersRequest)
} }

View File

@ -20,3 +20,4 @@ service ppanel {
@handler QueryAnnouncement @handler QueryAnnouncement
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse) get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
} }

View File

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

View File

@ -48,3 +48,4 @@ service ppanel {
@handler QueryOrderList @handler QueryOrderList
get /list (QueryOrderListRequest) returns (QueryOrderListResponse) get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
} }

View File

@ -20,3 +20,4 @@ service ppanel {
@handler GetAvailablePaymentMethods @handler GetAvailablePaymentMethods
get /methods returns (GetAvailablePaymentMethodsResponse) get /methods returns (GetAvailablePaymentMethodsResponse)
} }

View File

@ -93,3 +93,4 @@ service ppanel {
@handler PurchaseCheckout @handler PurchaseCheckout
post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse) post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
} }

View File

@ -28,3 +28,4 @@ service ppanel {
@handler QueryApplicationConfig @handler QueryApplicationConfig
get /application/config returns (ApplicationResponse) get /application/config returns (ApplicationResponse)
} }

View File

@ -66,3 +66,4 @@ service ppanel {
@handler CreateUserTicket @handler CreateUserTicket
post / (CreateUserTicketRequest) post / (CreateUserTicketRequest)
} }

View File

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

View File

@ -1,12 +1,13 @@
syntax = "v1" syntax = "v1"
info( info (
title: "admin API" title: "admin API"
desc: "API for ppanel" desc: "API for ppanel"
author: "Tension" author: "Tension"
email: "tension@ppanel.com" email: "tension@ppanel.com"
version: "0.0.1" version: "0.0.1"
) )
import ( import (
"./admin/system.api" "./admin/system.api"
"./admin/user.api" "./admin/user.api"
@ -24,3 +25,4 @@ import (
"./admin/log.api" "./admin/log.api"
"./admin/ads.api" "./admin/ads.api"
) )

View File

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

View File

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

View File

@ -1,6 +1,6 @@
syntax = "v1" syntax = "v1"
info( info (
title: "Node API" title: "Node API"
desc: "API for ppanel" desc: "API for ppanel"
author: "Tension" author: "Tension"

View File

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

View File

@ -253,6 +253,10 @@ type (
CongestionController string `json:"congestion_controller"` CongestionController string `json:"congestion_controller"`
SecurityConfig SecurityConfig `json:"security_config"` SecurityConfig SecurityConfig `json:"security_config"`
} }
AnyTLS {
Port int `json:"port" validate:"required"`
SecurityConfig SecurityConfig `json:"security_config"`
}
SecurityConfig { SecurityConfig {
SNI string `json:"sni"` SNI string `json:"sni"`
AllowInsecure *bool `json:"allow_insecure"` AllowInsecure *bool `json:"allow_insecure"`
@ -711,12 +715,10 @@ type (
Telephone string `json:"telephone"` Telephone string `json:"telephone"`
Address string `json:"address"` Address string `json:"address"`
} }
QueryUserAffiliateCountResponse { QueryUserAffiliateCountResponse {
Registers int64 `json:"registers"` Registers int64 `json:"registers"`
TotalCommission int64 `json:"total_commission"` TotalCommission int64 `json:"total_commission"`
} }
AppUserSubcbribe { AppUserSubcbribe {
Id int64 `json:"id"` Id int64 `json:"id"`
Name string `json:"name"` Name string `json:"name"`
@ -728,7 +730,6 @@ type (
ExpireTime string `json:"expire_time"` ExpireTime string `json:"expire_time"`
List []AppUserSubscbribeNode `json:"list"` List []AppUserSubscbribeNode `json:"list"`
} }
AppUserSubscbribeNode { AppUserSubscbribeNode {
Id int64 `json:"id"` Id int64 `json:"id"`
Name string `json:"name"` Name string `json:"name"`
@ -751,3 +752,4 @@ type (
Download int64 `json:"download"` Download int64 `json:"download"`
} }
) )