hi-server/apis/admin/console.api
shanshanzhong c582087c0f refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
feat: 添加版本和构建时间变量
fix: 修正短信队列类型注释错误
style: 清理未使用的代码和测试文件
docs: 更新安装文档中的下载链接
chore: 迁移数据库脚本添加日志和订阅配置
2025-10-13 01:33:03 -07:00

89 lines
3.0 KiB
Plaintext

syntax = "v1"
info (
title: "Console API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
type (
ServerTrafficData {
ServerId int64 `json:"server_id"`
Name string `json:"name"`
Upload int64 `json:"upload"`
Download int64 `json:"download"`
}
UserTrafficData {
SID int64 `json:"sid"`
Upload int64 `json:"upload"`
Download int64 `json:"download"`
}
ServerTotalDataResponse {
OnlineUsers int64 `json:"online_users"`
OnlineServers int64 `json:"online_servers"`
OfflineServers int64 `json:"offline_servers"`
TodayUpload int64 `json:"today_upload"`
TodayDownload int64 `json:"today_download"`
MonthlyUpload int64 `json:"monthly_upload"`
MonthlyDownload int64 `json:"monthly_download"`
UpdatedAt int64 `json:"updated_at"`
ServerTrafficRankingToday []ServerTrafficData `json:"server_traffic_ranking_today"`
ServerTrafficRankingYesterday []ServerTrafficData `json:"server_traffic_ranking_yesterday"`
UserTrafficRankingToday []UserTrafficData `json:"user_traffic_ranking_today"`
UserTrafficRankingYesterday []UserTrafficData `json:"user_traffic_ranking_yesterday"`
}
UserStatistics {
Date string `json:"date,omitempty"`
Register int64 `json:"register"`
NewOrderUsers int64 `json:"new_order_users"`
RenewalOrderUsers int64 `json:"renewal_order_users"`
List []UserStatistics `json:"list,omitempty"`
}
OrdersStatistics {
Date string `json:"date,omitempty"`
AmountTotal int64 `json:"amount_total"`
NewOrderAmount int64 `json:"new_order_amount"`
RenewalOrderAmount int64 `json:"renewal_order_amount"`
List []OrdersStatistics `json:"list,omitempty"`
}
RevenueStatisticsResponse {
Today OrdersStatistics `json:"today"`
Monthly OrdersStatistics `json:"monthly"`
All OrdersStatistics `json:"all"`
}
UserStatisticsResponse {
Today UserStatistics `json:"today"`
Monthly UserStatistics `json:"monthly"`
All UserStatistics `json:"all"`
}
TicketWaitRelpyResponse {
Count int64 `json:"count"`
}
)
@server (
prefix: v1/admin/console
group: admin/console
middleware: AuthMiddleware
)
service ppanel {
@doc "Query server total data"
@handler QueryServerTotalData
get /server returns (ServerTotalDataResponse)
@doc "Query revenue statistics"
@handler QueryRevenueStatistics
get /revenue returns (RevenueStatisticsResponse)
@doc "Query user statistics"
@handler QueryUserStatistics
get /user returns (UserStatisticsResponse)
@doc "Query ticket wait reply"
@handler QueryTicketWaitReply
get /ticket returns (TicketWaitRelpyResponse)
}