refactor(api): remove deprecated application-related endpoints and types
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
@@ -90,42 +46,6 @@ service ppanel {
|
||||
@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)
|
||||
|
||||
@@ -1,23 +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,104 +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"`
|
||||
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,40 +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,57 +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,65 +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,86 +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,21 +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
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
@@ -102,10 +98,6 @@ service ppanel {
|
||||
@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)
|
||||
|
||||
@@ -23,9 +23,5 @@ service ppanel {
|
||||
@doc "Get subscribe group list"
|
||||
@handler QuerySubscribeGroupList
|
||||
get /group/list returns (QuerySubscribeGroupListResponse)
|
||||
|
||||
@doc "Get application config"
|
||||
@handler QueryApplicationConfig
|
||||
get /application/config returns (ApplicationResponse)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +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"
|
||||
)
|
||||
|
||||
@@ -475,14 +475,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"`
|
||||
|
||||
Reference in New Issue
Block a user