refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
feat: 添加版本和构建时间变量 fix: 修正短信队列类型注释错误 style: 清理未使用的代码和测试文件 docs: 更新安装文档中的下载链接 chore: 迁移数据库脚本添加日志和订阅配置
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Application API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
SubscribeApplication {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
SubscribeTemplate string `json:"template"`
|
||||
OutputFormat string `json:"output_format"`
|
||||
DownloadLink DownloadLink `json:"download_link,omitempty"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
GetSubscribeApplicationListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []SubscribeApplication `json:"list"`
|
||||
}
|
||||
CreateSubscribeApplicationRequest {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
SubscribeTemplate string `json:"template"`
|
||||
OutputFormat string `json:"output_format"`
|
||||
DownloadLink DownloadLink `json:"download_link"`
|
||||
}
|
||||
UpdateSubscribeApplicationRequest {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
SubscribeTemplate string `json:"template"`
|
||||
OutputFormat string `json:"output_format"`
|
||||
DownloadLink DownloadLink `json:"download_link,omitempty"`
|
||||
}
|
||||
DeleteSubscribeApplicationRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
GetSubscribeApplicationListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
}
|
||||
PreviewSubscribeTemplateRequest {
|
||||
Id int64 `form:"id"`
|
||||
}
|
||||
PreviewSubscribeTemplateResponse {
|
||||
Template string `json:"template"` // 预览的模板内容
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/application
|
||||
group: admin/application
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create subscribe application"
|
||||
@handler CreateSubscribeApplication
|
||||
post / (CreateSubscribeApplicationRequest) returns (SubscribeApplication)
|
||||
|
||||
@doc "Update subscribe application"
|
||||
@handler UpdateSubscribeApplication
|
||||
put /subscribe_application (UpdateSubscribeApplicationRequest) returns (SubscribeApplication)
|
||||
|
||||
@doc "Get subscribe application list"
|
||||
@handler GetSubscribeApplicationList
|
||||
get /subscribe_application_list (GetSubscribeApplicationListRequest) returns (GetSubscribeApplicationListResponse)
|
||||
|
||||
@doc "Delete subscribe application"
|
||||
@handler DeleteSubscribeApplication
|
||||
delete /subscribe_application (DeleteSubscribeApplicationRequest)
|
||||
|
||||
@doc "Preview Template"
|
||||
@handler PreviewSubscribeTemplate
|
||||
get /preview (PreviewSubscribeTemplateRequest) returns (PreviewSubscribeTemplateResponse)
|
||||
}
|
||||
|
||||
+1
-5
@@ -25,17 +25,14 @@ type (
|
||||
GetAuthMethodListResponse {
|
||||
List []AuthMethodConfig `json:"list"`
|
||||
}
|
||||
|
||||
|
||||
TestSmsSendRequest {
|
||||
AreaCode string `json:"area_code" validate:"required"`
|
||||
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 (
|
||||
@@ -56,7 +53,6 @@ service ppanel {
|
||||
@handler UpdateAuthMethodConfig
|
||||
put /config (UpdateAuthMethodConfigRequest) returns (AuthMethodConfig)
|
||||
|
||||
|
||||
@doc "Test sms send"
|
||||
@handler TestSmsSend
|
||||
post /test_sms_send (TestSmsSendRequest)
|
||||
|
||||
@@ -21,7 +21,7 @@ type (
|
||||
Download int64 `json:"download"`
|
||||
}
|
||||
ServerTotalDataResponse {
|
||||
OnlineUserIPs int64 `json:"online_user_ips"`
|
||||
OnlineUsers int64 `json:"online_users"`
|
||||
OnlineServers int64 `json:"online_servers"`
|
||||
OfflineServers int64 `json:"offline_servers"`
|
||||
TodayUpload int64 `json:"today_upload"`
|
||||
|
||||
@@ -21,8 +21,8 @@ type (
|
||||
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"`
|
||||
UsedCount int64 `json:"used_count,omitempty"`
|
||||
Enable *bool `json:"enable,omitempty"`
|
||||
}
|
||||
UpdateCouponRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
@@ -35,8 +35,8 @@ type (
|
||||
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"`
|
||||
UsedCount int64 `json:"used_count,omitempty"`
|
||||
Enable *bool `json:"enable,omitempty"`
|
||||
}
|
||||
DeleteCouponRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Device API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
info (
|
||||
title: "Device API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
)
|
||||
+229
-8
@@ -12,19 +12,184 @@ 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"`
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Type uint8 `form:"type"`
|
||||
Search string `form:"search,optional"`
|
||||
}
|
||||
GetMessageLogListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []MessageLog `json:"list"`
|
||||
}
|
||||
FilterLogParams {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Date string `form:"date,optional"`
|
||||
Search string `form:"search,optional"`
|
||||
}
|
||||
FilterEmailLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []MessageLog `json:"list"`
|
||||
}
|
||||
FilterMobileLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []MessageLog `json:"list"`
|
||||
}
|
||||
SubscribeLog {
|
||||
UserId int64 `json:"user_id"`
|
||||
Token string `json:"token"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
ClientIP string `json:"client_ip"`
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterSubscribeLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
UserSubscribeId int64 `form:"user_subscribe_id,optional"`
|
||||
}
|
||||
FilterSubscribeLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []SubscribeLog `json:"list"`
|
||||
}
|
||||
LoginLog {
|
||||
UserId int64 `json:"user_id"`
|
||||
Method string `json:"method"`
|
||||
LoginIP string `json:"login_ip"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
Success bool `json:"success"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterLoginLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterLoginLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []LoginLog `json:"list"`
|
||||
}
|
||||
RegisterLog {
|
||||
UserId int64 `json:"user_id"`
|
||||
AuthMethod string `json:"auth_method"`
|
||||
Identifier string `json:"identifier"`
|
||||
RegisterIP string `json:"register_ip"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterRegisterLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterRegisterLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []RegisterLog `json:"list"`
|
||||
}
|
||||
ResetSubscribeLog {
|
||||
Type uint16 `json:"type"`
|
||||
UserId int64 `json:"user_id"`
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
OrderNo string `json:"order_no,omitempty"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterResetSubscribeLogRequest {
|
||||
FilterLogParams
|
||||
UserSubscribeId int64 `form:"user_subscribe_id,optional"`
|
||||
}
|
||||
FilterResetSubscribeLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ResetSubscribeLog `json:"list"`
|
||||
}
|
||||
UserSubscribeTrafficLog {
|
||||
SubscribeId int64 `json:"subscribe_id"` // Subscribe ID
|
||||
UserId int64 `json:"user_id"` // User ID
|
||||
Upload int64 `json:"upload"` // Upload traffic in bytes
|
||||
Download int64 `json:"download"` // Download traffic in bytes
|
||||
Total int64 `json:"total"` // Total traffic in bytes (Upload + Download)
|
||||
Date string `json:"date"` // Date in YYYY-MM-DD format
|
||||
Details bool `json:"details"` // Whether to show detailed traffic
|
||||
}
|
||||
FilterSubscribeTrafficRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
UserSubscribeId int64 `form:"user_subscribe_id,optional"`
|
||||
}
|
||||
FilterSubscribeTrafficResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []UserSubscribeTrafficLog `json:"list"`
|
||||
}
|
||||
ServerTrafficLog {
|
||||
ServerId int64 `json:"server_id"` // Server ID
|
||||
Upload int64 `json:"upload"` // Upload traffic in bytes
|
||||
Download int64 `json:"download"` // Download traffic in bytes
|
||||
Total int64 `json:"total"` // Total traffic in bytes (Upload + Download)
|
||||
Date string `json:"date"` // Date in YYYY-MM-DD format
|
||||
Details bool `json:"details"` // Whether to show detailed traffic
|
||||
}
|
||||
FilterServerTrafficLogRequest {
|
||||
FilterLogParams
|
||||
ServerId int64 `form:"server_id,optional"`
|
||||
}
|
||||
FilterServerTrafficLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerTrafficLog `json:"list"`
|
||||
}
|
||||
FilterBalanceLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterBalanceLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []BalanceLog `json:"list"`
|
||||
}
|
||||
FilterCommissionLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterCommissionLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []CommissionLog `json:"list"`
|
||||
}
|
||||
GiftLog {
|
||||
Type uint16 `json:"type"`
|
||||
userId int64 `json:"user_id"`
|
||||
OrderNo string `json:"order_no"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
Balance int64 `json:"balance"`
|
||||
Remark string `json:"remark,omitempty"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterGiftLogRequest {
|
||||
FilterLogParams
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterGiftLogResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []GiftLog `json:"list"`
|
||||
}
|
||||
TrafficLogDetails {
|
||||
Id int64 `json:"id"`
|
||||
ServerId int64 `json:"server_id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Download int64 `json:"download"`
|
||||
Upload int64 `json:"upload"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
FilterTrafficLogDetailsRequest {
|
||||
FilterLogParams
|
||||
ServerId int64 `form:"server_id,optional"`
|
||||
SubscribeId int64 `form:"subscribe_id,optional"`
|
||||
UserId int64 `form:"user_id,optional"`
|
||||
}
|
||||
FilterTrafficLogDetailsResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []TrafficLogDetails `json:"list"`
|
||||
}
|
||||
LogSetting {
|
||||
AutoClear *bool `json:"auto_clear"`
|
||||
ClearDays int64 `json:"clear_days"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
@@ -36,5 +201,61 @@ service ppanel {
|
||||
@doc "Get message log list"
|
||||
@handler GetMessageLogList
|
||||
get /message/list (GetMessageLogListRequest) returns (GetMessageLogListResponse)
|
||||
|
||||
@doc "Filter email log"
|
||||
@handler FilterEmailLog
|
||||
get /email/list (FilterLogParams) returns (FilterEmailLogResponse)
|
||||
|
||||
@doc "Filter mobile log"
|
||||
@handler FilterMobileLog
|
||||
get /mobile/list (FilterLogParams) returns (FilterMobileLogResponse)
|
||||
|
||||
@doc "Filter subscribe log"
|
||||
@handler FilterSubscribeLog
|
||||
get /subscribe/list (FilterSubscribeLogRequest) returns (FilterSubscribeLogResponse)
|
||||
|
||||
@doc "Filter login log"
|
||||
@handler FilterLoginLog
|
||||
get /login/list (FilterLoginLogRequest) returns (FilterLoginLogResponse)
|
||||
|
||||
@doc "Filter register log"
|
||||
@handler FilterRegisterLog
|
||||
get /register/list (FilterRegisterLogRequest) returns (FilterRegisterLogResponse)
|
||||
|
||||
@doc "Filter reset subscribe log"
|
||||
@handler FilterResetSubscribeLog
|
||||
get /subscribe/reset/list (FilterResetSubscribeLogRequest) returns (FilterResetSubscribeLogResponse)
|
||||
|
||||
@doc "Filter user subscribe traffic log"
|
||||
@handler FilterUserSubscribeTrafficLog
|
||||
get /subscribe/traffic/list (FilterSubscribeTrafficRequest) returns (FilterSubscribeTrafficResponse)
|
||||
|
||||
@doc "Filter server traffic log"
|
||||
@handler FilterServerTrafficLog
|
||||
get /server/traffic/list (FilterServerTrafficLogRequest) returns (FilterServerTrafficLogResponse)
|
||||
|
||||
@doc "Filter balance log"
|
||||
@handler FilterBalanceLog
|
||||
get /balance/list (FilterBalanceLogRequest) returns (FilterBalanceLogResponse)
|
||||
|
||||
@doc "Filter commission log"
|
||||
@handler FilterCommissionLog
|
||||
get /commission/list (FilterCommissionLogRequest) returns (FilterCommissionLogResponse)
|
||||
|
||||
@doc "Filter gift log"
|
||||
@handler FilterGiftLog
|
||||
get /gift/list (FilterGiftLogRequest) returns (FilterGiftLogResponse)
|
||||
|
||||
@doc "Filter traffic log details"
|
||||
@handler FilterTrafficLogDetails
|
||||
get /traffic/details (FilterTrafficLogDetailsRequest) returns (FilterTrafficLogDetailsResponse)
|
||||
|
||||
@doc "Get log setting"
|
||||
@handler GetLogSetting
|
||||
get /setting returns (LogSetting)
|
||||
|
||||
@doc "Update log setting"
|
||||
@handler UpdateLogSetting
|
||||
post /setting (LogSetting)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Marketing API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
type (
|
||||
CreateBatchSendEmailTaskRequest {
|
||||
Subject string `json:"subject"`
|
||||
Content string `json:"content"`
|
||||
Scope int8 `json:"scope"`
|
||||
RegisterStartTime int64 `json:"register_start_time,omitempty"`
|
||||
RegisterEndTime int64 `json:"register_end_time,omitempty"`
|
||||
Additional string `json:"additional,omitempty"`
|
||||
Scheduled int64 `json:"scheduled,omitempty"`
|
||||
Interval uint8 `json:"interval,omitempty"`
|
||||
Limit uint64 `json:"limit,omitempty"`
|
||||
}
|
||||
BatchSendEmailTask {
|
||||
Id int64 `json:"id"`
|
||||
Subject string `json:"subject"`
|
||||
Content string `json:"content"`
|
||||
Recipients string `json:"recipients"`
|
||||
Scope int8 `json:"scope"`
|
||||
RegisterStartTime int64 `json:"register_start_time"`
|
||||
RegisterEndTime int64 `json:"register_end_time"`
|
||||
Additional string `json:"additional"`
|
||||
Scheduled int64 `json:"scheduled"`
|
||||
Interval uint8 `json:"interval"`
|
||||
Limit uint64 `json:"limit"`
|
||||
Status uint8 `json:"status"`
|
||||
Errors string `json:"errors"`
|
||||
Total uint64 `json:"total"`
|
||||
Current uint64 `json:"current"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
GetBatchSendEmailTaskListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Scope *int8 `form:"scope,omitempty"`
|
||||
Status *uint8 `form:"status,omitempty"`
|
||||
}
|
||||
GetBatchSendEmailTaskListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []BatchSendEmailTask `json:"list"`
|
||||
}
|
||||
StopBatchSendEmailTaskRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
GetPreSendEmailCountRequest {
|
||||
Scope int8 `json:"scope"`
|
||||
RegisterStartTime int64 `json:"register_start_time,omitempty"`
|
||||
RegisterEndTime int64 `json:"register_end_time,omitempty"`
|
||||
}
|
||||
GetPreSendEmailCountResponse {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
GetBatchSendEmailTaskStatusRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
GetBatchSendEmailTaskStatusResponse {
|
||||
Status uint8 `json:"status"`
|
||||
Current int64 `json:"current"`
|
||||
Total int64 `json:"total"`
|
||||
Errors string `json:"errors"`
|
||||
}
|
||||
CreateQuotaTaskRequest {
|
||||
Subscribers []int64 `json:"subscribers"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
ResetTraffic bool `json:"reset_traffic"`
|
||||
Days uint64 `json:"days"`
|
||||
GiftType uint8 `json:"gift_type"`
|
||||
GiftValue uint64 `json:"gift_value"`
|
||||
}
|
||||
QuotaTask {
|
||||
Id int64 `json:"id"`
|
||||
Subscribers []int64 `json:"subscribers"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
ResetTraffic bool `json:"reset_traffic"`
|
||||
Days uint64 `json:"days"`
|
||||
GiftType uint8 `json:"gift_type"`
|
||||
GiftValue uint64 `json:"gift_value"`
|
||||
Objects []int64 `json:"objects"` // UserSubscribe IDs
|
||||
Status uint8 `json:"status"`
|
||||
Total int64 `json:"total"`
|
||||
Current int64 `json:"current"`
|
||||
Errors string `json:"errors"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
QueryQuotaTaskPreCountRequest {
|
||||
Subscribers []int64 `json:"subscribers"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
}
|
||||
QueryQuotaTaskPreCountResponse {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
QueryQuotaTaskListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Status *uint8 `form:"status,omitempty"`
|
||||
}
|
||||
QueryQuotaTaskListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []QuotaTask `json:"list"`
|
||||
}
|
||||
QueryQuotaTaskStatusRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
QueryQuotaTaskStatusResponse {
|
||||
Status uint8 `json:"status"`
|
||||
Current int64 `json:"current"`
|
||||
Total int64 `json:"total"`
|
||||
Errors string `json:"errors"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/marketing
|
||||
group: admin/marketing
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Create a batch send email task"
|
||||
@handler CreateBatchSendEmailTask
|
||||
post /email/batch/send (CreateBatchSendEmailTaskRequest)
|
||||
|
||||
@doc "Get batch send email task list"
|
||||
@handler GetBatchSendEmailTaskList
|
||||
get /email/batch/list (GetBatchSendEmailTaskListRequest) returns (GetBatchSendEmailTaskListResponse)
|
||||
|
||||
@doc "Stop a batch send email task"
|
||||
@handler StopBatchSendEmailTask
|
||||
post /email/batch/stop (StopBatchSendEmailTaskRequest)
|
||||
|
||||
@doc "Get pre-send email count"
|
||||
@handler GetPreSendEmailCount
|
||||
post /email/batch/pre-send-count (GetPreSendEmailCountRequest) returns (GetPreSendEmailCountResponse)
|
||||
|
||||
@doc "Get batch send email task status"
|
||||
@handler GetBatchSendEmailTaskStatus
|
||||
post /email/batch/status (GetBatchSendEmailTaskStatusRequest) returns (GetBatchSendEmailTaskStatusResponse)
|
||||
|
||||
@doc "Create a quota task"
|
||||
@handler CreateQuotaTask
|
||||
post /quota/create (CreateQuotaTaskRequest)
|
||||
|
||||
@doc "Query quota task pre-count"
|
||||
@handler QueryQuotaTaskPreCount
|
||||
post /quota/pre-count (QueryQuotaTaskPreCountRequest) returns (QueryQuotaTaskPreCountResponse)
|
||||
|
||||
@doc "Query quota task list"
|
||||
@handler QueryQuotaTaskList
|
||||
get /quota/list (QueryQuotaTaskListRequest) returns (QueryQuotaTaskListResponse)
|
||||
}
|
||||
|
||||
+158
-136
@@ -11,104 +11,134 @@ info (
|
||||
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"`
|
||||
ServerOnlineIP {
|
||||
IP string `json:"ip"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
GetNodeServerListResponse {
|
||||
ServerOnlineUser {
|
||||
IP []ServerOnlineIP `json:"ip"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Subscribe string `json:"subscribe"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
ExpiredAt int64 `json:"expired_at"`
|
||||
}
|
||||
ServerStatus {
|
||||
Cpu float64 `json:"cpu"`
|
||||
Mem float64 `json:"mem"`
|
||||
Disk float64 `json:"disk"`
|
||||
Protocol string `json:"protocol"`
|
||||
Online []ServerOnlineUser `json:"online"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
Server {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Address string `json:"address"`
|
||||
Sort int `json:"sort"`
|
||||
Protocols []Protocol `json:"protocols"`
|
||||
LastReportedAt int64 `json:"last_reported_at"`
|
||||
Status ServerStatus `json:"status"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
CreateServerRequest {
|
||||
Name string `json:"name"`
|
||||
Country string `json:"country,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
Address string `json:"address"`
|
||||
Sort int `json:"sort,omitempty"`
|
||||
Protocols []Protocol `json:"protocols"`
|
||||
}
|
||||
UpdateServerRequest {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Country string `json:"country,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
Address string `json:"address"`
|
||||
Sort int `json:"sort,omitempty"`
|
||||
Protocols []Protocol `json:"protocols"`
|
||||
}
|
||||
DeleteServerRequest {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
FilterServerListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
FilterServerListResponse {
|
||||
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"`
|
||||
GetServerProtocolsRequest {
|
||||
Id int64 `form:"id"`
|
||||
}
|
||||
GetServerProtocolsResponse {
|
||||
Protocols []Protocol `json:"protocols"`
|
||||
}
|
||||
Node {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Tags []string `json:"tags"`
|
||||
Port uint16 `json:"port"`
|
||||
Address string `json:"address"`
|
||||
ServerId int64 `json:"server_id"`
|
||||
Protocol string `json:"protocol"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
Sort int `json:"sort,omitempty"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
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"`
|
||||
Name string `json:"name"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Port uint16 `json:"port"`
|
||||
Address string `json:"address"`
|
||||
ServerId int64 `json:"server_id"`
|
||||
Protocol string `json:"protocol"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
UpdateNodeRequest {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Port uint16 `json:"port"`
|
||||
Address string `json:"address"`
|
||||
ServerId int64 `json:"server_id"`
|
||||
Protocol string `json:"protocol"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
ToggleNodeStatusRequest {
|
||||
Id int64 `json:"id"`
|
||||
Enable *bool `json:"enable"`
|
||||
}
|
||||
DeleteNodeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
GetNodeGroupListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerGroup `json:"list"`
|
||||
FilterNodeListRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
CreateNodeGroupRequest {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
FilterNodeListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Node `json:"list"`
|
||||
}
|
||||
UpdateNodeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Description string `json:"description"`
|
||||
HasMigrateSeverNodeResponse {
|
||||
HasMigrate bool `json:"has_migrate"`
|
||||
}
|
||||
DeleteNodeGroupRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
MigrateServerNodeResponse {
|
||||
Succee uint64 `json:"succee"`
|
||||
Fail uint64 `json:"fail"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
BatchDeleteNodeRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
BatchDeleteNodeGroupRequest {
|
||||
Ids []int64 `json:"ids" validate:"required"`
|
||||
}
|
||||
GetNodeDetailRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
NodeSortRequest {
|
||||
ResetSortRequest {
|
||||
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 {
|
||||
QueryNodeTagResponse {
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
)
|
||||
@@ -119,72 +149,64 @@ type (
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get node tag list"
|
||||
@handler GetNodeTagList
|
||||
get /tag/list returns (GetNodeTagListResponse)
|
||||
@doc "Create Server"
|
||||
@handler CreateServer
|
||||
post /create (CreateServerRequest)
|
||||
|
||||
@doc "Get node list"
|
||||
@handler GetNodeList
|
||||
get /list (GetNodeServerListRequest) returns (GetNodeServerListResponse)
|
||||
@doc "Update Server"
|
||||
@handler UpdateServer
|
||||
post /update (UpdateServerRequest)
|
||||
|
||||
@doc "Get node detail"
|
||||
@handler GetNodeDetail
|
||||
get /detail (GetNodeDetailRequest) returns (Server)
|
||||
@doc "Delete Server"
|
||||
@handler DeleteServer
|
||||
post /delete (DeleteServerRequest)
|
||||
|
||||
@doc "Update node"
|
||||
@handler UpdateNode
|
||||
put / (UpdateNodeRequest)
|
||||
@doc "Filter Server List"
|
||||
@handler FilterServerList
|
||||
get /list (FilterServerListRequest) returns (FilterServerListResponse)
|
||||
|
||||
@doc "Create node"
|
||||
@doc "Get Server Protocols"
|
||||
@handler GetServerProtocols
|
||||
get /protocols (GetServerProtocolsRequest) returns (GetServerProtocolsResponse)
|
||||
|
||||
@doc "Create Node"
|
||||
@handler CreateNode
|
||||
post / (CreateNodeRequest)
|
||||
post /node/create (CreateNodeRequest)
|
||||
|
||||
@doc "Delete node"
|
||||
@doc "Update Node"
|
||||
@handler UpdateNode
|
||||
post /node/update (UpdateNodeRequest)
|
||||
|
||||
@doc "Delete Node"
|
||||
@handler DeleteNode
|
||||
delete / (DeleteNodeRequest)
|
||||
post /node/delete (DeleteNodeRequest)
|
||||
|
||||
@doc "Batch delete node"
|
||||
@handler BatchDeleteNode
|
||||
delete /batch (BatchDeleteNodeRequest)
|
||||
@doc "Filter Node List"
|
||||
@handler FilterNodeList
|
||||
get /node/list (FilterNodeListRequest) returns (FilterNodeListResponse)
|
||||
|
||||
@doc "Get node group list"
|
||||
@handler GetNodeGroupList
|
||||
get /group/list returns (GetNodeGroupListResponse)
|
||||
@doc "Toggle Node Status"
|
||||
@handler ToggleNodeStatus
|
||||
post /node/status/toggle (ToggleNodeStatusRequest)
|
||||
|
||||
@doc "Create node group"
|
||||
@handler CreateNodeGroup
|
||||
post /group (CreateNodeGroupRequest)
|
||||
@doc "Check if there is any server or node to migrate"
|
||||
@handler HasMigrateSeverNode
|
||||
get /migrate/has returns (HasMigrateSeverNodeResponse)
|
||||
|
||||
@doc "Update node group"
|
||||
@handler UpdateNodeGroup
|
||||
put /group (UpdateNodeGroupRequest)
|
||||
@doc "Migrate server and node data to new database"
|
||||
@handler MigrateServerNode
|
||||
post /migrate/run returns (MigrateServerNodeResponse)
|
||||
|
||||
@doc "Delete node group"
|
||||
@handler DeleteNodeGroup
|
||||
delete /group (DeleteNodeGroupRequest)
|
||||
@doc "Reset server sort"
|
||||
@handler ResetSortWithServer
|
||||
post /server/sort (ResetSortRequest)
|
||||
|
||||
@doc "Batch delete node group"
|
||||
@handler BatchDeleteNodeGroup
|
||||
delete /group/batch (BatchDeleteNodeGroupRequest)
|
||||
@doc "Reset node sort"
|
||||
@handler ResetSortWithNode
|
||||
post /node/sort (ResetSortRequest)
|
||||
|
||||
@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)
|
||||
@doc "Query all node tags"
|
||||
@handler QueryNodeTag
|
||||
get /node/tags returns (QueryNodeTagResponse)
|
||||
}
|
||||
|
||||
|
||||
+49
-52
@@ -34,70 +34,67 @@ type (
|
||||
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"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Language string `json:"language"`
|
||||
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"`
|
||||
Nodes []int64 `json:"nodes"`
|
||||
NodeTags []string `json:"node_tags"`
|
||||
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"`
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Language string `json:"language"`
|
||||
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"`
|
||||
Nodes []int64 `json:"nodes"`
|
||||
NodeTags []string `json:"node_tags"`
|
||||
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"`
|
||||
Page int64 `form:"page" validate:"required"`
|
||||
Size int64 `form:"size" validate:"required"`
|
||||
Language string `form:"language,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
|
||||
SubscribeItem {
|
||||
Subscribe
|
||||
|
||||
Sold int64 `json:"sold"`
|
||||
Subscribe
|
||||
Sold int64 `json:"sold"`
|
||||
}
|
||||
|
||||
GetSubscribeListResponse {
|
||||
List []SubscribeItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
DeleteSubscribeRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
|
||||
+8
-84
@@ -11,50 +11,6 @@ info (
|
||||
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"`
|
||||
}
|
||||
@@ -62,6 +18,10 @@ type (
|
||||
SetNodeMultiplierRequest {
|
||||
Periods []TimePeriod `json:"periods"`
|
||||
}
|
||||
PreViewNodeMultiplierResponse {
|
||||
CurrentTime string `json:"current_time"`
|
||||
Ratio float32 `json:"ratio"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
@@ -86,46 +46,6 @@ service ppanel {
|
||||
@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)
|
||||
@@ -201,5 +121,9 @@ service ppanel {
|
||||
@doc "Update Verify Code Config"
|
||||
@handler UpdateVerifyCodeConfig
|
||||
put /verify_code_config (VerifyCodeConfig)
|
||||
|
||||
@doc "PreView Node Multiplier"
|
||||
@handler PreViewNodeMultiplier
|
||||
get /node_multiplier/preview returns (PreViewNodeMultiplierResponse)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ import "../types.api"
|
||||
|
||||
type (
|
||||
UpdateTicketStatusRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
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"`
|
||||
Status *uint8 `form:"status,omitempty"`
|
||||
Search string `form:"search,omitempty"`
|
||||
}
|
||||
GetTicketListResponse {
|
||||
|
||||
+26
-19
@@ -1,33 +1,40 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Tools Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
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"`
|
||||
}
|
||||
LogResponse {
|
||||
List interface{} `json:"list"`
|
||||
}
|
||||
VersionResponse {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/admin/tool
|
||||
group: admin/tool
|
||||
middleware: AuthMiddleware
|
||||
prefix: v1/admin/tool
|
||||
group: admin/tool
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
@doc "Get System Log"
|
||||
@handler GetSystemLog
|
||||
get /log returns (LogResponse)
|
||||
@doc "Get System Log"
|
||||
@handler GetSystemLog
|
||||
get /log returns (LogResponse)
|
||||
|
||||
@doc "Restart System"
|
||||
@handler RestartSystem
|
||||
get /restart
|
||||
@doc "Restart System"
|
||||
@handler RestartSystem
|
||||
get /restart
|
||||
|
||||
@doc "Get Version"
|
||||
@handler GetVersion
|
||||
get /version returns (VersionResponse)
|
||||
}
|
||||
|
||||
|
||||
+40
-23
@@ -32,17 +32,19 @@ type (
|
||||
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"`
|
||||
UserId int64 `json:"user_id" validate:"required"`
|
||||
Password string `json:"password"`
|
||||
Avatar string `json:"avatar"`
|
||||
Balance int64 `json:"balance"`
|
||||
Commission int64 `json:"commission"`
|
||||
ReferralPercentage uint8 `json:"referral_percentage"`
|
||||
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
||||
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"`
|
||||
@@ -52,18 +54,20 @@ type (
|
||||
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"`
|
||||
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"`
|
||||
ReferralPercentage uint8 `json:"referral_percentage"`
|
||||
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
||||
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"`
|
||||
@@ -164,6 +168,15 @@ type (
|
||||
List []UserLoginLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
GetUserSubscribeResetTrafficLogsRequest {
|
||||
Page int `form:"page"`
|
||||
Size int `form:"size"`
|
||||
UserSubscribeId int64 `form:"user_subscribe_id"`
|
||||
}
|
||||
GetUserSubscribeResetTrafficLogsResponse {
|
||||
List []ResetSubscribeTrafficLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
DeleteUserSubscribeRequest {
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
}
|
||||
@@ -251,6 +264,10 @@ service ppanel {
|
||||
@handler GetUserSubscribeLogs
|
||||
get /subscribe/logs (GetUserSubscribeLogsRequest) returns (GetUserSubscribeLogsResponse)
|
||||
|
||||
@doc "Get user subcribe reset traffic logs"
|
||||
@handler GetUserSubscribeResetTrafficLogs
|
||||
get /subscribe/reset/logs (GetUserSubscribeResetTrafficLogsRequest) returns (GetUserSubscribeResetTrafficLogsResponse)
|
||||
|
||||
@doc "Get user subcribe traffic logs"
|
||||
@handler GetUserSubscribeTrafficLogs
|
||||
get /subscribe/traffic_logs (GetUserSubscribeTrafficLogsRequest) returns (GetUserSubscribeTrafficLogsResponse)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
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/app/announcement
|
||||
group: app/announcement
|
||||
middleware: AppMiddleware,AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query announcement"
|
||||
@handler QueryAnnouncement
|
||||
get /list (QueryAnnouncementRequest) returns (QueryAnnouncementResponse)
|
||||
}
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "App Auth Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"../types.api"
|
||||
)
|
||||
|
||||
type (
|
||||
AppAuthCheckRequest {
|
||||
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
||||
Account string `json:"account"`
|
||||
Identifier string `json:"identifier" validate:"required"`
|
||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||
AreaCode string `json:"area_code"`
|
||||
}
|
||||
AppAuthCheckResponse {
|
||||
Status bool
|
||||
}
|
||||
AppAuthRequest {
|
||||
Method string `json:"method" validate:"required" validate:"required,oneof=device email mobile"`
|
||||
Account string `json:"account"`
|
||||
Password string `json:"password"`
|
||||
Identifier string `json:"identifier" validate:"required"`
|
||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||
Code string `json:"code"`
|
||||
Invite string `json:"invite"`
|
||||
AreaCode string `json:"area_code"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
AppAuthRespone {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
AppSendCodeRequest {
|
||||
Method string `json:"method" validate:"required" validate:"required,oneof=email mobile"`
|
||||
Account string `json:"account"`
|
||||
AreaCode string `json:"area_code"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
AppSendCodeRespone {
|
||||
Status bool `json:"status"`
|
||||
Code string `json:"code,omitempty"`
|
||||
}
|
||||
AppConfigRequest {
|
||||
UserAgent string `json:"user_agent" validate:"required,oneof=windows mac linux android ios harmony"`
|
||||
}
|
||||
AppConfigResponse {
|
||||
EncryptionKey string `json:"encryption_key"`
|
||||
EncryptionMethod string `json:"encryption_method"`
|
||||
Domains []string `json:"domains"`
|
||||
StartupPicture string `json:"startup_picture"`
|
||||
StartupPictureSkipTime int64 `json:"startup_picture_skip_time"`
|
||||
Application AppInfo `json:"applications"`
|
||||
OfficialEmail string `json:"official_email"`
|
||||
OfficialWebsite string `json:"official_website"`
|
||||
OfficialTelegram string `json:"official_telegram"`
|
||||
OfficialTelephone string `json:"official_telephone"`
|
||||
InvitationLink string `json:"invitation_link"`
|
||||
KrWebsiteId string `json:"kr_website_id"`
|
||||
}
|
||||
AppInfo {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Url string `json:"url"`
|
||||
Version string `json:"version"`
|
||||
VersionReview string `json:"version_review"`
|
||||
VersionDescription string `json:"version_description"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: v1/app/auth
|
||||
group: app/auth
|
||||
middleware: AppMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Check Account"
|
||||
@handler Check
|
||||
post /check (AppAuthCheckRequest) returns (AppAuthCheckResponse)
|
||||
|
||||
@doc "Login"
|
||||
@handler Login
|
||||
post /login (AppAuthRequest) returns (AppAuthRespone)
|
||||
|
||||
@doc "Register"
|
||||
@handler Register
|
||||
post /register (AppAuthRequest) returns (AppAuthRespone)
|
||||
|
||||
@doc "Reset Password"
|
||||
@handler ResetPassword
|
||||
post /reset_password (AppAuthRequest) returns (AppAuthRespone)
|
||||
|
||||
@doc "GetAppConfig"
|
||||
@handler GetAppConfig
|
||||
post /config (AppConfigRequest) returns (AppConfigResponse)
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
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/app/document
|
||||
group: app/document
|
||||
middleware: AppMiddleware,AuthMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
@doc "Get document list"
|
||||
@handler QueryDocumentList
|
||||
get /list returns (QueryDocumentListResponse)
|
||||
|
||||
@doc "Get document detail"
|
||||
@handler QueryDocumentDetail
|
||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
|
||||
info(
|
||||
title: "App Node Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
type(
|
||||
|
||||
|
||||
AppRuleGroupListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerRuleGroup `json:"list"`
|
||||
}
|
||||
|
||||
AppUserSubscbribeNodeRequest {
|
||||
Id int64 `form:"id" validate:"required"`
|
||||
}
|
||||
|
||||
AppUserSubscbribeNodeResponse{
|
||||
List []AppUserSubscbribeNode `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/app/node
|
||||
group: app/node
|
||||
middleware: AppMiddleware,AuthMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
|
||||
|
||||
|
||||
@doc "Get Node list"
|
||||
@handler GetNodeList
|
||||
get /list (AppUserSubscbribeNodeRequest) returns(AppUserSubscbribeNodeResponse)
|
||||
|
||||
@doc "Get rule group list"
|
||||
@handler GetRuleGroupList
|
||||
get /rule_group_list returns (AppRuleGroupListResponse)
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
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/app/order
|
||||
group: app/order
|
||||
middleware: AppMiddleware,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 "Checkout order"
|
||||
@handler CheckoutOrder
|
||||
post /checkout (CheckoutOrderRequest) returns (CheckoutOrderResponse)
|
||||
|
||||
@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)
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
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/app/payment
|
||||
group: app/payment
|
||||
middleware: AppMiddleware,AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get available payment methods"
|
||||
@handler GetAvailablePaymentMethods
|
||||
get /methods returns (GetAvailablePaymentMethodsResponse)
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Subscribe API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
type (
|
||||
QueryUserSubscribeResp {
|
||||
Data []UserSubscribeData `json:"data"`
|
||||
}
|
||||
|
||||
UserSubscribeData {
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
}
|
||||
|
||||
|
||||
UserSubscribeResetPeriodRequest {
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
}
|
||||
|
||||
UserSubscribeResetPeriodResponse {
|
||||
Status bool `json:"status"`
|
||||
}
|
||||
|
||||
AppUserSubscribeRequest {
|
||||
ContainsNodes *bool `form:"contains_nodes"`
|
||||
}
|
||||
|
||||
AppUserSubscbribeResponse {
|
||||
List []AppUserSubcbribe `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: v1/app/subscribe
|
||||
group: app/subscribe
|
||||
middleware: AppMiddleware,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)
|
||||
|
||||
@doc "Get Already subscribed to package"
|
||||
@handler QueryUserAlreadySubscribe
|
||||
get /user/already_subscribe returns (QueryUserSubscribeResp)
|
||||
|
||||
|
||||
@doc "Get Available subscriptions for users"
|
||||
@handler QueryUserAvailableUserSubscribe
|
||||
get /user/available_subscribe (AppUserSubscribeRequest) returns (AppUserSubscbribeResponse)
|
||||
|
||||
@doc "Reset user subscription period"
|
||||
@handler ResetUserSubscribePeriod
|
||||
post /reset/period (UserSubscribeResetPeriodRequest) returns (UserSubscribeResetPeriodResponse)
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "App User Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"../types.api"
|
||||
)
|
||||
|
||||
type (
|
||||
UserInfoResponse {
|
||||
Id int64 `json:"id"`
|
||||
Balance int64 `json:"balance"`
|
||||
Email string `json:"email"`
|
||||
RefererId int64 `json:"referer_id"`
|
||||
ReferCode string `json:"refer_code"`
|
||||
Avatar string `json:"avatar"`
|
||||
AreaCode string `json:"area_code"`
|
||||
Telephone string `json:"telephone"`
|
||||
Devices []UserDevice `json:"devices"`
|
||||
AuthMethods []UserAuthMethod `json:"auth_methods"`
|
||||
}
|
||||
UpdatePasswordRequeset {
|
||||
Password string `json:"password"`
|
||||
NewPassword string `json:"new_password"`
|
||||
}
|
||||
DeleteAccountRequest {
|
||||
Method string `json:"method" validate:"required" validate:"required,oneof=email telephone device"`
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
GetUserOnlineTimeStatisticsResponse{
|
||||
WeeklyStats []WeeklyStat`json:"weekly_stats"`
|
||||
ConnectionRecords ConnectionRecords`json:"connection_records"`
|
||||
}
|
||||
|
||||
WeeklyStat{
|
||||
Day int `json:"day"`
|
||||
DayName string `json:"day_name"`
|
||||
Hours float64 `json:"hours"`
|
||||
}
|
||||
ConnectionRecords{
|
||||
CurrentContinuousDays int64 `json:"current_continuous_days"`
|
||||
HistoryContinuousDays int64 `json:"history_continuous_days"`
|
||||
LongestSingleConnection int64 `json:"longest_single_connection"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/app/user
|
||||
group: app/user
|
||||
middleware: AppMiddleware,AuthMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "query user info"
|
||||
@handler QueryUserInfo
|
||||
get /info returns (UserInfoResponse)
|
||||
|
||||
@doc "Update Password "
|
||||
@handler UpdatePassword
|
||||
put /password (UpdatePasswordRequeset)
|
||||
|
||||
@doc "Delete Account"
|
||||
@handler DeleteAccount
|
||||
delete /account (DeleteAccountRequest)
|
||||
|
||||
@doc "Get user subcribe traffic logs"
|
||||
@handler GetUserSubscribeTrafficLogs
|
||||
get /subscribe/traffic_logs (GetUserSubscribeTrafficLogsRequest) returns (GetUserSubscribeTrafficLogsResponse)
|
||||
|
||||
@doc "Get user online time total"
|
||||
@handler GetUserOnlineTimeStatistics
|
||||
get /online_time/statistics returns (GetUserOnlineTimeStatisticsResponse)
|
||||
|
||||
@doc "Query User Affiliate List"
|
||||
@handler QueryUserAffiliateList
|
||||
get /affiliate/list (QueryUserAffiliateListRequest) returns (QueryUserAffiliateListResponse)
|
||||
|
||||
@doc "Query User Affiliate Count"
|
||||
@handler QueryUserAffiliate
|
||||
get /affiliate/count returns (QueryUserAffiliateCountResponse)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "App Heartbeat Api"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
|
||||
@server(
|
||||
prefix: v1/app/ws
|
||||
group: app/ws
|
||||
middleware: AuthMiddleware
|
||||
)
|
||||
|
||||
|
||||
service ppanel {
|
||||
@doc "App heartbeat"
|
||||
@handler AppWs
|
||||
get /:userid/:identifier
|
||||
}
|
||||
+48
-24
@@ -11,11 +11,13 @@ info (
|
||||
type (
|
||||
// User login request
|
||||
UserLoginRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
LoginType string `header:"Login-Type"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
// Check user is exist request
|
||||
CheckUserRequest {
|
||||
@@ -23,50 +25,55 @@ type (
|
||||
}
|
||||
// User login response
|
||||
CheckUserResponse {
|
||||
exist bool `json:"exist"`
|
||||
Exist bool `json:"exist"`
|
||||
}
|
||||
// User login response
|
||||
UserRegisterRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Invite string `json:"invite,optional"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Invite string `json:"invite,optional"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
LoginType string `header:"Login-Type"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
// User login response
|
||||
ResetPasswordRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
Identifier string `json:"identifier"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
LoginType string `header:"Login-Type"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
LoginResponse {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
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"`
|
||||
}
|
||||
OAuthLoginResponse {
|
||||
Redirect string `json:"redirect"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
// login request
|
||||
TelephoneLoginRequest {
|
||||
Identifier string `json:"identifier"`
|
||||
Telephone string `json:"telephone" validate:"required"`
|
||||
TelephoneCode string `json:"telephone_code"`
|
||||
TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
|
||||
Password string `json:"password"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
LoginType string `header:"Login-Type"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
// Check user is exist request
|
||||
@@ -76,25 +83,31 @@ type (
|
||||
}
|
||||
// User login response
|
||||
TelephoneCheckUserResponse {
|
||||
exist bool `json:"exist"`
|
||||
Exist bool `json:"exist"`
|
||||
}
|
||||
// User login response
|
||||
TelephoneRegisterRequest {
|
||||
Identifier string `json:"identifier"`
|
||||
Telephone string `json:"telephone" validate:"required"`
|
||||
TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Invite string `json:"invite,optional"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
LoginType string `header:"Login-Type,optional"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
// User login response
|
||||
TelephoneResetPasswordRequest {
|
||||
Identifier string `json:"identifier"`
|
||||
Telephone string `json:"telephone" validate:"required"`
|
||||
TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Code string `json:"code,optional"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `header:"User-Agent"`
|
||||
LoginType string `header:"Login-Type,optional"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
AppleLoginCallbackRequest {
|
||||
@@ -103,14 +116,21 @@ type (
|
||||
State string `form:"state"`
|
||||
}
|
||||
GoogleLoginCallbackRequest {
|
||||
Code string `form:"code"`
|
||||
Code string `form:"code"`
|
||||
State string `form:"state"`
|
||||
}
|
||||
DeviceLoginRequest {
|
||||
Identifier string `json:"identifier" validate:"required"`
|
||||
IP string `header:"X-Original-Forwarded-For"`
|
||||
UserAgent string `json:"user_agent" validate:"required"`
|
||||
CfToken string `json:"cf_token,optional"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/auth
|
||||
group: auth
|
||||
middleware: DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "User login"
|
||||
@@ -144,6 +164,10 @@ service ppanel {
|
||||
@doc "Reset password"
|
||||
@handler TelephoneResetPassword
|
||||
post /reset/telephone (TelephoneResetPasswordRequest) returns (LoginResponse)
|
||||
|
||||
@doc "Device Login"
|
||||
@handler DeviceLogin
|
||||
post /login/device (DeviceLoginRequest) returns (LoginResponse)
|
||||
}
|
||||
|
||||
@server (
|
||||
|
||||
+23
-14
@@ -35,10 +35,6 @@ type (
|
||||
GetTosResponse {
|
||||
TosContent string `json:"tos_content"`
|
||||
}
|
||||
GetAppcationResponse {
|
||||
Config ApplicationConfig `json:"config"`
|
||||
Applications []ApplicationResponseInfo `json:"applications"`
|
||||
}
|
||||
// GetCodeRequest Get code request
|
||||
SendCodeRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
@@ -70,30 +66,39 @@ type (
|
||||
List []Ads `json:"list"`
|
||||
}
|
||||
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"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
Type uint8 `json:"type" validate:"required"`
|
||||
}
|
||||
|
||||
CheckVerificationCodeRespone{
|
||||
Status bool `json:"status"`
|
||||
CheckVerificationCodeRespone {
|
||||
Status bool `json:"status"`
|
||||
}
|
||||
SubscribeClient {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
IsDefault bool `json:"is_default"`
|
||||
DownloadLink DownloadLink `json:"download_link,omitempty"`
|
||||
}
|
||||
GetSubscribeClientResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []SubscribeClient `json:"list"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/common
|
||||
group: common
|
||||
middleware: DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get global config"
|
||||
@handler GetGlobalConfig
|
||||
get /site/config returns (GetGlobalConfigResponse)
|
||||
|
||||
@doc "Get Tos Content"
|
||||
@handler GetApplication
|
||||
get /application returns (GetAppcationResponse)
|
||||
|
||||
@doc "Get Tos Content"
|
||||
@handler GetTos
|
||||
get /site/tos returns (GetTosResponse)
|
||||
@@ -121,5 +126,9 @@ service ppanel {
|
||||
@doc "Check verification code"
|
||||
@handler CheckVerificationCode
|
||||
post /check_verification_code (CheckVerificationCodeRequest) returns (CheckVerificationCodeRespone)
|
||||
|
||||
@doc "Get Client"
|
||||
@handler GetClient
|
||||
get /client returns (GetSubscribeClientResponse)
|
||||
}
|
||||
|
||||
|
||||
+35
-8
@@ -11,6 +11,10 @@ info (
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
OnlineUser {
|
||||
SID int64 `json:"uid"`
|
||||
IP string `json:"ip"`
|
||||
}
|
||||
ShadowsocksProtocol {
|
||||
Port int `json:"port"`
|
||||
Method string `json:"method"`
|
||||
@@ -44,9 +48,9 @@ type (
|
||||
ServerCommon
|
||||
}
|
||||
GetServerConfigResponse {
|
||||
Basic ServerBasic `json:"basic"`
|
||||
Protocol string `json:"protocol"`
|
||||
Config interface{} `json:"config"`
|
||||
Basic ServerBasic `json:"basic"`
|
||||
Protocol string `json:"protocol"`
|
||||
Config interface{} `json:"config"`
|
||||
}
|
||||
ServerBasic {
|
||||
PushInterval int64 `json:"push_interval"`
|
||||
@@ -60,8 +64,8 @@ type (
|
||||
ServerUser {
|
||||
Id int64 `json:"id"`
|
||||
UUID string `json:"uuid"`
|
||||
SpeedLimit int64 `json:"speed_limit"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
SpeedLimit int64 `json:"speed_limit"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
}
|
||||
GetServerUserListRequest {
|
||||
ServerCommon
|
||||
@@ -78,7 +82,6 @@ type (
|
||||
ServerCommon
|
||||
Traffic []UserTraffic `json:"traffic"`
|
||||
}
|
||||
|
||||
ServerPushStatusRequest {
|
||||
ServerCommon
|
||||
Cpu float64 `json:"cpu"`
|
||||
@@ -90,11 +93,25 @@ type (
|
||||
ServerCommon
|
||||
Users []OnlineUser `json:"users"`
|
||||
}
|
||||
QueryServerConfigRequest {
|
||||
ServerID int64 `path:"server_id"`
|
||||
SecretKey string `form:"secret_key"`
|
||||
Protocols []string `form:"protocols,omitempty"`
|
||||
}
|
||||
QueryServerConfigResponse {
|
||||
TrafficReportThreshold int64 `json:"traffic_report_threshold"`
|
||||
IPStrategy string `json:"ip_strategy"`
|
||||
DNS []NodeDNS `json:"dns"`
|
||||
Block []string `json:"block"`
|
||||
Outbound []NodeOutbound `json:"outbound"`
|
||||
Protocols []Protocol `json:"protocols"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/server
|
||||
group: server
|
||||
prefix: v1/server
|
||||
group: server
|
||||
middleware: ServerMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@@ -119,3 +136,13 @@ service ppanel {
|
||||
post /online (OnlineUsersRequest)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: v2/server
|
||||
group: server
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get Server Protocol Config"
|
||||
@handler QueryServerProtocolConfig
|
||||
get /:server_id (QueryServerConfigRequest) returns (QueryServerConfigResponse)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,10 @@ info (
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
@server (
|
||||
prefix: v1/public/announcement
|
||||
group: public/announcement
|
||||
middleware: AuthMiddleware
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query announcement"
|
||||
|
||||
+17
-18
@@ -1,28 +1,27 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Document API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
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
|
||||
prefix: v1/public/document
|
||||
group: public/document
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
|
||||
service ppanel {
|
||||
@doc "Get document list"
|
||||
@handler QueryDocumentList
|
||||
get /list returns (QueryDocumentListResponse)
|
||||
@doc "Get document list"
|
||||
@handler QueryDocumentList
|
||||
get /list returns (QueryDocumentListResponse)
|
||||
|
||||
@doc "Get document detail"
|
||||
@handler QueryDocumentDetail
|
||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||
}
|
||||
|
||||
@doc "Get document detail"
|
||||
@handler QueryDocumentDetail
|
||||
get /detail (QueryDocumentDetailRequest) returns (Document)
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import "../types.api"
|
||||
@server (
|
||||
prefix: v1/public/order
|
||||
group: public/order
|
||||
middleware: AuthMiddleware
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Pre create order"
|
||||
|
||||
@@ -10,11 +10,10 @@ info (
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
@server (
|
||||
prefix: v1/public/payment
|
||||
group: public/payment
|
||||
middleware: AuthMiddleware
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get available payment methods"
|
||||
|
||||
@@ -19,16 +19,20 @@ type (
|
||||
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"`
|
||||
}
|
||||
GetSubscriptionRequest {
|
||||
Language string `form:"language"`
|
||||
}
|
||||
GetSubscriptionResponse {
|
||||
List []Subscribe `json:"list"`
|
||||
}
|
||||
PrePurchaseOrderRequest {
|
||||
Payment int64 `json:"payment,omitempty"`
|
||||
Payment int64 `json:"payment,omitempty"`
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Quantity int64 `json:"quantity"`
|
||||
Coupon string `json:"coupon,omitempty"`
|
||||
@@ -66,6 +70,7 @@ type (
|
||||
@server (
|
||||
prefix: v1/public/portal
|
||||
group: public/portal
|
||||
middleware: DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get available payment methods"
|
||||
@@ -74,7 +79,7 @@ service ppanel {
|
||||
|
||||
@doc "Get Subscription"
|
||||
@handler GetSubscription
|
||||
get /subscribe returns (GetSubscriptionResponse)
|
||||
get /subscribe (GetSubscriptionRequest) returns (GetSubscriptionResponse)
|
||||
|
||||
@doc "Pre Purchase Order"
|
||||
@handler PrePurchaseOrder
|
||||
|
||||
@@ -9,23 +9,21 @@ info (
|
||||
)
|
||||
|
||||
import "../types.api"
|
||||
|
||||
|
||||
type (
|
||||
QuerySubscribeListRequest {
|
||||
Language string `form:"language"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/public/subscribe
|
||||
group: public/subscribe
|
||||
middleware: AuthMiddleware
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
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)
|
||||
get /list (QuerySubscribeListRequest) returns (QuerySubscribeListResponse)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,9 @@ info (
|
||||
import "../types.api"
|
||||
|
||||
type (
|
||||
|
||||
GetUserTicketListResponse {
|
||||
Total int64 `json:"total"`
|
||||
List []Ticket `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
List []Ticket `json:"list"`
|
||||
}
|
||||
CreateUserTicketRequest {
|
||||
Title string `json:"title"`
|
||||
@@ -34,17 +33,17 @@ type (
|
||||
Status *uint8 `json:"status" validate:"required"`
|
||||
}
|
||||
CreateUserTicketFollowRequest {
|
||||
TicketId int64 `json:"ticket_id"`
|
||||
From string `json:"from"`
|
||||
Type uint8 `json:"type"`
|
||||
Content string `json:"content"`
|
||||
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
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Get ticket list"
|
||||
|
||||
+29
-27
@@ -25,16 +25,8 @@ type (
|
||||
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"`
|
||||
List []BalanceLog `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
QueryUserCommissionLogListRequest {
|
||||
Page int `form:"page"`
|
||||
@@ -77,47 +69,49 @@ type (
|
||||
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"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
UpdateBindMobileRequest{
|
||||
AreaCode string `json:"area_code" validate:"required"`
|
||||
Mobile string `json:"mobile" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
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"`
|
||||
UpdateBindEmailRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
}
|
||||
|
||||
VerifyEmailRequest {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
GetDeviceListResponse {
|
||||
List []UserDevice `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
UnbindDeviceRequest {
|
||||
Id int64 `json:"id" validate:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: v1/public/user
|
||||
group: public/user
|
||||
middleware: AuthMiddleware
|
||||
middleware: AuthMiddleware,DeviceMiddleware
|
||||
)
|
||||
service ppanel {
|
||||
@doc "Query User Info"
|
||||
@@ -207,5 +201,13 @@ service ppanel {
|
||||
@doc "Update Bind Email"
|
||||
@handler UpdateBindEmail
|
||||
put /bind_email (UpdateBindEmailRequest)
|
||||
|
||||
@doc "Get Device List"
|
||||
@handler GetDeviceList
|
||||
get /devices returns (GetDeviceListResponse)
|
||||
|
||||
@doc "Unbind Device"
|
||||
@handler UnbindDevice
|
||||
put /unbind_device (UnbindDeviceRequest)
|
||||
}
|
||||
|
||||
|
||||
+26
-22
@@ -1,26 +1,30 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "admin API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
info (
|
||||
title: "admin API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"./admin/system.api"
|
||||
"./admin/user.api"
|
||||
"./admin/server.api"
|
||||
"./admin/subscribe.api"
|
||||
"./admin/payment.api"
|
||||
"./admin/coupon.api"
|
||||
"./admin/order.api"
|
||||
"./admin/ticket.api"
|
||||
"./admin/announcement.api"
|
||||
"./admin/document.api"
|
||||
"./admin/tool.api"
|
||||
"./admin/console.api"
|
||||
"./admin/auth.api"
|
||||
"./admin/log.api"
|
||||
"./admin/ads.api"
|
||||
)
|
||||
"./admin/system.api"
|
||||
"./admin/user.api"
|
||||
"./admin/server.api"
|
||||
"./admin/subscribe.api"
|
||||
"./admin/payment.api"
|
||||
"./admin/coupon.api"
|
||||
"./admin/order.api"
|
||||
"./admin/ticket.api"
|
||||
"./admin/announcement.api"
|
||||
"./admin/document.api"
|
||||
"./admin/tool.api"
|
||||
"./admin/console.api"
|
||||
"./admin/auth.api"
|
||||
"./admin/log.api"
|
||||
"./admin/ads.api"
|
||||
"./admin/marketing.api"
|
||||
"./admin/application.api"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "App API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"./app/auth.api"
|
||||
"./app/user.api"
|
||||
"./app/node.api"
|
||||
"./app/ws.api"
|
||||
"./app/order.api"
|
||||
"./app/announcement.api"
|
||||
"./app/payment.api"
|
||||
"./app/document.api"
|
||||
"./app/subscribe.api"
|
||||
)
|
||||
+10
-9
@@ -1,14 +1,15 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "common API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
info (
|
||||
title: "common API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"./common.api"
|
||||
"./auth/auth.api"
|
||||
)
|
||||
"./common.api"
|
||||
"./auth/auth.api"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Node API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
info (
|
||||
title: "Node API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import "./node/node.api"
|
||||
import "./node/node.api"
|
||||
|
||||
+17
-15
@@ -1,19 +1,21 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "User API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
info (
|
||||
title: "User API"
|
||||
desc: "API for ppanel"
|
||||
author: "Tension"
|
||||
email: "tension@ppanel.com"
|
||||
version: "0.0.1"
|
||||
)
|
||||
|
||||
import (
|
||||
"./public/user.api"
|
||||
"./public/subscribe.api"
|
||||
"./public/order.api"
|
||||
"./public/announcement.api"
|
||||
"./public/ticket.api"
|
||||
"./public/payment.api"
|
||||
"./public/document.api"
|
||||
"./public/portal.api"
|
||||
)
|
||||
"./public/user.api"
|
||||
"./public/subscribe.api"
|
||||
"./public/order.api"
|
||||
"./public/announcement.api"
|
||||
"./public/ticket.api"
|
||||
"./public/payment.api"
|
||||
"./public/document.api"
|
||||
"./public/portal.api"
|
||||
)
|
||||
|
||||
|
||||
+201
-104
@@ -14,6 +14,8 @@ type (
|
||||
Avatar string `json:"avatar"`
|
||||
Balance int64 `json:"balance"`
|
||||
Commission int64 `json:"commission"`
|
||||
ReferralPercentage uint8 `json:"referral_percentage"`
|
||||
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
||||
GiftAmount int64 `json:"gift_amount"`
|
||||
Telegram int64 `json:"telegram"`
|
||||
ReferCode string `json:"refer_code"`
|
||||
@@ -63,6 +65,8 @@ type (
|
||||
SubscribePath string `json:"subscribe_path"`
|
||||
SubscribeDomain string `json:"subscribe_domain"`
|
||||
PanDomain bool `json:"pan_domain"`
|
||||
UserAgentLimit bool `json:"user_agent_limit"`
|
||||
UserAgentList string `json:"user_agent_list"`
|
||||
}
|
||||
VerifyCodeConfig {
|
||||
VerifyCodeExpireTime int64 `json:"verify_code_expire_time"`
|
||||
@@ -111,6 +115,7 @@ type (
|
||||
AuthConfig {
|
||||
Mobile MobileAuthenticateConfig `json:"mobile"`
|
||||
Email EmailAuthticateConfig `json:"email"`
|
||||
Device DeviceAuthticateConfig `json:"device"`
|
||||
Register PubilcRegisterConfig `json:"register"`
|
||||
}
|
||||
PubilcRegisterConfig {
|
||||
@@ -130,6 +135,14 @@ type (
|
||||
EnableDomainSuffix bool `json:"enable_domain_suffix"`
|
||||
DomainSuffixList string `json:"domain_suffix_list"`
|
||||
}
|
||||
|
||||
DeviceAuthticateConfig {
|
||||
Enable bool `json:"enable"`
|
||||
ShowAds bool `json:"show_ads"`
|
||||
EnableSecurity bool `json:"enable_security"`
|
||||
OnlyRealDevice bool `json:"only_real_device"`
|
||||
}
|
||||
|
||||
RegisterConfig {
|
||||
StopRegister bool `json:"stop_register"`
|
||||
EnableTrial bool `json:"enable_trial"`
|
||||
@@ -148,9 +161,27 @@ type (
|
||||
EnableResetPasswordVerify bool `json:"enable_reset_password_verify"`
|
||||
}
|
||||
NodeConfig {
|
||||
NodeSecret string `json:"node_secret"`
|
||||
NodePullInterval int64 `json:"node_pull_interval"`
|
||||
NodePushInterval int64 `json:"node_push_interval"`
|
||||
NodeSecret string `json:"node_secret"`
|
||||
NodePullInterval int64 `json:"node_pull_interval"`
|
||||
NodePushInterval int64 `json:"node_push_interval"`
|
||||
TrafficReportThreshold int64 `json:"traffic_report_threshold"`
|
||||
IPStrategy string `json:"ip_strategy"`
|
||||
DNS []NodeDNS `json:"dns"`
|
||||
Block []string `json:"block"`
|
||||
Outbound []NodeOutbound `json:"outbound"`
|
||||
}
|
||||
NodeDNS {
|
||||
Proto string `json:"proto"`
|
||||
Address string `json:"address"`
|
||||
Domains []string `json:"domains"`
|
||||
}
|
||||
NodeOutbound {
|
||||
Name string `json:"name"`
|
||||
Protocol string `json:"protocol"`
|
||||
Address string `json:"address"`
|
||||
Port int64 `json:"port"`
|
||||
Password string `json:"password"`
|
||||
Rules []string `json:"rules"`
|
||||
}
|
||||
InviteConfig {
|
||||
ForcedInvite bool `json:"forced_invite"`
|
||||
@@ -181,6 +212,7 @@ type (
|
||||
Subscribe {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Language string `json:"language"`
|
||||
Description string `json:"description"`
|
||||
UnitPrice int64 `json:"unit_price"`
|
||||
UnitTime string `json:"unit_time"`
|
||||
@@ -191,9 +223,8 @@ type (
|
||||
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"`
|
||||
Nodes []int64 `json:"nodes"`
|
||||
NodeTags []string `json:"node_tags"`
|
||||
Show bool `json:"show"`
|
||||
Sell bool `json:"sell"`
|
||||
Sort int64 `json:"sort"`
|
||||
@@ -246,6 +277,14 @@ type (
|
||||
SecurityConfig SecurityConfig `json:"security_config"`
|
||||
}
|
||||
Tuic {
|
||||
Port int `json:"port" validate:"required"`
|
||||
DisableSNI bool `json:"disable_sni"`
|
||||
ReduceRtt bool `json:"reduce_rtt"`
|
||||
UDPRelayMode string `json:"udp_relay_mode"`
|
||||
CongestionController string `json:"congestion_controller"`
|
||||
SecurityConfig SecurityConfig `json:"security_config"`
|
||||
}
|
||||
AnyTLS {
|
||||
Port int `json:"port" validate:"required"`
|
||||
SecurityConfig SecurityConfig `json:"security_config"`
|
||||
}
|
||||
@@ -264,37 +303,37 @@ type (
|
||||
Host string `json:"host"`
|
||||
ServiceName string `json:"service_name"`
|
||||
}
|
||||
Server {
|
||||
Id int64 `json:"id"`
|
||||
Tags []string `json:"tags"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Name string `json:"name"`
|
||||
ServerAddr string `json:"server_addr"`
|
||||
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"`
|
||||
Config interface{} `json:"config"`
|
||||
Enable *bool `json:"enable"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
Status *NodeStatus `json:"status"`
|
||||
Sort int64 `json:"sort"`
|
||||
}
|
||||
OnlineUser {
|
||||
SID int64 `json:"uid"`
|
||||
IP string `json:"ip"`
|
||||
}
|
||||
NodeStatus {
|
||||
Online interface{} `json:"online"`
|
||||
Cpu float64 `json:"cpu"`
|
||||
Mem float64 `json:"mem"`
|
||||
Disk float64 `json:"disk"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
// Server {
|
||||
// Id int64 `json:"id"`
|
||||
// Tags []string `json:"tags"`
|
||||
// Country string `json:"country"`
|
||||
// City string `json:"city"`
|
||||
// Name string `json:"name"`
|
||||
// ServerAddr string `json:"server_addr"`
|
||||
// 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"`
|
||||
// Config interface{} `json:"config"`
|
||||
// Enable *bool `json:"enable"`
|
||||
// CreatedAt int64 `json:"created_at"`
|
||||
// UpdatedAt int64 `json:"updated_at"`
|
||||
// Status *NodeStatus `json:"status"`
|
||||
// Sort int64 `json:"sort"`
|
||||
// }
|
||||
// OnlineUser {
|
||||
// SID int64 `json:"uid"`
|
||||
// IP string `json:"ip"`
|
||||
// }
|
||||
// NodeStatus {
|
||||
// Online interface{} `json:"online"`
|
||||
// Cpu float64 `json:"cpu"`
|
||||
// Mem float64 `json:"mem"`
|
||||
// Disk float64 `json:"disk"`
|
||||
// UpdatedAt int64 `json:"updated_at"`
|
||||
// }
|
||||
ServerGroup {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
@@ -426,7 +465,7 @@ type (
|
||||
Subscribe Subscribe `json:"subscribe"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
ExpireTime int64 `json:"expire_time"`
|
||||
FinishedAt int64 `json:"finished_at"`
|
||||
FinishedAt int64 `json:"finished_at"`
|
||||
ResetTime int64 `json:"reset_time"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Download int64 `json:"download"`
|
||||
@@ -436,15 +475,6 @@ type (
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
UserBalanceLog {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
Type uint8 `json:"type"`
|
||||
OrderId int64 `json:"order_id"`
|
||||
Balance int64 `json:"balance"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
UserAffiliate {
|
||||
Avatar string `json:"avatar"`
|
||||
Identifier string `json:"identifier"`
|
||||
@@ -465,14 +495,6 @@ type (
|
||||
Port int `json:"port"`
|
||||
Prefix string `json:"prefix"`
|
||||
}
|
||||
ApplicationConfig {
|
||||
AppId int64 `json:"app_id"`
|
||||
EncryptionKey string `json:"encryption_key"`
|
||||
EncryptionMethod string `json:"encryption_method"`
|
||||
Domains []string `json:"domains" validate:"required"`
|
||||
StartupPicture string `json:"startup_picture"`
|
||||
StartupPictureSkipTime int64 `json:"startup_picture_skip_time"`
|
||||
}
|
||||
UserDevice {
|
||||
Id int64 `json:"id"`
|
||||
Ip string `json:"ip"`
|
||||
@@ -505,11 +527,13 @@ type (
|
||||
}
|
||||
ServerRuleGroup {
|
||||
Id int64 `json:"id"`
|
||||
Icon string `json:"icon"`
|
||||
Icon string `json:"icon"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Type string `json:"type"`
|
||||
Tags []string `json:"tags"`
|
||||
Rules string `json:"rules"`
|
||||
Enable bool `json:"enable"`
|
||||
Default bool `json:"default"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
@@ -520,7 +544,7 @@ type (
|
||||
Token string `json:"token"`
|
||||
IP string `json:"ip"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
UserLoginLog {
|
||||
Id int64 `json:"id"`
|
||||
@@ -528,18 +552,17 @@ type (
|
||||
LoginIP string `json:"login_ip"`
|
||||
UserAgent string `json:"user_agent"`
|
||||
Success bool `json:"success"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
MessageLog {
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Platform string `json:"platform"`
|
||||
To string `json:"to"`
|
||||
Subject string `json:"subject"`
|
||||
Content string `json:"content"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
Id int64 `json:"id"`
|
||||
Type uint8 `json:"type"`
|
||||
Platform string `json:"platform"`
|
||||
To string `json:"to"`
|
||||
Subject string `json:"subject"`
|
||||
Content interface{} `json:"content"`
|
||||
Status uint8 `json:"status"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
Ads {
|
||||
Id int `json:"id"`
|
||||
@@ -557,8 +580,8 @@ type (
|
||||
//public order
|
||||
PurchaseOrderRequest {
|
||||
SubscribeId int64 `json:"subscribe_id"`
|
||||
Quantity int64 `json:"quantity"`
|
||||
Payment int64 `json:"payment,omitempty"`
|
||||
Quantity int64 `json:"quantity" validate:"required,gt=0"`
|
||||
Payment int64 `json:"payment,omitempty"`
|
||||
Coupon string `json:"coupon,omitempty"`
|
||||
}
|
||||
PreOrderResponse {
|
||||
@@ -707,46 +730,120 @@ type (
|
||||
Telephone string `json:"telephone"`
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
QueryUserAffiliateCountResponse {
|
||||
Registers int64 `json:"registers"`
|
||||
TotalCommission int64 `json:"total_commission"`
|
||||
}
|
||||
|
||||
AppUserSubcbribe{
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Upload int64 `json:"upload"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Download int64 `json:"download"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
StartTime string `json:"start_time"`
|
||||
ExpireTime string `json:"expire_time"`
|
||||
List []AppUserSubscbribeNode `json:"list"`
|
||||
AppUserSubcbribe {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Upload int64 `json:"upload"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Download int64 `json:"download"`
|
||||
DeviceLimit int64 `json:"device_limit"`
|
||||
StartTime string `json:"start_time"`
|
||||
ExpireTime string `json:"expire_time"`
|
||||
List []AppUserSubscbribeNode `json:"list"`
|
||||
}
|
||||
|
||||
AppUserSubscbribeNode{
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Uuid string `json:"uuid"`
|
||||
Protocol string `json:"protocol"`
|
||||
RelayMode string `json:"relay_mode"`
|
||||
RelayNode string `json:"relay_node"`
|
||||
ServerAddr string `json:"server_addr"`
|
||||
SpeedLimit int `json:"speed_limit"`
|
||||
Tags []string `json:"tags"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
TrafficRatio float64 `json:"traffic_ratio"`
|
||||
Upload int64 `json:"upload"`
|
||||
Config string `json:"config"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Latitude string `json:"latitude"`
|
||||
Longitude string `json:"longitude"`
|
||||
LatitudeCountry string `json:"latitudeCountry"`
|
||||
LongitudeCountry string `json:"longitudeCountry"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Download int64 `json:"download"`
|
||||
AppUserSubscbribeNode {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Uuid string `json:"uuid"`
|
||||
Protocol string `json:"protocol"`
|
||||
RelayMode string `json:"relay_mode"`
|
||||
RelayNode string `json:"relay_node"`
|
||||
ServerAddr string `json:"server_addr"`
|
||||
SpeedLimit int `json:"speed_limit"`
|
||||
Tags []string `json:"tags"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
TrafficRatio float64 `json:"traffic_ratio"`
|
||||
Upload int64 `json:"upload"`
|
||||
Config string `json:"config"`
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Latitude string `json:"latitude"`
|
||||
Longitude string `json:"longitude"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Download int64 `json:"download"`
|
||||
}
|
||||
DownloadLink {
|
||||
IOS string `json:"ios,omitempty"`
|
||||
Android string `json:"android,omitempty"`
|
||||
Windows string `json:"windows,omitempty"`
|
||||
Mac string `json:"mac,omitempty"`
|
||||
Linux string `json:"linux,omitempty"`
|
||||
Harmony string `json:"harmony,omitempty"`
|
||||
}
|
||||
ResetSubscribeTrafficLog {
|
||||
Id int64 `json:"id"`
|
||||
Type uint16 `json:"type"`
|
||||
UserSubscribeId int64 `json:"user_subscribe_id"`
|
||||
OrderNo string `json:"order_no,omitempty"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
BalanceLog {
|
||||
Type uint16 `json:"type"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
OrderNo string `json:"order_no,omitempty"`
|
||||
Balance int64 `json:"balance"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
CommissionLog {
|
||||
Type uint16 `json:"type"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
OrderNo string `json:"order_no"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
Protocol {
|
||||
Type string `json:"type"`
|
||||
Port uint16 `json:"port"`
|
||||
Enable bool `json:"enable"`
|
||||
Security string `json:"security,omitempty"`
|
||||
SNI string `json:"sni,omitempty"`
|
||||
AllowInsecure bool `json:"allow_insecure,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
RealityServerAddr string `json:"reality_server_addr,omitempty"`
|
||||
RealityServerPort int `json:"reality_server_port,omitempty"`
|
||||
RealityPrivateKey string `json:"reality_private_key,omitempty"`
|
||||
RealityPublicKey string `json:"reality_public_key,omitempty"`
|
||||
RealityShortId string `json:"reality_short_id,omitempty"`
|
||||
Transport string `json:"transport,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
ServiceName string `json:"service_name,omitempty"`
|
||||
Cipher string `json:"cipher,omitempty"`
|
||||
ServerKey string `json:"server_key,omitempty"`
|
||||
Flow string `json:"flow,omitempty"`
|
||||
HopPorts string `json:"hop_ports,omitempty"`
|
||||
HopInterval int `json:"hop_interval,omitempty"`
|
||||
ObfsPassword string `json:"obfs_password,omitempty"`
|
||||
DisableSNI bool `json:"disable_sni,omitempty"`
|
||||
ReduceRtt bool `json:"reduce_rtt,omitempty"`
|
||||
UDPRelayMode string `json:"udp_relay_mode,omitempty"`
|
||||
CongestionController string `json:"congestion_controller,omitempty"`
|
||||
Multiplex string `json:"multiplex,omitempty"` // mux, eg: off/low/medium/high
|
||||
PaddingScheme string `json:"padding_scheme,omitempty"` // padding scheme
|
||||
UpMbps int `json:"up_mbps,omitempty"` // upload speed limit
|
||||
DownMbps int `json:"down_mbps,omitempty"` // download speed limit
|
||||
Obfs string `json:"obfs,omitempty"` // obfs, 'none', 'http', 'tls'
|
||||
ObfsHost string `json:"obfs_host,omitempty"` // obfs host
|
||||
ObfsPath string `json:"obfs_path,omitempty"` // obfs path
|
||||
XhttpMode string `json:"xhttp_mode,omitempty"` // xhttp mode
|
||||
XhttpExtra string `json:"xhttp_extra,omitempty"` // xhttp extra path
|
||||
Encryption string `json:"encryption,omitempty"` // encryption,'none', 'mlkem768x25519plus'
|
||||
EncryptionMode string `json:"encryption_mode,omitempty"` // encryption mode,'native', 'xorpub', 'random'
|
||||
EncryptionRtt string `json:"encryption_rtt,omitempty"` // encryption rtt,'0rtt', '1rtt'
|
||||
EncryptionTicket string `json:"encryption_ticket,omitempty"` // encryption ticket
|
||||
EncryptionServerPadding string `json:"encryption_server_padding,omitempty"` // encryption server padding
|
||||
EncryptionPrivateKey string `json:"encryption_private_key,omitempty"` // encryption private key
|
||||
EncryptionClientPadding string `json:"encryption_client_padding,omitempty"` // encryption client padding
|
||||
EncryptionPassword string `json:"encryption_password,omitempty"` // encryption password
|
||||
Ratio float64 `json:"ratio,omitempty"` // Traffic ratio, default is 1
|
||||
CertMode string `json:"cert_mode,omitempty"` // Certificate mode, `none`|`http`|`dns`|`self`
|
||||
CertDNSProvider string `json:"cert_dns_provider,omitempty"` // DNS provider for certificate
|
||||
CertDNSEnv string `json:"cert_dns_env,omitempty"` // Environment for DNS provider
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user