style(api): standardize formatting and remove trailing newlines in API definitions
This commit is contained in:
parent
56f6bd2542
commit
77f55f8708
@ -75,5 +75,4 @@ service ppanel {
|
|||||||
@doc "Get Ads Detail"
|
@doc "Get Ads Detail"
|
||||||
@handler GetAdsDetail
|
@handler GetAdsDetail
|
||||||
get /detail (GetAdsDetailRequest) returns (Ads)
|
get /detail (GetAdsDetailRequest) returns (Ads)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,5 +72,4 @@ service ppanel {
|
|||||||
@doc "Get announcement"
|
@doc "Get announcement"
|
||||||
@handler GetAnnouncement
|
@handler GetAnnouncement
|
||||||
get /detail (GetAnnouncementRequest) returns (Announcement)
|
get /detail (GetAnnouncementRequest) returns (Announcement)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,16 +26,14 @@ type (
|
|||||||
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"`
|
||||||
}
|
}
|
||||||
// Test email smtp request
|
// Test email smtp request
|
||||||
TestEmailSendRequest {
|
TestEmailSendRequest {
|
||||||
Email string `json:"email" validate:"required"`
|
Email string `json:"email" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
@ -56,7 +54,6 @@ service ppanel {
|
|||||||
@handler UpdateAuthMethodConfig
|
@handler UpdateAuthMethodConfig
|
||||||
put /config (UpdateAuthMethodConfigRequest) returns (AuthMethodConfig)
|
put /config (UpdateAuthMethodConfigRequest) returns (AuthMethodConfig)
|
||||||
|
|
||||||
|
|
||||||
@doc "Test sms send"
|
@doc "Test sms send"
|
||||||
@handler TestSmsSend
|
@handler TestSmsSend
|
||||||
post /test_sms_send (TestSmsSendRequest)
|
post /test_sms_send (TestSmsSendRequest)
|
||||||
@ -72,5 +69,4 @@ service ppanel {
|
|||||||
@doc "Get email support platform"
|
@doc "Get email support platform"
|
||||||
@handler GetEmailPlatform
|
@handler GetEmailPlatform
|
||||||
get /email_platform returns (PlatformResponse)
|
get /email_platform returns (PlatformResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,5 +84,4 @@ service ppanel {
|
|||||||
@doc "Query ticket wait reply"
|
@doc "Query ticket wait reply"
|
||||||
@handler QueryTicketWaitReply
|
@handler QueryTicketWaitReply
|
||||||
get /ticket returns (TicketWaitRelpyResponse)
|
get /ticket returns (TicketWaitRelpyResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ type (
|
|||||||
ExpireTime int64 `json:"expire_time" validate:"required"`
|
ExpireTime int64 `json:"expire_time" validate:"required"`
|
||||||
UserLimit int64 `json:"user_limit,omitempty"`
|
UserLimit int64 `json:"user_limit,omitempty"`
|
||||||
Subscribe []int64 `json:"subscribe,omitempty"`
|
Subscribe []int64 `json:"subscribe,omitempty"`
|
||||||
UsedCount int64 `json:"used_count,omitempty"`
|
UsedCount int64 `json:"used_count,omitempty"`
|
||||||
Enable *bool `json:"enable,omitempty"`
|
Enable *bool `json:"enable,omitempty"`
|
||||||
}
|
}
|
||||||
UpdateCouponRequest {
|
UpdateCouponRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
@ -35,8 +35,8 @@ type (
|
|||||||
ExpireTime int64 `json:"expire_time" validate:"required"`
|
ExpireTime int64 `json:"expire_time" validate:"required"`
|
||||||
UserLimit int64 `json:"user_limit,omitempty"`
|
UserLimit int64 `json:"user_limit,omitempty"`
|
||||||
Subscribe []int64 `json:"subscribe,omitempty"`
|
Subscribe []int64 `json:"subscribe,omitempty"`
|
||||||
UsedCount int64 `json:"used_count,omitempty"`
|
UsedCount int64 `json:"used_count,omitempty"`
|
||||||
Enable *bool `json:"enable,omitempty"`
|
Enable *bool `json:"enable,omitempty"`
|
||||||
}
|
}
|
||||||
DeleteCouponRequest {
|
DeleteCouponRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
@ -81,5 +81,4 @@ service ppanel {
|
|||||||
@doc "Get coupon list"
|
@doc "Get coupon list"
|
||||||
@handler GetCouponList
|
@handler GetCouponList
|
||||||
get /list (GetCouponListRequest) returns (GetCouponListResponse)
|
get /list (GetCouponListRequest) returns (GetCouponListResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,13 +1,9 @@
|
|||||||
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"
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -36,5 +36,4 @@ service ppanel {
|
|||||||
@doc "Get message log list"
|
@doc "Get message log list"
|
||||||
@handler GetMessageLogList
|
@handler GetMessageLogList
|
||||||
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
|
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,5 +64,4 @@ service ppanel {
|
|||||||
@doc "Update order status"
|
@doc "Update order status"
|
||||||
@handler UpdateOrderStatus
|
@handler UpdateOrderStatus
|
||||||
put /status (UpdateOrderStatusRequest)
|
put /status (UpdateOrderStatusRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,5 +77,4 @@ service ppanel {
|
|||||||
@doc "Get supported payment platform"
|
@doc "Get supported payment platform"
|
||||||
@handler GetPaymentPlatform
|
@handler GetPaymentPlatform
|
||||||
get /platform returns (PlatformResponse)
|
get /platform returns (PlatformResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ type (
|
|||||||
GetNodeServerListRequest {
|
GetNodeServerListRequest {
|
||||||
Page int `form:"page" validate:"required"`
|
Page int `form:"page" validate:"required"`
|
||||||
Size int `form:"size" validate:"required"`
|
Size int `form:"size" validate:"required"`
|
||||||
Tags string `form:"tags,omitempty"`
|
Tags string `form:"tags,omitempty"`
|
||||||
GroupId int64 `form:"group_id,omitempty"`
|
GroupId int64 `form:"group_id,omitempty"`
|
||||||
Search string `form:"search,omitempty"`
|
Search string `form:"search,omitempty"`
|
||||||
}
|
}
|
||||||
@ -88,14 +88,14 @@ type (
|
|||||||
}
|
}
|
||||||
CreateRuleGroupRequest {
|
CreateRuleGroupRequest {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
Rules string `json:"rules"`
|
Rules string `json:"rules"`
|
||||||
Enable bool `json:"enable"`
|
Enable bool `json:"enable"`
|
||||||
}
|
}
|
||||||
UpdateRuleGroupRequest {
|
UpdateRuleGroupRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
Rules string `json:"rules"`
|
Rules string `json:"rules"`
|
||||||
@ -186,5 +186,4 @@ service ppanel {
|
|||||||
@doc "Get rule group list"
|
@doc "Get rule group list"
|
||||||
@handler GetRuleGroupList
|
@handler GetRuleGroupList
|
||||||
get /rule_group_list returns (GetRuleGroupResponse)
|
get /rule_group_list returns (GetRuleGroupResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,50 +34,50 @@ type (
|
|||||||
Ids []int64 `json:"ids" validate:"required"`
|
Ids []int64 `json:"ids" validate:"required"`
|
||||||
}
|
}
|
||||||
CreateSubscribeRequest {
|
CreateSubscribeRequest {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
UnitPrice int64 `json:"unit_price"`
|
UnitPrice int64 `json:"unit_price"`
|
||||||
UnitTime string `json:"unit_time"`
|
UnitTime string `json:"unit_time"`
|
||||||
Discount []SubscribeDiscount `json:"discount"`
|
Discount []SubscribeDiscount `json:"discount"`
|
||||||
Replacement int64 `json:"replacement"`
|
Replacement int64 `json:"replacement"`
|
||||||
Inventory int64 `json:"inventory"`
|
Inventory int64 `json:"inventory"`
|
||||||
Traffic int64 `json:"traffic"`
|
Traffic int64 `json:"traffic"`
|
||||||
SpeedLimit int64 `json:"speed_limit"`
|
SpeedLimit int64 `json:"speed_limit"`
|
||||||
DeviceLimit int64 `json:"device_limit"`
|
DeviceLimit int64 `json:"device_limit"`
|
||||||
Quota int64 `json:"quota"`
|
Quota int64 `json:"quota"`
|
||||||
GroupId int64 `json:"group_id"`
|
GroupId int64 `json:"group_id"`
|
||||||
ServerGroup []int64 `json:"server_group"`
|
ServerGroup []int64 `json:"server_group"`
|
||||||
Server []int64 `json:"server"`
|
Server []int64 `json:"server"`
|
||||||
Show *bool `json:"show"`
|
Show *bool `json:"show"`
|
||||||
Sell *bool `json:"sell"`
|
Sell *bool `json:"sell"`
|
||||||
DeductionRatio int64 `json:"deduction_ratio"`
|
DeductionRatio int64 `json:"deduction_ratio"`
|
||||||
AllowDeduction *bool `json:"allow_deduction"`
|
AllowDeduction *bool `json:"allow_deduction"`
|
||||||
ResetCycle int64 `json:"reset_cycle"`
|
ResetCycle int64 `json:"reset_cycle"`
|
||||||
RenewalReset *bool `json:"renewal_reset"`
|
RenewalReset *bool `json:"renewal_reset"`
|
||||||
}
|
}
|
||||||
UpdateSubscribeRequest {
|
UpdateSubscribeRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
UnitPrice int64 `json:"unit_price"`
|
UnitPrice int64 `json:"unit_price"`
|
||||||
UnitTime string `json:"unit_time"`
|
UnitTime string `json:"unit_time"`
|
||||||
Discount []SubscribeDiscount `json:"discount"`
|
Discount []SubscribeDiscount `json:"discount"`
|
||||||
Replacement int64 `json:"replacement"`
|
Replacement int64 `json:"replacement"`
|
||||||
Inventory int64 `json:"inventory"`
|
Inventory int64 `json:"inventory"`
|
||||||
Traffic int64 `json:"traffic"`
|
Traffic int64 `json:"traffic"`
|
||||||
SpeedLimit int64 `json:"speed_limit"`
|
SpeedLimit int64 `json:"speed_limit"`
|
||||||
DeviceLimit int64 `json:"device_limit"`
|
DeviceLimit int64 `json:"device_limit"`
|
||||||
Quota int64 `json:"quota"`
|
Quota int64 `json:"quota"`
|
||||||
GroupId int64 `json:"group_id"`
|
GroupId int64 `json:"group_id"`
|
||||||
ServerGroup []int64 `json:"server_group"`
|
ServerGroup []int64 `json:"server_group"`
|
||||||
Server []int64 `json:"server"`
|
Server []int64 `json:"server"`
|
||||||
Show *bool `json:"show"`
|
Show *bool `json:"show"`
|
||||||
Sell *bool `json:"sell"`
|
Sell *bool `json:"sell"`
|
||||||
Sort int64 `json:"sort"`
|
Sort int64 `json:"sort"`
|
||||||
DeductionRatio int64 `json:"deduction_ratio"`
|
DeductionRatio int64 `json:"deduction_ratio"`
|
||||||
AllowDeduction *bool `json:"allow_deduction"`
|
AllowDeduction *bool `json:"allow_deduction"`
|
||||||
ResetCycle int64 `json:"reset_cycle"`
|
ResetCycle int64 `json:"reset_cycle"`
|
||||||
RenewalReset *bool `json:"renewal_reset"`
|
RenewalReset *bool `json:"renewal_reset"`
|
||||||
}
|
}
|
||||||
SubscribeSortRequest {
|
SubscribeSortRequest {
|
||||||
Sort []SortItem `json:"sort"`
|
Sort []SortItem `json:"sort"`
|
||||||
@ -90,14 +90,14 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
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"`
|
||||||
}
|
}
|
||||||
DeleteSubscribeRequest {
|
DeleteSubscribeRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
@ -160,5 +160,4 @@ service ppanel {
|
|||||||
@doc "Subscribe sort"
|
@doc "Subscribe sort"
|
||||||
@handler SubscribeSort
|
@handler SubscribeSort
|
||||||
post /sort (SubscribeSortRequest)
|
post /sort (SubscribeSortRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,5 +201,4 @@ service ppanel {
|
|||||||
@doc "Update Verify Code Config"
|
@doc "Update Verify Code Config"
|
||||||
@handler UpdateVerifyCodeConfig
|
@handler UpdateVerifyCodeConfig
|
||||||
put /verify_code_config (VerifyCodeConfig)
|
put /verify_code_config (VerifyCodeConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,14 +12,14 @@ import "../types.api"
|
|||||||
|
|
||||||
type (
|
type (
|
||||||
UpdateTicketStatusRequest {
|
UpdateTicketStatusRequest {
|
||||||
Id int64 `json:"id" validate:"required"`
|
Id int64 `json:"id" validate:"required"`
|
||||||
Status *uint8 `json:"status" validate:"required"`
|
Status *uint8 `json:"status" validate:"required"`
|
||||||
}
|
}
|
||||||
GetTicketListRequest {
|
GetTicketListRequest {
|
||||||
Page int64 `form:"page"`
|
Page int64 `form:"page"`
|
||||||
Size int64 `form:"size"`
|
Size int64 `form:"size"`
|
||||||
UserId int64 `form:"user_id,omitempty"`
|
UserId int64 `form:"user_id,omitempty"`
|
||||||
Status *uint8 `form:"status,omitempty"`
|
Status *uint8 `form:"status,omitempty"`
|
||||||
Search string `form:"search,omitempty"`
|
Search string `form:"search,omitempty"`
|
||||||
}
|
}
|
||||||
GetTicketListResponse {
|
GetTicketListResponse {
|
||||||
@ -58,5 +58,4 @@ service ppanel {
|
|||||||
@doc "Create ticket follow"
|
@doc "Create ticket follow"
|
||||||
@handler CreateTicketFollow
|
@handler CreateTicketFollow
|
||||||
post /follow (CreateTicketFollowRequest)
|
post /follow (CreateTicketFollowRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,33 +1,33 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "Tools Api"
|
title: "Tools 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 "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
type (
|
type (
|
||||||
LogResponse {
|
LogResponse {
|
||||||
List interface{} `json:"list"`
|
List interface{} `json:"list"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/admin/tool
|
prefix: v1/admin/tool
|
||||||
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
|
||||||
get /log returns (LogResponse)
|
get /log returns (LogResponse)
|
||||||
|
|
||||||
@doc "Restart System"
|
@doc "Restart System"
|
||||||
@handler RestartSystem
|
@handler RestartSystem
|
||||||
get /restart
|
get /restart
|
||||||
}
|
}
|
||||||
@ -274,5 +274,4 @@ service ppanel {
|
|||||||
@doc "Get user login logs"
|
@doc "Get user login logs"
|
||||||
@handler GetUserLoginLogs
|
@handler GetUserLoginLogs
|
||||||
get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse)
|
get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,7 +10,6 @@ info (
|
|||||||
|
|
||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/app/announcement
|
prefix: v1/app/announcement
|
||||||
group: app/announcement
|
group: app/announcement
|
||||||
@ -20,5 +19,4 @@ service ppanel {
|
|||||||
@doc "Query announcement"
|
@doc "Query announcement"
|
||||||
@handler QueryAnnouncement
|
@handler QueryAnnouncement
|
||||||
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,104 +1,103 @@
|
|||||||
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"
|
||||||
email: "tension@ppanel.com"
|
email: "tension@ppanel.com"
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"../types.api"
|
"../types.api"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
AppAuthCheckRequest {
|
AppAuthCheckRequest {
|
||||||
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
||||||
Account string `json:"account"`
|
Account string `json:"account"`
|
||||||
Identifier string `json:"identifier" validate:"required"`
|
Identifier string `json:"identifier" validate:"required"`
|
||||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||||
AreaCode string `json:"area_code"`
|
AreaCode string `json:"area_code"`
|
||||||
}
|
}
|
||||||
AppAuthCheckResponse {
|
AppAuthCheckResponse {
|
||||||
Status bool
|
Status bool
|
||||||
}
|
}
|
||||||
AppAuthRequest {
|
AppAuthRequest {
|
||||||
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
||||||
Account string `json:"account"`
|
Account string `json:"account"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
Identifier string `json:"identifier" validate:"required"`
|
Identifier string `json:"identifier" validate:"required"`
|
||||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Invite string `json:"invite"`
|
Invite string `json:"invite"`
|
||||||
AreaCode string `json:"area_code"`
|
AreaCode string `json:"area_code"`
|
||||||
CfToken string `json:"cf_token,optional"`
|
CfToken string `json:"cf_token,optional"`
|
||||||
}
|
}
|
||||||
AppAuthRespone {
|
AppAuthRespone {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
AppSendCodeRequest {
|
AppSendCodeRequest {
|
||||||
Method string `json:"method" validate:"required" validate:"required,oneof=email mobile"`
|
Method string `json:"method" validate:"required" validate:"required,oneof=email mobile"`
|
||||||
Account string `json:"account"`
|
Account string `json:"account"`
|
||||||
AreaCode string `json:"area_code"`
|
AreaCode string `json:"area_code"`
|
||||||
CfToken string `json:"cf_token,optional"`
|
CfToken string `json:"cf_token,optional"`
|
||||||
}
|
}
|
||||||
AppSendCodeRespone {
|
AppSendCodeRespone {
|
||||||
Status bool `json:"status"`
|
Status bool `json:"status"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
}
|
}
|
||||||
AppConfigRequest {
|
AppConfigRequest {
|
||||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||||
}
|
}
|
||||||
AppConfigResponse {
|
AppConfigResponse {
|
||||||
EncryptionKey string `json:"encryption_key"`
|
EncryptionKey string `json:"encryption_key"`
|
||||||
EncryptionMethod string `json:"encryption_method"`
|
EncryptionMethod string `json:"encryption_method"`
|
||||||
Domains []string `json:"domains"`
|
Domains []string `json:"domains"`
|
||||||
StartupPicture string `json:"startup_picture"`
|
StartupPicture string `json:"startup_picture"`
|
||||||
StartupPictureSkipTime int64 `json:"startup_picture_skip_time"`
|
StartupPictureSkipTime int64 `json:"startup_picture_skip_time"`
|
||||||
Application AppInfo `json:"applications"`
|
Application AppInfo `json:"applications"`
|
||||||
OfficialEmail string `json:"official_email"`
|
OfficialEmail string `json:"official_email"`
|
||||||
OfficialWebsite string `json:"official_website"`
|
OfficialWebsite string `json:"official_website"`
|
||||||
OfficialTelegram string `json:"official_telegram"`
|
OfficialTelegram string `json:"official_telegram"`
|
||||||
OfficialTelephone string `json:"official_telephone"`
|
OfficialTelephone string `json:"official_telephone"`
|
||||||
InvitationLink string `json:"invitation_link"`
|
InvitationLink string `json:"invitation_link"`
|
||||||
KrWebsiteId string `json:"kr_website_id"`
|
KrWebsiteId string `json:"kr_website_id"`
|
||||||
}
|
}
|
||||||
AppInfo {
|
AppInfo {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
VersionDescription string `json:"version_description"`
|
VersionDescription string `json:"version_description"`
|
||||||
IsDefault bool `json:"is_default"`
|
IsDefault bool `json:"is_default"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@server(
|
@server(
|
||||||
prefix: v1/app/auth
|
prefix: v1/app/auth
|
||||||
group: app/auth
|
group: app/auth
|
||||||
middleware: AppMiddleware
|
middleware: AppMiddleware
|
||||||
)
|
)
|
||||||
service ppanel {
|
service ppanel {
|
||||||
@doc "Check Account"
|
@doc "Check Account"
|
||||||
@handler Check
|
@handler Check
|
||||||
post /check (AppAuthCheckRequest) returns (AppAuthCheckResponse)
|
post /check (AppAuthCheckRequest) returns (AppAuthCheckResponse)
|
||||||
|
|
||||||
@doc "Login"
|
@doc "Login"
|
||||||
@handler Login
|
@handler Login
|
||||||
post /login (AppAuthRequest) returns (AppAuthRespone)
|
post /login (AppAuthRequest) returns (AppAuthRespone)
|
||||||
|
|
||||||
@doc "Register"
|
@doc "Register"
|
||||||
@handler Register
|
@handler Register
|
||||||
post /register (AppAuthRequest) returns (AppAuthRespone)
|
post /register (AppAuthRequest) returns (AppAuthRespone)
|
||||||
|
|
||||||
@doc "Reset Password"
|
@doc "Reset Password"
|
||||||
@handler ResetPassword
|
@handler ResetPassword
|
||||||
post /reset_password (AppAuthRequest) returns (AppAuthRespone)
|
post /reset_password (AppAuthRequest) returns (AppAuthRespone)
|
||||||
|
|
||||||
@doc "GetAppConfig"
|
|
||||||
@handler GetAppConfig
|
|
||||||
post /config (AppConfigRequest) returns (AppConfigResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@doc "GetAppConfig"
|
||||||
|
@handler GetAppConfig
|
||||||
|
post /config (AppConfigRequest) returns (AppConfigResponse)
|
||||||
|
}
|
||||||
@ -1,27 +1,27 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "Document API"
|
title: "Document 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 "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/app/document
|
prefix: v1/app/document
|
||||||
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
|
||||||
get /list returns (QueryDocumentListResponse)
|
get /list returns (QueryDocumentListResponse)
|
||||||
|
|
||||||
@doc "Get document detail"
|
@doc "Get document detail"
|
||||||
@handler QueryDocumentDetail
|
@handler QueryDocumentDetail
|
||||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||||
}
|
}
|
||||||
@ -1,49 +1,44 @@
|
|||||||
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"
|
||||||
email: "tension@ppanel.com"
|
email: "tension@ppanel.com"
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
type(
|
type (
|
||||||
|
AppRuleGroupListResponse {
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
List []ServerRuleGroup `json:"list"`
|
||||||
|
}
|
||||||
|
|
||||||
|
AppUserSubscbribeNodeRequest {
|
||||||
|
Id int64 `form:"id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
AppRuleGroupListResponse {
|
AppUserSubscbribeNodeResponse {
|
||||||
Total int64 `json:"total"`
|
List []AppUserSubscbribeNode `json:"list"`
|
||||||
List []ServerRuleGroup `json:"list"`
|
}
|
||||||
}
|
|
||||||
|
|
||||||
AppUserSubscbribeNodeRequest {
|
|
||||||
Id int64 `form:"id" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
AppUserSubscbribeNodeResponse{
|
|
||||||
List []AppUserSubscbribeNode `json:"list"`
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/app/node
|
prefix: v1/app/node
|
||||||
group: app/node
|
group: app/node
|
||||||
middleware: AppMiddleware,AuthMiddleware
|
middleware: AppMiddleware,AuthMiddleware
|
||||||
)
|
)
|
||||||
|
|
||||||
service ppanel {
|
service ppanel {
|
||||||
|
|
||||||
|
@doc "Get Node list"
|
||||||
|
@handler GetNodeList
|
||||||
|
get /list (AppUserSubscbribeNodeRequest) returns(AppUserSubscbribeNodeResponse)
|
||||||
|
|
||||||
|
@doc "Get rule group list"
|
||||||
@doc "Get Node list"
|
@handler GetRuleGroupList
|
||||||
@handler GetNodeList
|
get /rule_group_list returns (AppRuleGroupListResponse)
|
||||||
get /list (AppUserSubscbribeNodeRequest) returns(AppUserSubscbribeNodeResponse)
|
|
||||||
|
|
||||||
@doc "Get rule group list"
|
|
||||||
@handler GetRuleGroupList
|
|
||||||
get /rule_group_list returns (AppRuleGroupListResponse)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -12,7 +12,6 @@ import (
|
|||||||
"../types.api"
|
"../types.api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/app/order
|
prefix: v1/app/order
|
||||||
group: app/order
|
group: app/order
|
||||||
@ -54,5 +53,4 @@ service ppanel {
|
|||||||
@doc "Get order list"
|
@doc "Get order list"
|
||||||
@handler QueryOrderList
|
@handler QueryOrderList
|
||||||
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
|
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,5 +19,4 @@ service ppanel {
|
|||||||
@doc "Get available payment methods"
|
@doc "Get available payment methods"
|
||||||
@handler GetAvailablePaymentMethods
|
@handler GetAvailablePaymentMethods
|
||||||
get /methods returns (GetAvailablePaymentMethodsResponse)
|
get /methods returns (GetAvailablePaymentMethodsResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,75 +1,70 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "Subscribe API"
|
title: "Subscribe 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 "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
|
|
||||||
type (
|
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 {
|
||||||
|
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||||
|
}
|
||||||
|
|
||||||
UserSubscribeResetPeriodRequest {
|
UserSubscribeResetPeriodResponse {
|
||||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
Status bool `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
UserSubscribeResetPeriodResponse {
|
AppUserSubscribeRequest {
|
||||||
Status bool `json:"status"`
|
ContainsNodes *bool `form:"contains_nodes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
AppUserSubscribeRequest {
|
AppUserSubscbribeResponse {
|
||||||
ContainsNodes *bool `form:"contains_nodes"`
|
List []AppUserSubcbribe `json:"list"`
|
||||||
}
|
}
|
||||||
|
|
||||||
AppUserSubscbribeResponse {
|
|
||||||
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
|
||||||
get /list returns (QuerySubscribeListResponse)
|
get /list returns (QuerySubscribeListResponse)
|
||||||
|
|
||||||
@doc "Get subscribe group list"
|
@doc "Get subscribe group list"
|
||||||
@handler QuerySubscribeGroupList
|
@handler QuerySubscribeGroupList
|
||||||
get /group/list returns (QuerySubscribeGroupListResponse)
|
get /group/list returns (QuerySubscribeGroupListResponse)
|
||||||
|
|
||||||
@doc "Get application config"
|
@doc "Get application config"
|
||||||
@handler QueryApplicationConfig
|
@handler QueryApplicationConfig
|
||||||
get /application/config returns (ApplicationResponse)
|
get /application/config returns (ApplicationResponse)
|
||||||
|
|
||||||
@doc "Get Already subscribed to package"
|
@doc "Get Already subscribed to package"
|
||||||
@handler QueryUserAlreadySubscribe
|
@handler QueryUserAlreadySubscribe
|
||||||
get /user/already_subscribe returns (QueryUserSubscribeResp)
|
get /user/already_subscribe returns (QueryUserSubscribeResp)
|
||||||
|
|
||||||
|
@doc "Get Available subscriptions for users"
|
||||||
|
@handler QueryUserAvailableUserSubscribe
|
||||||
|
get /user/available_subscribe (AppUserSubscribeRequest) returns (AppUserSubscbribeResponse)
|
||||||
|
|
||||||
@doc "Get Available subscriptions for users"
|
@doc "Reset user subscription period"
|
||||||
@handler QueryUserAvailableUserSubscribe
|
@handler ResetUserSubscribePeriod
|
||||||
get /user/available_subscribe (AppUserSubscribeRequest) returns (AppUserSubscbribeResponse)
|
post /reset/period (UserSubscribeResetPeriodRequest) returns (UserSubscribeResetPeriodResponse)
|
||||||
|
}
|
||||||
@doc "Reset user subscription period"
|
|
||||||
@handler ResetUserSubscribePeriod
|
|
||||||
post /reset/period (UserSubscribeResetPeriodRequest) returns (UserSubscribeResetPeriodResponse)
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -15,9 +15,9 @@ import (
|
|||||||
type (
|
type (
|
||||||
UserInfoResponse {
|
UserInfoResponse {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Balance int64 `json:"balance"`
|
Balance int64 `json:"balance"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
RefererId int64 `json:"referer_id"`
|
RefererId int64 `json:"referer_id"`
|
||||||
ReferCode string `json:"refer_code"`
|
ReferCode string `json:"refer_code"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
AreaCode string `json:"area_code"`
|
AreaCode string `json:"area_code"`
|
||||||
@ -34,21 +34,21 @@ type (
|
|||||||
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"`
|
||||||
Hours float64 `json:"hours"`
|
Hours float64 `json:"hours"`
|
||||||
|
}
|
||||||
|
ConnectionRecords {
|
||||||
|
CurrentContinuousDays int64 `json:"current_continuous_days"`
|
||||||
|
HistoryContinuousDays int64 `json:"history_continuous_days"`
|
||||||
|
LongestSingleConnection int64 `json:"longest_single_connection"`
|
||||||
}
|
}
|
||||||
ConnectionRecords{
|
|
||||||
CurrentContinuousDays int64 `json:"current_continuous_days"`
|
|
||||||
HistoryContinuousDays int64 `json:"history_continuous_days"`
|
|
||||||
LongestSingleConnection int64 `json:"longest_single_connection"`
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
@ -74,7 +74,7 @@ service ppanel {
|
|||||||
get /subscribe/traffic_logs (GetUserSubscribeTrafficLogsRequest) returns (GetUserSubscribeTrafficLogsResponse)
|
get /subscribe/traffic_logs (GetUserSubscribeTrafficLogsRequest) returns (GetUserSubscribeTrafficLogsResponse)
|
||||||
|
|
||||||
@doc "Get user online time total"
|
@doc "Get user online time total"
|
||||||
@handler GetUserOnlineTimeStatistics
|
@handler GetUserOnlineTimeStatistics
|
||||||
get /online_time/statistics returns (GetUserOnlineTimeStatisticsResponse)
|
get /online_time/statistics returns (GetUserOnlineTimeStatisticsResponse)
|
||||||
|
|
||||||
@doc "Query User Affiliate List"
|
@doc "Query User Affiliate List"
|
||||||
@ -85,6 +85,4 @@ service ppanel {
|
|||||||
@handler QueryUserAffiliate
|
@handler QueryUserAffiliate
|
||||||
get /affiliate/count returns (QueryUserAffiliateCountResponse)
|
get /affiliate/count returns (QueryUserAffiliateCountResponse)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,23 +1,21 @@
|
|||||||
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"
|
||||||
email: "tension@ppanel.com"
|
email: "tension@ppanel.com"
|
||||||
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
|
||||||
}
|
}
|
||||||
@ -11,11 +11,11 @@ info (
|
|||||||
type (
|
type (
|
||||||
// User login request
|
// User login request
|
||||||
UserLoginRequest {
|
UserLoginRequest {
|
||||||
Email string `json:"email" validate:"required"`
|
Email string `json:"email" validate:"required"`
|
||||||
Password string `json:"password" validate:"required"`
|
Password string `json:"password" validate:"required"`
|
||||||
IP string `header:"X-Original-Forwarded-For"`
|
IP string `header:"X-Original-Forwarded-For"`
|
||||||
UserAgent string `header:"User-Agent"`
|
UserAgent string `header:"User-Agent"`
|
||||||
CfToken string `json:"cf_token,optional"`
|
CfToken string `json:"cf_token,optional"`
|
||||||
}
|
}
|
||||||
// Check user is exist request
|
// Check user is exist request
|
||||||
CheckUserRequest {
|
CheckUserRequest {
|
||||||
@ -23,32 +23,32 @@ type (
|
|||||||
}
|
}
|
||||||
// User login response
|
// User login response
|
||||||
CheckUserResponse {
|
CheckUserResponse {
|
||||||
exist bool `json:"exist"`
|
Exist bool `json:"exist"`
|
||||||
}
|
}
|
||||||
// User login response
|
// User login response
|
||||||
UserRegisterRequest {
|
UserRegisterRequest {
|
||||||
Email string `json:"email" validate:"required"`
|
Email string `json:"email" validate:"required"`
|
||||||
Password string `json:"password" validate:"required"`
|
Password string `json:"password" validate:"required"`
|
||||||
Invite string `json:"invite,optional"`
|
Invite string `json:"invite,optional"`
|
||||||
Code string `json:"code,optional"`
|
Code string `json:"code,optional"`
|
||||||
IP string `header:"X-Original-Forwarded-For"`
|
IP string `header:"X-Original-Forwarded-For"`
|
||||||
UserAgent string `header:"User-Agent"`
|
UserAgent string `header:"User-Agent"`
|
||||||
CfToken string `json:"cf_token,optional"`
|
CfToken string `json:"cf_token,optional"`
|
||||||
}
|
}
|
||||||
// User login response
|
// User login response
|
||||||
ResetPasswordRequest {
|
ResetPasswordRequest {
|
||||||
Email string `json:"email" validate:"required"`
|
Email string `json:"email" validate:"required"`
|
||||||
Password string `json:"password" validate:"required"`
|
Password string `json:"password" validate:"required"`
|
||||||
Code string `json:"code,optional"`
|
Code string `json:"code,optional"`
|
||||||
IP string `header:"X-Original-Forwarded-For"`
|
IP string `header:"X-Original-Forwarded-For"`
|
||||||
UserAgent string `header:"User-Agent"`
|
UserAgent string `header:"User-Agent"`
|
||||||
CfToken string `json:"cf_token,optional"`
|
CfToken string `json:"cf_token,optional"`
|
||||||
}
|
}
|
||||||
LoginResponse {
|
LoginResponse {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
OAthLoginRequest {
|
OAthLoginRequest {
|
||||||
Method string `json:"method" validate:"required"` // google, facebook, apple, telegram, github etc.
|
Method string `json:"method" validate:"required"` // google, facebook, apple, telegram, github etc.
|
||||||
Redirect string `json:"redirect"`
|
Redirect string `json:"redirect"`
|
||||||
}
|
}
|
||||||
OAuthLoginResponse {
|
OAuthLoginResponse {
|
||||||
@ -56,7 +56,7 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ type (
|
|||||||
}
|
}
|
||||||
// User login response
|
// User login response
|
||||||
TelephoneCheckUserResponse {
|
TelephoneCheckUserResponse {
|
||||||
exist bool `json:"exist"`
|
Exist bool `json:"exist"`
|
||||||
}
|
}
|
||||||
// User login response
|
// User login response
|
||||||
TelephoneRegisterRequest {
|
TelephoneRegisterRequest {
|
||||||
@ -103,7 +103,7 @@ type (
|
|||||||
State string `form:"state"`
|
State string `form:"state"`
|
||||||
}
|
}
|
||||||
GoogleLoginCallbackRequest {
|
GoogleLoginCallbackRequest {
|
||||||
Code string `form:"code"`
|
Code string `form:"code"`
|
||||||
State string `form:"state"`
|
State string `form:"state"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -162,5 +162,4 @@ service ppanel {
|
|||||||
@doc "Apple Login Callback"
|
@doc "Apple Login Callback"
|
||||||
@handler AppleLoginCallback
|
@handler AppleLoginCallback
|
||||||
post /callback/apple (AppleLoginCallbackRequest)
|
post /callback/apple (AppleLoginCallbackRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,14 +70,14 @@ type (
|
|||||||
List []Ads `json:"list"`
|
List []Ads `json:"list"`
|
||||||
}
|
}
|
||||||
CheckVerificationCodeRequest {
|
CheckVerificationCodeRequest {
|
||||||
Method string `json:"method" validate:"required,oneof=email mobile"`
|
Method string `json:"method" validate:"required,oneof=email mobile"`
|
||||||
Account string `json:"account" validate:"required"`
|
Account string `json:"account" validate:"required"`
|
||||||
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"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -121,5 +121,4 @@ service ppanel {
|
|||||||
@doc "Check verification code"
|
@doc "Check verification code"
|
||||||
@handler CheckVerificationCode
|
@handler CheckVerificationCode
|
||||||
post /check_verification_code (CheckVerificationCodeRequest) returns (CheckVerificationCodeRespone)
|
post /check_verification_code (CheckVerificationCodeRequest) returns (CheckVerificationCodeRespone)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,9 +44,9 @@ type (
|
|||||||
ServerCommon
|
ServerCommon
|
||||||
}
|
}
|
||||||
GetServerConfigResponse {
|
GetServerConfigResponse {
|
||||||
Basic ServerBasic `json:"basic"`
|
Basic ServerBasic `json:"basic"`
|
||||||
Protocol string `json:"protocol"`
|
Protocol string `json:"protocol"`
|
||||||
Config interface{} `json:"config"`
|
Config interface{} `json:"config"`
|
||||||
}
|
}
|
||||||
ServerBasic {
|
ServerBasic {
|
||||||
PushInterval int64 `json:"push_interval"`
|
PushInterval int64 `json:"push_interval"`
|
||||||
@ -60,8 +60,8 @@ type (
|
|||||||
ServerUser {
|
ServerUser {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
SpeedLimit int64 `json:"speed_limit"`
|
SpeedLimit int64 `json:"speed_limit"`
|
||||||
DeviceLimit int64 `json:"device_limit"`
|
DeviceLimit int64 `json:"device_limit"`
|
||||||
}
|
}
|
||||||
GetServerUserListRequest {
|
GetServerUserListRequest {
|
||||||
ServerCommon
|
ServerCommon
|
||||||
@ -117,5 +117,4 @@ service ppanel {
|
|||||||
@doc "Push online users"
|
@doc "Push online users"
|
||||||
@handler PushOnlineUsers
|
@handler PushOnlineUsers
|
||||||
post /online (OnlineUsersRequest)
|
post /online (OnlineUsersRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,7 +10,6 @@ info (
|
|||||||
|
|
||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/public/announcement
|
prefix: v1/public/announcement
|
||||||
group: public/announcement
|
group: public/announcement
|
||||||
@ -20,5 +19,4 @@ service ppanel {
|
|||||||
@doc "Query announcement"
|
@doc "Query announcement"
|
||||||
@handler QueryAnnouncement
|
@handler QueryAnnouncement
|
||||||
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,28 +1,27 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "Document API"
|
title: "Document 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 "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/public/document
|
prefix: v1/public/document
|
||||||
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
|
||||||
get /list returns (QueryDocumentListResponse)
|
get /list returns (QueryDocumentListResponse)
|
||||||
|
|
||||||
@doc "Get document detail"
|
@doc "Get document detail"
|
||||||
@handler QueryDocumentDetail
|
@handler QueryDocumentDetail
|
||||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||||
}
|
}
|
||||||
@ -47,5 +47,4 @@ service ppanel {
|
|||||||
@doc "Get order list"
|
@doc "Get order list"
|
||||||
@handler QueryOrderList
|
@handler QueryOrderList
|
||||||
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
|
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,7 +10,6 @@ info (
|
|||||||
|
|
||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/public/payment
|
prefix: v1/public/payment
|
||||||
group: public/payment
|
group: public/payment
|
||||||
@ -20,5 +19,4 @@ service ppanel {
|
|||||||
@doc "Get available payment methods"
|
@doc "Get available payment methods"
|
||||||
@handler GetAvailablePaymentMethods
|
@handler GetAvailablePaymentMethods
|
||||||
get /methods returns (GetAvailablePaymentMethodsResponse)
|
get /methods returns (GetAvailablePaymentMethodsResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ type (
|
|||||||
SubscribeId int64 `json:"subscribe_id"`
|
SubscribeId int64 `json:"subscribe_id"`
|
||||||
Quantity int64 `json:"quantity"`
|
Quantity int64 `json:"quantity"`
|
||||||
Coupon string `json:"coupon,omitempty"`
|
Coupon string `json:"coupon,omitempty"`
|
||||||
InviteCode string `json:"invite_code,omitempty"`
|
InviteCode string `json:"invite_code,omitempty"`
|
||||||
TurnstileToken string `json:"turnstile_token,omitempty"`
|
TurnstileToken string `json:"turnstile_token,omitempty"`
|
||||||
}
|
}
|
||||||
PortalPurchaseResponse {
|
PortalPurchaseResponse {
|
||||||
@ -29,7 +29,7 @@ type (
|
|||||||
List []Subscribe `json:"list"`
|
List []Subscribe `json:"list"`
|
||||||
}
|
}
|
||||||
PrePurchaseOrderRequest {
|
PrePurchaseOrderRequest {
|
||||||
Payment int64 `json:"payment,omitempty"`
|
Payment int64 `json:"payment,omitempty"`
|
||||||
SubscribeId int64 `json:"subscribe_id"`
|
SubscribeId int64 `json:"subscribe_id"`
|
||||||
Quantity int64 `json:"quantity"`
|
Quantity int64 `json:"quantity"`
|
||||||
Coupon string `json:"coupon,omitempty"`
|
Coupon string `json:"coupon,omitempty"`
|
||||||
@ -92,5 +92,4 @@ service ppanel {
|
|||||||
@doc "Purchase Checkout"
|
@doc "Purchase Checkout"
|
||||||
@handler PurchaseCheckout
|
@handler PurchaseCheckout
|
||||||
post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
|
post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ info (
|
|||||||
)
|
)
|
||||||
|
|
||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
@server (
|
@server (
|
||||||
prefix: v1/public/subscribe
|
prefix: v1/public/subscribe
|
||||||
group: public/subscribe
|
group: public/subscribe
|
||||||
@ -27,5 +27,4 @@ service ppanel {
|
|||||||
@doc "Get application config"
|
@doc "Get application config"
|
||||||
@handler QueryApplicationConfig
|
@handler QueryApplicationConfig
|
||||||
get /application/config returns (ApplicationResponse)
|
get /application/config returns (ApplicationResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11,10 +11,9 @@ info (
|
|||||||
import "../types.api"
|
import "../types.api"
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
||||||
GetUserTicketListResponse {
|
GetUserTicketListResponse {
|
||||||
Total int64 `json:"total"`
|
Total int64 `json:"total"`
|
||||||
List []Ticket `json:"list"`
|
List []Ticket `json:"list"`
|
||||||
}
|
}
|
||||||
CreateUserTicketRequest {
|
CreateUserTicketRequest {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
@ -34,10 +33,10 @@ type (
|
|||||||
Status *uint8 `json:"status" validate:"required"`
|
Status *uint8 `json:"status" validate:"required"`
|
||||||
}
|
}
|
||||||
CreateUserTicketFollowRequest {
|
CreateUserTicketFollowRequest {
|
||||||
TicketId int64 `json:"ticket_id"`
|
TicketId int64 `json:"ticket_id"`
|
||||||
From string `json:"from"`
|
From string `json:"from"`
|
||||||
Type uint8 `json:"type"`
|
Type uint8 `json:"type"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -66,5 +65,4 @@ service ppanel {
|
|||||||
@doc "Create ticket"
|
@doc "Create ticket"
|
||||||
@handler CreateUserTicket
|
@handler CreateUserTicket
|
||||||
post / (CreateUserTicketRequest)
|
post / (CreateUserTicketRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,22 +95,22 @@ type (
|
|||||||
|
|
||||||
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"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -207,5 +207,4 @@ service ppanel {
|
|||||||
@doc "Update Bind Email"
|
@doc "Update Bind Email"
|
||||||
@handler UpdateBindEmail
|
@handler UpdateBindEmail
|
||||||
put /bind_email (UpdateBindEmailRequest)
|
put /bind_email (UpdateBindEmailRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,21 +1,21 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "App API"
|
title: "App 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 (
|
||||||
"./app/auth.api"
|
"./app/auth.api"
|
||||||
"./app/user.api"
|
"./app/user.api"
|
||||||
"./app/node.api"
|
"./app/node.api"
|
||||||
"./app/ws.api"
|
"./app/ws.api"
|
||||||
"./app/order.api"
|
"./app/order.api"
|
||||||
"./app/announcement.api"
|
"./app/announcement.api"
|
||||||
"./app/payment.api"
|
"./app/payment.api"
|
||||||
"./app/document.api"
|
"./app/document.api"
|
||||||
"./app/subscribe.api"
|
"./app/subscribe.api"
|
||||||
)
|
)
|
||||||
@ -1,14 +1,14 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "common API"
|
title: "common 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 (
|
||||||
"./common.api"
|
"./common.api"
|
||||||
"./auth/auth.api"
|
"./auth/auth.api"
|
||||||
)
|
)
|
||||||
@ -1,11 +1,11 @@
|
|||||||
syntax = "v1"
|
syntax = "v1"
|
||||||
|
|
||||||
info(
|
info(
|
||||||
title: "Node API"
|
title: "Node 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 "./node/node.api"
|
import "./node/node.api"
|
||||||
@ -1,19 +1,19 @@
|
|||||||
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"
|
||||||
"./public/order.api"
|
"./public/order.api"
|
||||||
"./public/announcement.api"
|
"./public/announcement.api"
|
||||||
"./public/ticket.api"
|
"./public/ticket.api"
|
||||||
"./public/payment.api"
|
"./public/payment.api"
|
||||||
"./public/document.api"
|
"./public/document.api"
|
||||||
"./public/portal.api"
|
"./public/portal.api"
|
||||||
)
|
)
|
||||||
@ -426,7 +426,7 @@ type (
|
|||||||
Subscribe Subscribe `json:"subscribe"`
|
Subscribe Subscribe `json:"subscribe"`
|
||||||
StartTime int64 `json:"start_time"`
|
StartTime int64 `json:"start_time"`
|
||||||
ExpireTime int64 `json:"expire_time"`
|
ExpireTime int64 `json:"expire_time"`
|
||||||
FinishedAt int64 `json:"finished_at"`
|
FinishedAt int64 `json:"finished_at"`
|
||||||
ResetTime int64 `json:"reset_time"`
|
ResetTime int64 `json:"reset_time"`
|
||||||
Traffic int64 `json:"traffic"`
|
Traffic int64 `json:"traffic"`
|
||||||
Download int64 `json:"download"`
|
Download int64 `json:"download"`
|
||||||
@ -505,7 +505,7 @@ type (
|
|||||||
}
|
}
|
||||||
ServerRuleGroup {
|
ServerRuleGroup {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
Rules string `json:"rules"`
|
Rules string `json:"rules"`
|
||||||
@ -557,8 +557,8 @@ type (
|
|||||||
//public order
|
//public order
|
||||||
PurchaseOrderRequest {
|
PurchaseOrderRequest {
|
||||||
SubscribeId int64 `json:"subscribe_id"`
|
SubscribeId int64 `json:"subscribe_id"`
|
||||||
Quantity int64 `json:"quantity" validate:"required,gt=0"`
|
Quantity int64 `json:"quantity" validate:"required,gt=0"`
|
||||||
Payment int64 `json:"payment,omitempty"`
|
Payment int64 `json:"payment,omitempty"`
|
||||||
Coupon string `json:"coupon,omitempty"`
|
Coupon string `json:"coupon,omitempty"`
|
||||||
}
|
}
|
||||||
PreOrderResponse {
|
PreOrderResponse {
|
||||||
@ -713,38 +713,37 @@ type (
|
|||||||
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"`
|
||||||
Upload int64 `json:"upload"`
|
Upload int64 `json:"upload"`
|
||||||
Traffic int64 `json:"traffic"`
|
Traffic int64 `json:"traffic"`
|
||||||
Download int64 `json:"download"`
|
Download int64 `json:"download"`
|
||||||
DeviceLimit int64 `json:"device_limit"`
|
DeviceLimit int64 `json:"device_limit"`
|
||||||
StartTime string `json:"start_time"`
|
StartTime string `json:"start_time"`
|
||||||
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"`
|
||||||
Uuid string `json:"uuid"`
|
Uuid string `json:"uuid"`
|
||||||
Protocol string `json:"protocol"`
|
Protocol string `json:"protocol"`
|
||||||
RelayMode string `json:"relay_mode"`
|
RelayMode string `json:"relay_mode"`
|
||||||
RelayNode string `json:"relay_node"`
|
RelayNode string `json:"relay_node"`
|
||||||
ServerAddr string `json:"server_addr"`
|
ServerAddr string `json:"server_addr"`
|
||||||
SpeedLimit int `json:"speed_limit"`
|
SpeedLimit int `json:"speed_limit"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
Traffic int64 `json:"traffic"`
|
Traffic int64 `json:"traffic"`
|
||||||
TrafficRatio float64 `json:"traffic_ratio"`
|
TrafficRatio float64 `json:"traffic_ratio"`
|
||||||
Upload int64 `json:"upload"`
|
Upload int64 `json:"upload"`
|
||||||
Config string `json:"config"`
|
Config string `json:"config"`
|
||||||
Country string `json:"country"`
|
Country string `json:"country"`
|
||||||
City string `json:"city"`
|
City string `json:"city"`
|
||||||
Latitude string `json:"latitude"`
|
Latitude string `json:"latitude"`
|
||||||
Longitude string `json:"longitude"`
|
Longitude string `json:"longitude"`
|
||||||
CreatedAt int64 `json:"created_at"`
|
CreatedAt int64 `json:"created_at"`
|
||||||
Download int64 `json:"download"`
|
Download int64 `json:"download"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user