84 lines
3.7 KiB
Go
84 lines
3.7 KiB
Go
package request
|
|
|
|
import (
|
|
common "git.echol.cn/loser/st/server/model/common/request"
|
|
)
|
|
|
|
// CreateExtensionRequest 创建扩展请求
|
|
type CreateExtensionRequest struct {
|
|
Name string `json:"name" binding:"required"`
|
|
DisplayName string `json:"displayName"`
|
|
Version string `json:"version"`
|
|
Author string `json:"author"`
|
|
Description string `json:"description"`
|
|
Homepage string `json:"homepage"`
|
|
Repository string `json:"repository"`
|
|
License string `json:"license"`
|
|
Tags []string `json:"tags"`
|
|
ExtensionType string `json:"extensionType" binding:"required"`
|
|
Category string `json:"category"`
|
|
Dependencies map[string]string `json:"dependencies"`
|
|
Conflicts []string `json:"conflicts"`
|
|
ManifestData map[string]interface{} `json:"manifestData"`
|
|
ScriptPath string `json:"scriptPath"`
|
|
StylePath string `json:"stylePath"`
|
|
AssetPaths []string `json:"assetPaths"`
|
|
Settings map[string]interface{} `json:"settings"`
|
|
Options map[string]interface{} `json:"options"`
|
|
InstallSource string `json:"installSource"`
|
|
SourceURL string `json:"sourceUrl"`
|
|
Branch string `json:"branch"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
|
|
// UpdateExtensionRequest 更新扩展请求
|
|
type UpdateExtensionRequest struct {
|
|
DisplayName string `json:"displayName"`
|
|
Description string `json:"description"`
|
|
Version string `json:"version"`
|
|
Author string `json:"author"`
|
|
Homepage string `json:"homepage"`
|
|
Repository string `json:"repository"`
|
|
License string `json:"license"`
|
|
Tags []string `json:"tags"`
|
|
ExtensionType string `json:"extensionType"`
|
|
Category string `json:"category"`
|
|
Dependencies map[string]string `json:"dependencies"`
|
|
Conflicts []string `json:"conflicts"`
|
|
ManifestData map[string]interface{} `json:"manifestData"`
|
|
ScriptPath string `json:"scriptPath"`
|
|
StylePath string `json:"stylePath"`
|
|
AssetPaths []string `json:"assetPaths"`
|
|
Settings map[string]interface{} `json:"settings"`
|
|
Options map[string]interface{} `json:"options"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
|
|
// ExtensionListRequest 扩展列表查询请求
|
|
type ExtensionListRequest struct {
|
|
common.PageInfo
|
|
Keyword string `json:"keyword" form:"keyword"` // 搜索关键词
|
|
Name string `json:"name" form:"name"` // 扩展名称
|
|
ExtensionType string `json:"extensionType" form:"extensionType"` // 扩展类型
|
|
Category string `json:"category" form:"category"` // 分类
|
|
IsEnabled *bool `json:"isEnabled" form:"isEnabled"` // 是否启用
|
|
IsInstalled *bool `json:"isInstalled" form:"isInstalled"` // 是否已安装
|
|
Tag string `json:"tag" form:"tag"` // 标签
|
|
}
|
|
|
|
// ToggleExtensionRequest 启用/禁用扩展请求
|
|
type ToggleExtensionRequest struct {
|
|
IsEnabled bool `json:"isEnabled"`
|
|
}
|
|
|
|
// UpdateExtensionSettingsRequest 更新扩展设置请求
|
|
type UpdateExtensionSettingsRequest struct {
|
|
Settings map[string]interface{} `json:"settings" binding:"required"`
|
|
}
|
|
|
|
// InstallExtensionRequest 从URL安装扩展请求
|
|
type InstallExtensionRequest struct {
|
|
URL string `json:"url" binding:"required"`
|
|
Branch string `json:"branch"`
|
|
}
|