init: 1.0.0
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Announcement API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
@server (
|
||||
prefix: v1/public/announcement
|
||||
group: public/announcement
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query announcement"
|
||||
@handler QueryAnnouncement
|
||||
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Document API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
@server (
|
||||
prefix: v1/public/document
|
||||
group: public/document
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
@doc "Get document list"
|
||||
@handler QueryDocumentList
|
||||
get /list returns (QueryDocumentListResponse)
|
||||
|
||||
@doc "Get document detail"
|
||||
@handler QueryDocumentDetail
|
||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Order API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
@server (
|
||||
prefix: v1/public/order
|
||||
group: public/order
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Pre create order"
|
||||
@handler PreCreateOrder
|
||||
post /pre (PurchaseOrderRequest) returns (PreOrderResponse)
|
||||
|
||||
@doc "purchase Subscription"
|
||||
@handler Purchase
|
||||
post /purchase (PurchaseOrderRequest) returns (PurchaseOrderResponse)
|
||||
|
||||
@doc "Renewal Subscription"
|
||||
@handler Renewal
|
||||
post /renewal (RenewalOrderRequest) returns (RenewalOrderResponse)
|
||||
|
||||
@doc "Reset traffic"
|
||||
@handler ResetTraffic
|
||||
post /reset (ResetTrafficOrderRequest) returns (ResetTrafficOrderResponse)
|
||||
|
||||
@doc "Recharge"
|
||||
@handler Recharge
|
||||
post /recharge (RechargeOrderRequest) returns (RechargeOrderResponse)
|
||||
|
||||
@doc "Close order"
|
||||
@handler CloseOrder
|
||||
post /close (CloseOrderRequest)
|
||||
|
||||
@doc "Get order"
|
||||
@handler QueryOrderDetail
|
||||
get /detail (QueryOrderDetailRequest) returns (OrderDetail)
|
||||
|
||||
@doc "Get order list"
|
||||
@handler QueryOrderList
|
||||
get /list (QueryOrderListRequest) returns (QueryOrderListResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "payment API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
@server (
|
||||
prefix: v1/public/payment
|
||||
group: public/payment
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get available payment methods"
|
||||
@handler GetAvailablePaymentMethods
|
||||
get /methods returns (GetAvailablePaymentMethodsResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Portal API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
PortalPurchaseRequest {
|
||||
AuthType string `json:"auth_type"`
|
||||
Identifier string `json:"identifier"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Payment int64 `json:"payment"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Quantity int64 `json:"quantity"`
|
||||
Coupon string `json:"coupon,omitempty"`
|
||||
InviteCode string `json:"invite_code,omitempty"`
|
||||
TurnstileToken string `json:"turnstile_token,omitempty"`
|
||||
}
|
||||
PortalPurchaseResponse {
|
||||
OrderNo string `json:"order_no"`
|
||||
}
|
||||
GetSubscriptionResponse {
|
||||
List []Subscribe `json:"list"`
|
||||
}
|
||||
PrePurchaseOrderRequest {
|
||||
Payment int64 `json:"payment,omitempty"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Quantity int64 `json:"quantity"`
|
||||
Coupon string `json:"coupon,omitempty"`
|
||||
}
|
||||
PrePurchaseOrderResponse {
|
||||
Price int64 `json:"price"`
|
||||
Amount int64 `json:"amount"`
|
||||
Discount int64 `json:"discount"`
|
||||
Coupon string `json:"coupon"`
|
||||
CouponDiscount int64 `json:"coupon_discount"`
|
||||
FeeAmount int64 `json:"fee_amount"`
|
||||
}
|
||||
QueryPurchaseOrderRequest {
|
||||
AuthType string `form:"auth_type"`
|
||||
Identifier string `form:"identifier"`
|
||||
OrderNo string `form:"order_no"`
|
||||
}
|
||||
QueryPurchaseOrderResponse {
|
||||
OrderNo string `json:"order_no"`
|
||||
Subscribe Subscribe `json:"subscribe"`
|
||||
Quantity int64 `json:"quantity"`
|
||||
Price int64 `json:"price"`
|
||||
Amount int64 `json:"amount"`
|
||||
Discount int64 `json:"discount"`
|
||||
Coupon string `json:"coupon"`
|
||||
CouponDiscount int64 `json:"coupon_discount"`
|
||||
FeeAmount int64 `json:"fee_amount"`
|
||||
Payment PaymentMethod `json:"payment"`
|
||||
Status uint8 `json:"status"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Token string `json:"token,omitempty"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/public/portal
|
||||
group: public/portal
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get available payment methods"
|
||||
@handler GetAvailablePaymentMethods
|
||||
get /payment-method returns (GetAvailablePaymentMethodsResponse)
|
||||
|
||||
@doc "Get Subscription"
|
||||
@handler GetSubscription
|
||||
get /subscribe returns (GetSubscriptionResponse)
|
||||
|
||||
@doc "Pre Purchase Order"
|
||||
@handler PrePurchaseOrder
|
||||
post /pre (PrePurchaseOrderRequest) returns (PrePurchaseOrderResponse)
|
||||
|
||||
@doc "Purchase subscription"
|
||||
@handler Purchase
|
||||
post /purchase (PortalPurchaseRequest) returns (PortalPurchaseResponse)
|
||||
|
||||
@doc "Query Purchase Order"
|
||||
@handler QueryPurchaseOrder
|
||||
get /order/status (QueryPurchaseOrderRequest) returns (QueryPurchaseOrderResponse)
|
||||
|
||||
@doc "Purchase Checkout"
|
||||
@handler PurchaseCheckout
|
||||
post /order/checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Subscribe API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
@server (
|
||||
prefix: v1/public/subscribe
|
||||
group: public/subscribe
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get subscribe list"
|
||||
@handler QuerySubscribeList
|
||||
get /list returns (QuerySubscribeListResponse)
|
||||
|
||||
@doc "Get subscribe group list"
|
||||
@handler QuerySubscribeGroupList
|
||||
get /group/list returns (QuerySubscribeGroupListResponse)
|
||||
|
||||
@doc "Get application config"
|
||||
@handler QueryApplicationConfig
|
||||
get /application/config returns (ApplicationResponse)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Ticket API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
|
||||
GetUserTicketListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Ticket `json:"list"`
|
||||
}
|
||||
CreateUserTicketRequest {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
GetUserTicketListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Status *uint8 `form:"status,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetUserTicketDetailRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
UpdateUserTicketStatusRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Status *uint8 `json:"status" validate:"required"`
|
||||
}
|
||||
CreateUserTicketFollowRequest {
|
||||
TicketId int64 `json:"ticket_id"`
|
||||
From string `json:"from"`
|
||||
Type uint8 `json:"type"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/public/ticket
|
||||
group: public/ticket
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get ticket list"
|
||||
@handler GetUserTicketList
|
||||
get /list (GetUserTicketListRequest) returns (GetUserTicketListResponse)
|
||||
|
||||
@doc "Get ticket detail"
|
||||
@handler GetUserTicketDetails
|
||||
get /detail (GetUserTicketDetailRequest) returns (Ticket)
|
||||
|
||||
@doc "Update ticket status"
|
||||
@handler UpdateUserTicketStatus
|
||||
put / (UpdateUserTicketStatusRequest)
|
||||
|
||||
@doc "Create ticket follow"
|
||||
@handler CreateUserTicketFollow
|
||||
post /follow (CreateUserTicketFollowRequest)
|
||||
|
||||
@doc "Create ticket"
|
||||
@handler CreateUserTicket
|
||||
post / (CreateUserTicketRequest)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "User API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
UpdateUserNotifyRequest {
|
||||
EnableBalanceNotify *bool `json:"enable_balance_notify"`
|
||||
EnableLoginNotify *bool `json:"enable_login_notify"`
|
||||
EnableSubscribeNotify *bool `json:"enable_subscribe_notify"`
|
||||
EnableTradeNotify *bool `json:"enable_trade_notify"`
|
||||
}
|
||||
UpdateUserPasswordRequest {
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
QueryUserSubscribeListResponse {
|
||||
List []UserSubscribe `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
QueryUserBalanceLogListResponse {
|
||||
List []UserBalanceLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
CommissionLog {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
OrderNo string `json:"order_no"`
|
||||
Amount int64 `json:"amount"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
QueryUserCommissionLogListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
}
|
||||
QueryUserCommissionLogListResponse {
|
||||
List []CommissionLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
BindTelegramResponse {
|
||||
Url string `json:"url"`
|
||||
ExpiredAt int64 `json:"expired_at"`
|
||||
}
|
||||
PreUnsubscribeRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
PreUnsubscribeResponse {
|
||||
DeductionAmount int64 `json:"deduction_amount"`
|
||||
}
|
||||
UnsubscribeRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
BindOAuthRequest {
|
||||
Method string `json:"method"`
|
||||
Redirect string `json:"redirect"`
|
||||
}
|
||||
BindOAuthResponse {
|
||||
Redirect string `json:"redirect"`
|
||||
}
|
||||
BindOAuthCallbackRequest {
|
||||
Method string `json:"method"`
|
||||
Callback interface{} `json:"callback"`
|
||||
}
|
||||
GetOAuthMethodsResponse {
|
||||
Methods []UserAuthMethod `json:"methods"`
|
||||
}
|
||||
UnbindOAuthRequest {
|
||||
Method string `json:"method"`
|
||||
}
|
||||
ResetUserSubscribeTokenRequest {
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
}
|
||||
|
||||
GetLoginLogRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
}
|
||||
|
||||
GetLoginLogResponse {
|
||||
List []UserLoginLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
GetSubscribeLogRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
}
|
||||
|
||||
GetSubscribeLogResponse {
|
||||
List []UserSubscribeLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
UpdateBindMobileRequest{
|
||||
AreaCode string `json:"area_code" validate:"required"`
|
||||
Mobile string `json:"mobile" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
UpdateBindEmailRequest{
|
||||
Email string `json:"email" validate:"required"`
|
||||
}
|
||||
|
||||
VerifyEmailRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/public/user
|
||||
group: public/user
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query User Info"
|
||||
@handler QueryUserInfo
|
||||
get /info returns (User)
|
||||
|
||||
@doc "Update User Notify"
|
||||
@handler UpdateUserNotify
|
||||
put /notify (UpdateUserNotifyRequest)
|
||||
|
||||
@doc "Update User Password"
|
||||
@handler UpdateUserPassword
|
||||
put /password (UpdateUserPasswordRequest)
|
||||
|
||||
@doc "Query User Subscribe"
|
||||
@handler QueryUserSubscribe
|
||||
get /subscribe returns (QueryUserSubscribeListResponse)
|
||||
|
||||
@doc "Pre Unsubscribe"
|
||||
@handler PreUnsubscribe
|
||||
post /unsubscribe/pre (PreUnsubscribeRequest) returns (PreUnsubscribeResponse)
|
||||
|
||||
@doc "Unsubscribe"
|
||||
@handler Unsubscribe
|
||||
post /unsubscribe (UnsubscribeRequest)
|
||||
|
||||
@doc "Query User Balance Log"
|
||||
@handler QueryUserBalanceLog
|
||||
get /balance_log returns (QueryUserBalanceLogListResponse)
|
||||
|
||||
@doc "Query User Affiliate Count"
|
||||
@handler QueryUserAffiliate
|
||||
get /affiliate/count returns (QueryUserAffiliateCountResponse)
|
||||
|
||||
@doc "Query User Affiliate List"
|
||||
@handler QueryUserAffiliateList
|
||||
get /affiliate/list (QueryUserAffiliateListRequest) returns (QueryUserAffiliateListResponse)
|
||||
|
||||
@doc "Bind Telegram"
|
||||
@handler BindTelegram
|
||||
get /bind_telegram returns (BindTelegramResponse)
|
||||
|
||||
@doc "Unbind Telegram"
|
||||
@handler UnbindTelegram
|
||||
post /unbind_telegram
|
||||
|
||||
@doc "Query User Commission Log"
|
||||
@handler QueryUserCommissionLog
|
||||
get /commission_log (QueryUserCommissionLogListRequest) returns (QueryUserCommissionLogListResponse)
|
||||
|
||||
@doc "Bind OAuth"
|
||||
@handler BindOAuth
|
||||
post /bind_oauth (BindOAuthRequest) returns (BindOAuthResponse)
|
||||
|
||||
@doc "Bind OAuth Callback"
|
||||
@handler BindOAuthCallback
|
||||
post /bind_oauth/callback (BindOAuthCallbackRequest)
|
||||
|
||||
@doc "Get OAuth Methods"
|
||||
@handler GetOAuthMethods
|
||||
get /oauth_methods returns (GetOAuthMethodsResponse)
|
||||
|
||||
@doc "Unbind OAuth"
|
||||
@handler UnbindOAuth
|
||||
post /unbind_oauth (UnbindOAuthRequest)
|
||||
|
||||
@doc "Reset User Subscribe Token"
|
||||
@handler ResetUserSubscribeToken
|
||||
put /subscribe_token (ResetUserSubscribeTokenRequest)
|
||||
|
||||
@doc "Get Login Log"
|
||||
@handler GetLoginLog
|
||||
get /login_log (GetLoginLogRequest) returns (GetLoginLogResponse)
|
||||
|
||||
@doc "Get Subscribe Log"
|
||||
@handler GetSubscribeLog
|
||||
get /subscribe_log (GetSubscribeLogRequest) returns (GetSubscribeLogResponse)
|
||||
|
||||
@doc "Verify Email"
|
||||
@handler VerifyEmail
|
||||
post /verify_email (VerifyEmailRequest)
|
||||
|
||||
@doc "Update Bind Mobile"
|
||||
@handler UpdateBindMobile
|
||||
put /bind_mobile (UpdateBindMobileRequest)
|
||||
|
||||
@doc "Update Bind Email"
|
||||
@handler UpdateBindEmail
|
||||
put /bind_email (UpdateBindEmailRequest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user