feat(gateway): 优化gateway相关功能
Quality check / Web UI (push) Successful in 9m19s

This commit is contained in:
mei
2026-09-12 15:32:27 +08:00
parent 0d89b7fe8f
commit 9b656cebee
84 changed files with 2769 additions and 825 deletions
+15 -2
View File
@@ -26,8 +26,11 @@ type Field struct {
Placeholder string `json:"placeholder,omitempty"`
Help string `json:"help,omitempty"`
// Secret 为 true 的字段在读取接口中会被掩码
Secret bool `json:"secret,omitempty"`
Default any `json:"default,omitempty"`
Secret bool `json:"secret,omitempty"`
// GatewayMessage 为 true 的字段由消息网关投递的内容提供(msg / title 之类):
// 在「网关规则」页面不需要用户填写,投递时会被请求里的 message / title 替换
GatewayMessage bool `json:"gateway_message,omitempty"`
Default any `json:"default,omitempty"`
}
// AccountMeta 账号类型的元数据
@@ -51,6 +54,16 @@ type RuleMeta struct {
Fields []Field `json:"fields"`
}
// GatewayMeta 消息网关类型的元数据
type GatewayMeta struct {
Type string `json:"type"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Docs string `json:"docs,omitempty"`
// PayloadHint WebUI 上展示的请求体示例
PayloadHint string `json:"payload_hint,omitempty"`
}
// SecretKeys 返回需要掩码的字段名
func SecretKeys(fields []Field) []string {
keys := make([]string, 0, len(fields))