init: 1.0.0
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user