init: 1.0.0
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Ads API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
type (
|
||||
CreateAdsRequest {
|
||||
Title string `json:"title"`
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
Description string `json:"description"`
|
||||
TargetURL string `json:"target_url"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
UpdateAdsRequest {
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
Description string `json:"description"`
|
||||
TargetURL string `json:"target_url"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
DeleteAdsRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
GetAdsListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Status *int `form:"status,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetAdsListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Ads `json:"list"`
|
||||
}
|
||||
GetAdsDetailRequest {
|
||||
Id int64 `form:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/ads
|
||||
group: admin/ads
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create Ads"
|
||||
@handler CreateAds
|
||||
post / (CreateAdsRequest)
|
||||
|
||||
@doc "Update Ads"
|
||||
@handler UpdateAds
|
||||
put / (UpdateAdsRequest)
|
||||
|
||||
@doc "Delete Ads"
|
||||
@handler DeleteAds
|
||||
delete / (DeleteAdsRequest)
|
||||
|
||||
@doc "Get Ads List"
|
||||
@handler GetAdsList
|
||||
get /list (GetAdsListRequest) returns (GetAdsListResponse)
|
||||
|
||||
@doc "Get Ads Detail"
|
||||
@handler GetAdsDetail
|
||||
get /detail (GetAdsDetailRequest) returns (Ads)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Announcement API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
CreateAnnouncementRequest {
|
||||
Title string `json:"title" validate:"required"`
|
||||
Content string `json:"content" validate:"required"`
|
||||
}
|
||||
UpdateAnnouncementRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Show *bool `json:"show"`
|
||||
Pinned *bool `json:"pinned"`
|
||||
Popup *bool `json:"popup"`
|
||||
}
|
||||
UpdateAnnouncementEnableRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Enable *bool `json:"enable" validate:"required"`
|
||||
}
|
||||
DeleteAnnouncementRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
GetAnnouncementListRequest {
|
||||
Page int64 `form:"page"`
|
||||
Size int64 `form:"size"`
|
||||
Show *bool `form:"show,omitempty"`
|
||||
Pinned *bool `form:"pinned,omitempty"`
|
||||
Popup *bool `form:"popup,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetAnnouncementListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Announcement `json:"list"`
|
||||
}
|
||||
GetAnnouncementRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/announcement
|
||||
group: admin/announcement
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create announcement"
|
||||
@handler CreateAnnouncement
|
||||
post / (CreateAnnouncementRequest)
|
||||
|
||||
@doc "Update announcement"
|
||||
@handler UpdateAnnouncement
|
||||
put / (UpdateAnnouncementRequest)
|
||||
|
||||
@doc "Get announcement list"
|
||||
@handler GetAnnouncementList
|
||||
get /list (GetAnnouncementListRequest) returns (GetAnnouncementListResponse)
|
||||
|
||||
@doc "Delete announcement"
|
||||
@handler DeleteAnnouncement
|
||||
delete / (DeleteAnnouncementRequest)
|
||||
|
||||
@doc "Get announcement"
|
||||
@handler GetAnnouncement
|
||||
get /detail (GetAnnouncementRequest) returns (Announcement)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Auth Method Management"
|
||||
desc: "System auth method management"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.1.2"
|
||||
)
|
||||
|
||||
import (
|
||||
"../types.api"
|
||||
)
|
||||
|
||||
type (
|
||||
UpdateAuthMethodConfigRequest {
|
||||
Id int64 `json:"id"`
|
||||
Method string `json:"method"`
|
||||
Config interface{} `json:"config"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
GetAuthMethodConfigRequest {
|
||||
Method string `form:"method"`
|
||||
}
|
||||
GetAuthMethodListResponse {
|
||||
List []AuthMethodConfig `json:"list"`
|
||||
}
|
||||
|
||||
|
||||
TestSmsSendRequest {
|
||||
AreaCode string `json:"area_code" validate:"required"`
|
||||
Telephone string `json:"telephone" validate:"required"`
|
||||
}
|
||||
// Test email smtp request
|
||||
TestEmailSendRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/auth-method
|
||||
group: admin/authMethod
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get auth method list"
|
||||
@handler GetAuthMethodList
|
||||
get /list returns (GetAuthMethodListResponse)
|
||||
|
||||
@doc "Get auth method config"
|
||||
@handler GetAuthMethodConfig
|
||||
get /config (GetAuthMethodConfigRequest) returns (AuthMethodConfig)
|
||||
|
||||
@doc "Update auth method config"
|
||||
@handler UpdateAuthMethodConfig
|
||||
put /config (UpdateAuthMethodConfigRequest) returns (AuthMethodConfig)
|
||||
|
||||
|
||||
@doc "Test sms send"
|
||||
@handler TestSmsSend
|
||||
post /test_sms_send (TestSmsSendRequest)
|
||||
|
||||
@doc "Test email send"
|
||||
@handler TestEmailSend
|
||||
post /test_email_send (TestEmailSendRequest)
|
||||
|
||||
@doc "Get sms support platform"
|
||||
@handler GetSmsPlatform
|
||||
get /sms_platform returns (PlatformResponse)
|
||||
|
||||
@doc "Get email support platform"
|
||||
@handler GetEmailPlatform
|
||||
get /email_platform returns (PlatformResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Console API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
type (
|
||||
ServerTrafficData {
|
||||
ServerId int64 `json:"server_id"`
|
||||
Name string `json:"name"`
|
||||
Upload int64 `json:"upload"`
|
||||
Download int64 `json:"download"`
|
||||
}
|
||||
UserTrafficData {
|
||||
SID int64 `json:"sid"`
|
||||
Upload int64 `json:"upload"`
|
||||
Download int64 `json:"download"`
|
||||
}
|
||||
ServerTotalDataResponse {
|
||||
OnlineUserIPs int64 `json:"online_user_ips"`
|
||||
OnlineServers int64 `json:"online_servers"`
|
||||
OfflineServers int64 `json:"offline_servers"`
|
||||
TodayUpload int64 `json:"today_upload"`
|
||||
TodayDownload int64 `json:"today_download"`
|
||||
MonthlyUpload int64 `json:"monthly_upload"`
|
||||
MonthlyDownload int64 `json:"monthly_download"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
ServerTrafficRankingToday []ServerTrafficData `json:"server_traffic_ranking_today"`
|
||||
ServerTrafficRankingYesterday []ServerTrafficData `json:"server_traffic_ranking_yesterday"`
|
||||
UserTrafficRankingToday []UserTrafficData `json:"user_traffic_ranking_today"`
|
||||
UserTrafficRankingYesterday []UserTrafficData `json:"user_traffic_ranking_yesterday"`
|
||||
}
|
||||
UserStatistics {
|
||||
Date string `json:"date,omitempty"`
|
||||
Register int64 `json:"register"`
|
||||
NewOrderUsers int64 `json:"new_order_users"`
|
||||
RenewalOrderUsers int64 `json:"renewal_order_users"`
|
||||
List []UserStatistics `json:"list,omitempty"`
|
||||
}
|
||||
OrdersStatistics {
|
||||
Date string `json:"date,omitempty"`
|
||||
AmountTotal int64 `json:"amount_total"`
|
||||
NewOrderAmount int64 `json:"new_order_amount"`
|
||||
RenewalOrderAmount int64 `json:"renewal_order_amount"`
|
||||
List []OrdersStatistics `json:"list,omitempty"`
|
||||
}
|
||||
RevenueStatisticsResponse {
|
||||
Today OrdersStatistics `json:"today"`
|
||||
Monthly OrdersStatistics `json:"monthly"`
|
||||
All OrdersStatistics `json:"all"`
|
||||
}
|
||||
UserStatisticsResponse {
|
||||
Today UserStatistics `json:"today"`
|
||||
Monthly UserStatistics `json:"monthly"`
|
||||
All UserStatistics `json:"all"`
|
||||
}
|
||||
TicketWaitRelpyResponse {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/console
|
||||
group: admin/console
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query server total data"
|
||||
@handler QueryServerTotalData
|
||||
get /server returns (ServerTotalDataResponse)
|
||||
|
||||
@doc "Query revenue statistics"
|
||||
@handler QueryRevenueStatistics
|
||||
get /revenue returns (RevenueStatisticsResponse)
|
||||
|
||||
@doc "Query user statistics"
|
||||
@handler QueryUserStatistics
|
||||
get /user returns (UserStatisticsResponse)
|
||||
|
||||
@doc "Query ticket wait reply"
|
||||
@handler QueryTicketWaitReply
|
||||
get /ticket returns (TicketWaitRelpyResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "coupon API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
CreateCouponRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Count int64 `json:"count,omitempty"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
Discount int64 `json:"discount" validate:"required"`
|
||||
StartTime int64 `json:"start_time" validate:"required"`
|
||||
ExpireTime int64 `json:"expire_time" validate:"required"`
|
||||
UserLimit int64 `json:"user_limit,omitempty"`
|
||||
Subscribe []int64 `json:"subscribe,omitempty"`
|
||||
UsedCount int64 `json:"used_count,omitempty"`
|
||||
Enable *bool `json:"enable,omitempty"`
|
||||
}
|
||||
UpdateCouponRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Count int64 `json:"count,omitempty"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
Discount int64 `json:"discount" validate:"required"`
|
||||
StartTime int64 `json:"start_time" validate:"required"`
|
||||
ExpireTime int64 `json:"expire_time" validate:"required"`
|
||||
UserLimit int64 `json:"user_limit,omitempty"`
|
||||
Subscribe []int64 `json:"subscribe,omitempty"`
|
||||
UsedCount int64 `json:"used_count,omitempty"`
|
||||
Enable *bool `json:"enable,omitempty"`
|
||||
}
|
||||
DeleteCouponRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
BatchDeleteCouponRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
GetCouponListRequest {
|
||||
Page int64 `form:"page" validate:"required"`
|
||||
Size int64 `form:"size" validate:"required"`
|
||||
Subscribe int64 `form:"subscribe,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetCouponListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Coupon `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/coupon
|
||||
group: admin/coupon
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create coupon"
|
||||
@handler CreateCoupon
|
||||
post / (CreateCouponRequest)
|
||||
|
||||
@doc "Update coupon"
|
||||
@handler UpdateCoupon
|
||||
put / (UpdateCouponRequest)
|
||||
|
||||
@doc "Delete coupon"
|
||||
@handler DeleteCoupon
|
||||
delete / (DeleteCouponRequest)
|
||||
|
||||
@doc "Batch delete coupon"
|
||||
@handler BatchDeleteCoupon
|
||||
delete /batch (BatchDeleteCouponRequest)
|
||||
|
||||
@doc "Get coupon list"
|
||||
@handler GetCouponList
|
||||
get /list (GetCouponListRequest) returns (GetCouponListResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Device API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
)
|
||||
@@ -0,0 +1,78 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Document API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
CreateDocumentRequest {
|
||||
Title string `json:"title" validate:"required"`
|
||||
Content string `json:"content" validate:"required"`
|
||||
Tags []string `json:"tags,omitempty" `
|
||||
Show *bool `json:"show"`
|
||||
}
|
||||
UpdateDocumentRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Title string `json:"title" validate:"required"`
|
||||
Content string `json:"content" validate:"required"`
|
||||
Tags []string `json:"tags,omitempty" `
|
||||
Show *bool `json:"show"`
|
||||
}
|
||||
DeleteDocumentRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
BatchDeleteDocumentRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
GetDocumentListRequest {
|
||||
Page int64 `form:"page" validate:"required"`
|
||||
Size int64 `form:"size" validate:"required"`
|
||||
Tag string `form:"tag,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetDocumentListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Document `json:"list"`
|
||||
}
|
||||
GetDocumentDetailRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/document
|
||||
group: admin/document
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create document"
|
||||
@handler CreateDocument
|
||||
post / (CreateDocumentRequest)
|
||||
|
||||
@doc "Update document"
|
||||
@handler UpdateDocument
|
||||
put / (UpdateDocumentRequest)
|
||||
|
||||
@doc "Delete document"
|
||||
@handler DeleteDocument
|
||||
delete / (DeleteDocumentRequest)
|
||||
|
||||
@doc "Batch delete document"
|
||||
@handler BatchDeleteDocument
|
||||
delete /batch (BatchDeleteDocumentRequest)
|
||||
|
||||
@doc "Get document list"
|
||||
@handler GetDocumentList
|
||||
get /list (GetDocumentListRequest) returns (GetDocumentListResponse)
|
||||
|
||||
@doc "Get document detail"
|
||||
@handler GetDocumentDetail
|
||||
get /detail (GetDocumentDetailRequest) returns (Document)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Log API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
GetMessageLogListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Type string `form:"type"`
|
||||
Platform string `form:"platform,omitempty"`
|
||||
To string `form:"to,omitempty"`
|
||||
Subject string `form:"subject,omitempty"`
|
||||
Content string `form:"content,omitempty"`
|
||||
Status int `form:"status,omitempty"`
|
||||
}
|
||||
GetMessageLogListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []MessageLog `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/log
|
||||
group: admin/log
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get message log list"
|
||||
@handler GetMessageLogList
|
||||
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "order API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
CreateOrderRequest {
|
||||
UserId int64 `json:"user_id" validate:"required"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
Quantity int64 `json:"quantity,omitempty"`
|
||||
Price int64 `json:"price" validate:"required"`
|
||||
Amount int64 `json:"amount" validate:"required"`
|
||||
Discount int64 `json:"discount,omitempty"`
|
||||
Coupon string `json:"coupon,omitempty"`
|
||||
CouponDiscount int64 `json:"coupon_discount,omitempty"`
|
||||
Commission int64 `json:"commission"`
|
||||
FeeAmount int64 `json:"fee_amount" validate:"required"`
|
||||
PaymentId int64 `json:"payment_id" validate:"required"`
|
||||
TradeNo string `json:"trade_no,omitempty"`
|
||||
Status uint8 `json:"status,omitempty"`
|
||||
SubscribeId int64 `json:"subscribe_id,omitempty"`
|
||||
}
|
||||
UpdateOrderStatusRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Status uint8 `json:"status" validate:"required"`
|
||||
PaymentId int64 `json:"payment_id,omitempty"`
|
||||
TradeNo string `json:"trade_no,omitempty"`
|
||||
}
|
||||
GetOrderListRequest {
|
||||
Page int64 `form:"page" validate:"required"`
|
||||
Size int64 `form:"size" validate:"required"`
|
||||
UserId int64 `form:"user_id,omitempty"`
|
||||
Status uint8 `form:"status,omitempty"`
|
||||
SubscribeId int64 `form:"subscribe_id,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetOrderListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Order `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/order
|
||||
group: admin/order
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create order"
|
||||
@handler CreateOrder
|
||||
post / (CreateOrderRequest)
|
||||
|
||||
@doc "Get order list"
|
||||
@handler GetOrderList
|
||||
get /list (GetOrderListRequest) returns (GetOrderListResponse)
|
||||
|
||||
@doc "Update order status"
|
||||
@handler UpdateOrderStatus
|
||||
put /status (UpdateOrderStatusRequest)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "payment API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
CreatePaymentMethodRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Platform string `json:"platform" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Config interface{} `json:"config" validate:"required"`
|
||||
FeeMode uint `json:"fee_mode"`
|
||||
FeePercent int64 `json:"fee_percent,omitempty"`
|
||||
FeeAmount int64 `json:"fee_amount,omitempty"`
|
||||
Enable *bool `json:"enable" validate:"required"`
|
||||
}
|
||||
UpdatePaymentMethodRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Platform string `json:"platform" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Config interface{} `json:"config" validate:"required"`
|
||||
FeeMode uint `json:"fee_mode"`
|
||||
FeePercent int64 `json:"fee_percent,omitempty"`
|
||||
FeeAmount int64 `json:"fee_amount,omitempty"`
|
||||
Enable *bool `json:"enable" validate:"required"`
|
||||
}
|
||||
DeletePaymentMethodRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
GetPaymentMethodListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Platform string `form:"platform,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
Enable *bool `form:"enable,omitempty"`
|
||||
}
|
||||
GetPaymentMethodListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []PaymentMethodDetail `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/payment
|
||||
group: admin/payment
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create Payment Method"
|
||||
@handler CreatePaymentMethod
|
||||
post / (CreatePaymentMethodRequest) returns (PaymentConfig)
|
||||
|
||||
@doc "Update Payment Method"
|
||||
@handler UpdatePaymentMethod
|
||||
put / (UpdatePaymentMethodRequest) returns (PaymentConfig)
|
||||
|
||||
@doc "Delete Payment Method"
|
||||
@handler DeletePaymentMethod
|
||||
delete / (DeletePaymentMethodRequest)
|
||||
|
||||
@doc "Get Payment Method List"
|
||||
@handler GetPaymentMethodList
|
||||
get /list (GetPaymentMethodListRequest) returns (GetPaymentMethodListResponse)
|
||||
|
||||
@doc "Get supported payment platform"
|
||||
@handler GetPaymentPlatform
|
||||
get /platform returns (PlatformResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Node API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
GetNodeServerListRequest {
|
||||
Page int `form:"page" validate:"required"`
|
||||
Size int `form:"size" validate:"required"`
|
||||
Tag string `form:"tag,omitempty"`
|
||||
GroupId int64 `form:"group_id,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetNodeServerListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Server `json:"list"`
|
||||
}
|
||||
UpdateNodeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Tags []string `json:"tags"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
ServerAddr string `json:"server_addr" validate:"required"`
|
||||
RelayMode string `json:"relay_mode"`
|
||||
RelayNode []NodeRelay `json:"relay_node"`
|
||||
SpeedLimit int `json:"speed_limit"`
|
||||
TrafficRatio float32 `json:"traffic_ratio"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
Protocol string `json:"protocol" validate:"required"`
|
||||
Config interface{} `json:"config" validate:"required"`
|
||||
Enable *bool `json:"enable"`
|
||||
Sort int64 `json:"sort"`
|
||||
}
|
||||
CreateNodeRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Tags []string `json:"tags"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
ServerAddr string `json:"server_addr" validate:"required"`
|
||||
RelayMode string `json:"relay_mode"`
|
||||
RelayNode []NodeRelay `json:"relay_node"`
|
||||
SpeedLimit int `json:"speed_limit"`
|
||||
TrafficRatio float32 `json:"traffic_ratio"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
Protocol string `json:"protocol" validate:"required"`
|
||||
Config interface{} `json:"config" validate:"required"`
|
||||
Enable *bool `json:"enable"`
|
||||
Sort int64 `json:"sort"`
|
||||
}
|
||||
DeleteNodeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
GetNodeGroupListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerGroup `json:"list"`
|
||||
}
|
||||
CreateNodeGroupRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
UpdateNodeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
DeleteNodeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
BatchDeleteNodeRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
BatchDeleteNodeGroupRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
GetNodeDetailRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
NodeSortRequest {
|
||||
Sort []SortItem `json:"sort"`
|
||||
}
|
||||
CreateRuleGroupRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Icon string `json:"icon"`
|
||||
Tags []string `json:"tags"`
|
||||
Rules string `json:"rules"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
UpdateRuleGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Tags []string `json:"tags"`
|
||||
Rules string `json:"rules"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
DeleteRuleGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
GetRuleGroupResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerRuleGroup `json:"list"`
|
||||
}
|
||||
GetNodeTagListResponse {
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/server
|
||||
group: admin/server
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get node tag list"
|
||||
@handler GetNodeTagList
|
||||
get /tag/list returns (GetNodeTagListResponse)
|
||||
|
||||
@doc "Get node list"
|
||||
@handler GetNodeList
|
||||
get /list (GetNodeServerListRequest) returns (GetNodeServerListResponse)
|
||||
|
||||
@doc "Get node detail"
|
||||
@handler GetNodeDetail
|
||||
get /detail (GetNodeDetailRequest) returns (Server)
|
||||
|
||||
@doc "Update node"
|
||||
@handler UpdateNode
|
||||
put / (UpdateNodeRequest)
|
||||
|
||||
@doc "Create node"
|
||||
@handler CreateNode
|
||||
post / (CreateNodeRequest)
|
||||
|
||||
@doc "Delete node"
|
||||
@handler DeleteNode
|
||||
delete / (DeleteNodeRequest)
|
||||
|
||||
@doc "Batch delete node"
|
||||
@handler BatchDeleteNode
|
||||
delete /batch (BatchDeleteNodeRequest)
|
||||
|
||||
@doc "Get node group list"
|
||||
@handler GetNodeGroupList
|
||||
get /group/list returns (GetNodeGroupListResponse)
|
||||
|
||||
@doc "Create node group"
|
||||
@handler CreateNodeGroup
|
||||
post /group (CreateNodeGroupRequest)
|
||||
|
||||
@doc "Update node group"
|
||||
@handler UpdateNodeGroup
|
||||
put /group (UpdateNodeGroupRequest)
|
||||
|
||||
@doc "Delete node group"
|
||||
@handler DeleteNodeGroup
|
||||
delete /group (DeleteNodeGroupRequest)
|
||||
|
||||
@doc "Batch delete node group"
|
||||
@handler BatchDeleteNodeGroup
|
||||
delete /group/batch (BatchDeleteNodeGroupRequest)
|
||||
|
||||
@doc "Node sort "
|
||||
@handler NodeSort
|
||||
post /sort (NodeSortRequest)
|
||||
|
||||
@doc "Create rule group"
|
||||
@handler CreateRuleGroup
|
||||
post /rule_group (CreateRuleGroupRequest)
|
||||
|
||||
@doc "Update rule group"
|
||||
@handler UpdateRuleGroup
|
||||
put /rule_group (UpdateRuleGroupRequest)
|
||||
|
||||
@doc "Delete rule group"
|
||||
@handler DeleteRuleGroup
|
||||
delete /rule_group (DeleteRuleGroupRequest)
|
||||
|
||||
@doc "Get rule group list"
|
||||
@handler GetRuleGroupList
|
||||
get /rule_group_list returns (GetRuleGroupResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Subscribe API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
GetSubscribeDetailsRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
CreateSubscribeGroupRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
UpdateSubscribeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
GetSubscribeGroupListResponse {
|
||||
List []SubscribeGroup `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
DeleteSubscribeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
BatchDeleteSubscribeGroupRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
CreateSubscribeRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
UnitPrice int64 `json:"unit_price"`
|
||||
UnitTime string `json:"unit_time"`
|
||||
Discount []SubscribeDiscount `json:"discount"`
|
||||
Replacement int64 `json:"replacement"`
|
||||
Inventory int64 `json:"inventory"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
SpeedLimit int64 `json:"speed_limit"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
Quota int64 `json:"quota"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
ServerGroup []int64 `json:"server_group"`
|
||||
Server []int64 `json:"server"`
|
||||
Show *bool `json:"show"`
|
||||
Sell *bool `json:"sell"`
|
||||
DeductionRatio int64 `json:"deduction_ratio"`
|
||||
AllowDeduction *bool `json:"allow_deduction"`
|
||||
ResetCycle int64 `json:"reset_cycle"`
|
||||
RenewalReset *bool `json:"renewal_reset"`
|
||||
}
|
||||
UpdateSubscribeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
UnitPrice int64 `json:"unit_price"`
|
||||
UnitTime string `json:"unit_time"`
|
||||
Discount []SubscribeDiscount `json:"discount"`
|
||||
Replacement int64 `json:"replacement"`
|
||||
Inventory int64 `json:"inventory"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
SpeedLimit int64 `json:"speed_limit"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
Quota int64 `json:"quota"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
ServerGroup []int64 `json:"server_group"`
|
||||
Server []int64 `json:"server"`
|
||||
Show *bool `json:"show"`
|
||||
Sell *bool `json:"sell"`
|
||||
Sort int64 `json:"sort"`
|
||||
DeductionRatio int64 `json:"deduction_ratio"`
|
||||
AllowDeduction *bool `json:"allow_deduction"`
|
||||
ResetCycle int64 `json:"reset_cycle"`
|
||||
RenewalReset *bool `json:"renewal_reset"`
|
||||
}
|
||||
SubscribeSortRequest {
|
||||
Sort []SortItem `json:"sort"`
|
||||
}
|
||||
GetSubscribeListRequest {
|
||||
Page int64 `form:"page" validate:"required"`
|
||||
Size int64 `form:"size" validate:"required"`
|
||||
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"`
|
||||
}
|
||||
DeleteSubscribeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
BatchDeleteSubscribeRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/subscribe
|
||||
group: admin/subscribe
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create subscribe group"
|
||||
@handler CreateSubscribeGroup
|
||||
post /group (CreateSubscribeGroupRequest)
|
||||
|
||||
@doc "Update subscribe group"
|
||||
@handler UpdateSubscribeGroup
|
||||
put /group (UpdateSubscribeGroupRequest)
|
||||
|
||||
@doc "Get subscribe group list"
|
||||
@handler GetSubscribeGroupList
|
||||
get /group/list returns (GetSubscribeGroupListResponse)
|
||||
|
||||
@doc "Delete subscribe group"
|
||||
@handler DeleteSubscribeGroup
|
||||
delete /group (DeleteSubscribeGroupRequest)
|
||||
|
||||
@doc "Batch delete subscribe group"
|
||||
@handler BatchDeleteSubscribeGroup
|
||||
delete /group/batch (BatchDeleteSubscribeGroupRequest)
|
||||
|
||||
@doc "Create subscribe"
|
||||
@handler CreateSubscribe
|
||||
post / (CreateSubscribeRequest)
|
||||
|
||||
@doc "Update subscribe"
|
||||
@handler UpdateSubscribe
|
||||
put / (UpdateSubscribeRequest)
|
||||
|
||||
@doc "Get subscribe list"
|
||||
@handler GetSubscribeList
|
||||
get /list (GetSubscribeListRequest) returns (GetSubscribeListResponse)
|
||||
|
||||
@doc "Delete subscribe"
|
||||
@handler DeleteSubscribe
|
||||
delete / (DeleteSubscribeRequest)
|
||||
|
||||
@doc "Batch delete subscribe"
|
||||
@handler BatchDeleteSubscribe
|
||||
delete /batch (BatchDeleteSubscribeRequest)
|
||||
|
||||
@doc "Get subscribe details"
|
||||
@handler GetSubscribeDetails
|
||||
get /details (GetSubscribeDetailsRequest) returns (Subscribe)
|
||||
|
||||
@doc "Subscribe sort"
|
||||
@handler SubscribeSort
|
||||
post /sort (SubscribeSortRequest)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "System API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
// Update application request
|
||||
UpdateApplicationRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
SubscribeType string `json:"subscribe_type"`
|
||||
Platform ApplicationPlatform `json:"platform"`
|
||||
}
|
||||
// Create application request
|
||||
CreateApplicationRequest {
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
SubscribeType string `json:"subscribe_type"`
|
||||
Platform ApplicationPlatform `json:"platform"`
|
||||
}
|
||||
// Update application request
|
||||
UpdateApplicationVersionRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Url string `json:"url"`
|
||||
Version string `json:"version" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
ApplicationId int64 `json:"application_id" validate:"required"`
|
||||
}
|
||||
// Create application request
|
||||
CreateApplicationVersionRequest {
|
||||
Url string `json:"url"`
|
||||
Version string `json:"version" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
ApplicationId int64 `json:"application_id" validate:"required"`
|
||||
}
|
||||
// Delete application request
|
||||
DeleteApplicationRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
// Delete application request
|
||||
DeleteApplicationVersionRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
GetNodeMultiplierResponse {
|
||||
Periods []TimePeriod `json:"periods"`
|
||||
}
|
||||
// SetNodeMultiplierRequest
|
||||
SetNodeMultiplierRequest {
|
||||
Periods []TimePeriod `json:"periods"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/system
|
||||
group: admin/system
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get site config"
|
||||
@handler GetSiteConfig
|
||||
get /site_config returns (SiteConfig)
|
||||
|
||||
@doc "Update site config"
|
||||
@handler UpdateSiteConfig
|
||||
put /site_config (SiteConfig)
|
||||
|
||||
@doc "Get subscribe config"
|
||||
@handler GetSubscribeConfig
|
||||
get /subscribe_config returns (SubscribeConfig)
|
||||
|
||||
@doc "Update subscribe config"
|
||||
@handler UpdateSubscribeConfig
|
||||
put /subscribe_config (SubscribeConfig)
|
||||
|
||||
@doc "Get subscribe type"
|
||||
@handler GetSubscribeType
|
||||
get /subscribe_type returns (SubscribeType)
|
||||
|
||||
@doc "update application config"
|
||||
@handler UpdateApplicationConfig
|
||||
put /application_config (ApplicationConfig)
|
||||
|
||||
@doc "get application config"
|
||||
@handler GetApplicationConfig
|
||||
get /application_config returns (ApplicationConfig)
|
||||
|
||||
@doc "Get application"
|
||||
@handler GetApplication
|
||||
get /application returns (ApplicationResponse)
|
||||
|
||||
@doc "Update application"
|
||||
@handler UpdateApplication
|
||||
put /application (UpdateApplicationRequest)
|
||||
|
||||
@doc "Create application"
|
||||
@handler CreateApplication
|
||||
post /application (CreateApplicationRequest)
|
||||
|
||||
@doc "Delete application"
|
||||
@handler DeleteApplication
|
||||
delete /application (DeleteApplicationRequest)
|
||||
|
||||
@doc "Update application version"
|
||||
@handler UpdateApplicationVersion
|
||||
put /application_version (UpdateApplicationVersionRequest)
|
||||
|
||||
@doc "Create application version"
|
||||
@handler CreateApplicationVersion
|
||||
post /application_version (CreateApplicationVersionRequest)
|
||||
|
||||
@doc "Delete application"
|
||||
@handler DeleteApplicationVersion
|
||||
delete /application_version (DeleteApplicationVersionRequest)
|
||||
|
||||
@doc "Get register config"
|
||||
@handler GetRegisterConfig
|
||||
get /register_config returns (RegisterConfig)
|
||||
|
||||
@doc "Update register config"
|
||||
@handler UpdateRegisterConfig
|
||||
put /register_config (RegisterConfig)
|
||||
|
||||
@doc "Get verify config"
|
||||
@handler GetVerifyConfig
|
||||
get /verify_config returns (VerifyConfig)
|
||||
|
||||
@doc "Update verify config"
|
||||
@handler UpdateVerifyConfig
|
||||
put /verify_config (VerifyConfig)
|
||||
|
||||
@doc "Get node config"
|
||||
@handler GetNodeConfig
|
||||
get /node_config returns (NodeConfig)
|
||||
|
||||
@doc "Update node config"
|
||||
@handler UpdateNodeConfig
|
||||
put /node_config (NodeConfig)
|
||||
|
||||
@doc "Get invite config"
|
||||
@handler GetInviteConfig
|
||||
get /invite_config returns (InviteConfig)
|
||||
|
||||
@doc "Update invite config"
|
||||
@handler UpdateInviteConfig
|
||||
put /invite_config (InviteConfig)
|
||||
|
||||
@doc "Get Team of Service Config"
|
||||
@handler GetTosConfig
|
||||
get /tos_config returns (TosConfig)
|
||||
|
||||
@doc "Update Team of Service Config"
|
||||
@handler UpdateTosConfig
|
||||
put /tos_config (TosConfig)
|
||||
|
||||
@doc "get Privacy Policy Config"
|
||||
@handler GetPrivacyPolicyConfig
|
||||
get /privacy returns (PrivacyPolicyConfig)
|
||||
|
||||
@doc "Update Privacy Policy Config"
|
||||
@handler UpdatePrivacyPolicyConfig
|
||||
put /privacy (PrivacyPolicyConfig)
|
||||
|
||||
@doc "Get Currency Config"
|
||||
@handler GetCurrencyConfig
|
||||
get /currency_config returns (CurrencyConfig)
|
||||
|
||||
@doc "Update Currency Config"
|
||||
@handler UpdateCurrencyConfig
|
||||
put /currency_config (CurrencyConfig)
|
||||
|
||||
@doc "setting telegram bot"
|
||||
@handler SettingTelegramBot
|
||||
post /setting_telegram_bot
|
||||
|
||||
@doc "Get Node Multiplier"
|
||||
@handler GetNodeMultiplier
|
||||
get /get_node_multiplier returns (GetNodeMultiplierResponse)
|
||||
|
||||
@doc "Set Node Multiplier"
|
||||
@handler SetNodeMultiplier
|
||||
post /set_node_multiplier (SetNodeMultiplierRequest)
|
||||
|
||||
@doc "Get Verify Code Config"
|
||||
@handler GetVerifyCodeConfig
|
||||
get /verify_code_config returns (VerifyCodeConfig)
|
||||
|
||||
@doc "Update Verify Code Config"
|
||||
@handler UpdateVerifyCodeConfig
|
||||
put /verify_code_config (VerifyCodeConfig)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Ticket API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
UpdateTicketStatusRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Status *uint8 `json:"status" validate:"required"`
|
||||
}
|
||||
GetTicketListRequest {
|
||||
Page int64 `form:"page"`
|
||||
Size int64 `form:"size"`
|
||||
UserId int64 `form:"user_id,omitempty"`
|
||||
Status *uint8 `form:"status,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetTicketListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Ticket `json:"list"`
|
||||
}
|
||||
GetTicketRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
CreateTicketFollowRequest {
|
||||
TicketId int64 `json:"ticket_id" validate:"required"`
|
||||
From string `json:"from" validate:"required"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
Content string `json:"content" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/ticket
|
||||
group: admin/ticket
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get ticket list"
|
||||
@handler GetTicketList
|
||||
get /list (GetTicketListRequest) returns (GetTicketListResponse)
|
||||
|
||||
@doc "Get ticket detail"
|
||||
@handler GetTicket
|
||||
get /detail (GetTicketRequest) returns (Ticket)
|
||||
|
||||
@doc "Update ticket status"
|
||||
@handler UpdateTicketStatus
|
||||
put / (UpdateTicketStatusRequest)
|
||||
|
||||
@doc "Create ticket follow"
|
||||
@handler CreateTicketFollow
|
||||
post /follow (CreateTicketFollowRequest)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Tools Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
LogResponse {
|
||||
List interface{} `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/tool
|
||||
group: admin/tool
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
@doc "Get System Log"
|
||||
@handler GetSystemLog
|
||||
get /log returns (LogResponse)
|
||||
|
||||
@doc "Restart System"
|
||||
@handler RestartSystem
|
||||
get /restart
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "User API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"../types.api"
|
||||
)
|
||||
|
||||
type (
|
||||
// GetUserListRequest
|
||||
GetUserListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Search string `form:"search,omitempty"`
|
||||
UserId *int64 `form:"user_id,omitempty"`
|
||||
SubscribeId *int64 `form:"subscribe_id,omitempty"`
|
||||
UserSubscribeId *int64 `form:"user_subscribe_id,omitempty"`
|
||||
}
|
||||
// GetUserListResponse
|
||||
GetUserListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []User `json:"list"`
|
||||
}
|
||||
// GetUserDetail
|
||||
GetDetailRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
UpdateUserBasiceInfoRequest {
|
||||
UserId int64 `json:"user_id" validate:"required"`
|
||||
Password string `json:"password"`
|
||||
Avatar string `json:"avatar"`
|
||||
Balance int64 `json:"balance"`
|
||||
Commission int64 `json:"commission"`
|
||||
GiftAmount int64 `json:"gift_amount"`
|
||||
Telegram int64 `json:"telegram"`
|
||||
ReferCode string `json:"refer_code"`
|
||||
RefererId int64 `json:"referer_id"`
|
||||
Enable bool `json:"enable"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
UpdateUserNotifySettingRequest {
|
||||
UserId int64 `json:"user_id" validate:"required"`
|
||||
EnableBalanceNotify bool `json:"enable_balance_notify"`
|
||||
EnableLoginNotify bool `json:"enable_login_notify"`
|
||||
EnableSubscribeNotify bool `json:"enable_subscribe_notify"`
|
||||
EnableTradeNotify bool `json:"enable_trade_notify"`
|
||||
}
|
||||
CreateUserRequest {
|
||||
Email string `json:"email"`
|
||||
Telephone string `json:"telephone"`
|
||||
TelephoneAreaCode string `json:"telephone_area_code"`
|
||||
Password string `json:"password"`
|
||||
ProductId int64 `json:"product_id"`
|
||||
Duration int64 `json:"duration"`
|
||||
RefererUser string `json:"referer_user"`
|
||||
ReferCode string `json:"refer_code"`
|
||||
Balance int64 `json:"balance"`
|
||||
Commission int64 `json:"commission"`
|
||||
GiftAmount int64 `json:"gift_amount"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
UserSubscribeDetail {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
User User `json:"user"`
|
||||
OrderId int64 `json:"order_id"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Subscribe Subscribe `json:"subscribe"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
ExpireTime int64 `json:"expire_time"`
|
||||
ResetTime int64 `json:"reset_time"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Download int64 `json:"download"`
|
||||
Upload int64 `json:"upload"`
|
||||
Token string `json:"token"`
|
||||
Status uint8 `json:"status"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
BatchDeleteUserRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
DeleteUserDeivceRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
KickOfflineRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
CreateUserAuthMethodRequest {
|
||||
UserId int64 `json:"user_id"`
|
||||
AuthType string `json:"auth_type"`
|
||||
AuthIdentifier string `json:"auth_identifier"`
|
||||
}
|
||||
DeleteUserAuthMethodRequest {
|
||||
UserId int64 `json:"user_id"`
|
||||
AuthType string `json:"auth_type"`
|
||||
}
|
||||
UpdateUserAuthMethodRequest {
|
||||
UserId int64 `json:"user_id"`
|
||||
AuthType string `json:"auth_type"`
|
||||
AuthIdentifier string `json:"auth_identifier"`
|
||||
}
|
||||
GetUserAuthMethodRequest {
|
||||
UserId int64 `json:"user_id"`
|
||||
}
|
||||
GetUserAuthMethodResponse {
|
||||
AuthMethods []UserAuthMethod `json:"auth_methods"`
|
||||
}
|
||||
GetUserSubscribeListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
UserId int64 `form:"user_id"`
|
||||
}
|
||||
GetUserSubscribeListResponse {
|
||||
List []UserSubscribe `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
GetUserSubscribeLogsRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
UserId int64 `form:"user_id"`
|
||||
SubscribeId int64 `form:"subscribe_id,omitempty"`
|
||||
}
|
||||
GetUserSubscribeLogsResponse {
|
||||
List []UserSubscribeLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
GetUserSubscribeDevicesRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
UserId int64 `form:"user_id"`
|
||||
SubscribeId int64 `form:"subscribe_id"`
|
||||
}
|
||||
GetUserSubscribeDevicesResponse {
|
||||
List []UserDevice `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
CreateUserSubscribeRequest {
|
||||
UserId int64 `json:"user_id"`
|
||||
ExpiredAt int64 `json:"expired_at"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
}
|
||||
UpdateUserSubscribeRequest {
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
ExpiredAt int64 `json:"expired_at"`
|
||||
Upload int64 `json:"upload"`
|
||||
Download int64 `json:"download"`
|
||||
}
|
||||
GetUserLoginLogsRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
UserId int64 `form:"user_id"`
|
||||
}
|
||||
GetUserLoginLogsResponse {
|
||||
List []UserLoginLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
DeleteUserSubscribeRequest {
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
}
|
||||
GetUserSubscribeByIdRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/user
|
||||
group: admin/user
|
||||
jwt: JwtAuth
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get user list"
|
||||
@handler GetUserList
|
||||
get /list (GetUserListRequest) returns (GetUserListResponse)
|
||||
|
||||
@doc "Get user detail"
|
||||
@handler GetUserDetail
|
||||
get /detail (GetDetailRequest) returns (User)
|
||||
|
||||
@doc "Update user basic info"
|
||||
@handler UpdateUserBasicInfo
|
||||
put /basic (UpdateUserBasiceInfoRequest)
|
||||
|
||||
@doc "Update user notify setting"
|
||||
@handler UpdateUserNotifySetting
|
||||
put /notify (UpdateUserNotifySettingRequest)
|
||||
|
||||
@doc "Delete user"
|
||||
@handler DeleteUser
|
||||
delete / (GetDetailRequest)
|
||||
|
||||
@doc "Current user"
|
||||
@handler CurrentUser
|
||||
get /current returns (User)
|
||||
|
||||
@doc "Batch delete user"
|
||||
@handler BatchDeleteUser
|
||||
delete /batch (BatchDeleteUserRequest)
|
||||
|
||||
@doc "Create user"
|
||||
@handler CreateUser
|
||||
post / (CreateUserRequest)
|
||||
|
||||
@doc "User device"
|
||||
@handler UpdateUserDevice
|
||||
put /device (UserDevice)
|
||||
|
||||
@doc "Delete user device"
|
||||
@handler DeleteUserDevice
|
||||
delete /device (DeleteUserDeivceRequest)
|
||||
|
||||
@doc "kick offline user device"
|
||||
@handler KickOfflineByUserDevice
|
||||
put /device/kick_offline (KickOfflineRequest)
|
||||
|
||||
@doc "Create user auth method"
|
||||
@handler CreateUserAuthMethod
|
||||
post /auth_method (CreateUserAuthMethodRequest)
|
||||
|
||||
@doc "Delete user auth method"
|
||||
@handler DeleteUserAuthMethod
|
||||
delete /auth_method (DeleteUserAuthMethodRequest)
|
||||
|
||||
@doc "Update user auth method"
|
||||
@handler UpdateUserAuthMethod
|
||||
put /auth_method (UpdateUserAuthMethodRequest)
|
||||
|
||||
@doc "Get user auth method"
|
||||
@handler GetUserAuthMethod
|
||||
get /auth_method (GetUserAuthMethodRequest) returns (GetUserAuthMethodResponse)
|
||||
|
||||
@doc "Get user subcribe"
|
||||
@handler GetUserSubscribe
|
||||
get /subscribe (GetUserSubscribeListRequest) returns (GetUserSubscribeListResponse)
|
||||
|
||||
@doc "Get user subcribe by id"
|
||||
@handler GetUserSubscribeById
|
||||
get /subscribe/detail (GetUserSubscribeByIdRequest) returns (UserSubscribeDetail)
|
||||
|
||||
@doc "Get user subcribe logs"
|
||||
@handler GetUserSubscribeLogs
|
||||
get /subscribe/logs (GetUserSubscribeLogsRequest) returns (GetUserSubscribeLogsResponse)
|
||||
|
||||
@doc "Get user subcribe traffic logs"
|
||||
@handler GetUserSubscribeTrafficLogs
|
||||
get /subscribe/traffic_logs (GetUserSubscribeTrafficLogsRequest) returns (GetUserSubscribeTrafficLogsResponse)
|
||||
|
||||
@doc "Get user subcribe devices"
|
||||
@handler GetUserSubscribeDevices
|
||||
get /subscribe/device (GetUserSubscribeDevicesRequest) returns (GetUserSubscribeDevicesResponse)
|
||||
|
||||
@doc "Create user subcribe"
|
||||
@handler CreateUserSubscribe
|
||||
post /subscribe (CreateUserSubscribeRequest)
|
||||
|
||||
@doc "Update user subcribe"
|
||||
@handler UpdateUserSubscribe
|
||||
put /subscribe (UpdateUserSubscribeRequest)
|
||||
|
||||
@doc "Delete user subcribe"
|
||||
@handler DeleteUserSubscribe
|
||||
delete /subscribe (DeleteUserSubscribeRequest)
|
||||
|
||||
@doc "Get user login logs"
|
||||
@handler GetUserLoginLogs
|
||||
get /login/logs (GetUserLoginLogsRequest) returns (GetUserLoginLogsResponse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user