Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
feat: 添加版本和构建时间变量 fix: 修正短信队列类型注释错误 style: 清理未使用的代码和测试文件 docs: 更新安装文档中的下载链接 chore: 迁移数据库脚本添加日志和订阅配置
97 lines
3.3 KiB
Plaintext
97 lines
3.3 KiB
Plaintext
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)
|
|
}
|
|
|