diff --git a/backend/internal/cert/cert.go b/backend/internal/cert/cert.go index 9a9d725..6436e4f 100644 --- a/backend/internal/cert/cert.go +++ b/backend/internal/cert/cert.go @@ -37,10 +37,10 @@ func GetList(search string, p, limit int64) ([]map[string]any, int, error) { if search != "" { count, err = s.Where("domains like ?", []interface{}{"%" + search + "%"}).Count() - data, err = s.Where("domains like ?", []interface{}{"%" + search + "%"}).Limit(limits).Order("create_time", "desc").Select() + data, err = s.Where("domains like ?", []interface{}{"%" + search + "%"}).Limit(limits).Order("end_time", "esc").Select() } else { count, err = s.Count() - data, err = s.Order("create_time", "desc").Limit(limits).Select() + data, err = s.Order("end_time", "esc").Limit(limits).Select() } if err != nil { return data, 0, err diff --git a/backend/internal/cert/deploy/plugin/plugin.go b/backend/internal/cert/deploy/plugin/plugin.go index aec1693..76c3327 100644 --- a/backend/internal/cert/deploy/plugin/plugin.go +++ b/backend/internal/cert/deploy/plugin/plugin.go @@ -19,8 +19,9 @@ var ( ) type ActionInfo struct { - Name string `json:"name"` - Description string `json:"description"` + Name string `json:"name"` + Description string `json:"description"` + Params map[string]any `json:"params,omitempty"` // 可选参数 } type PluginMetadata struct { diff --git a/plugins/doge/main.go b/plugins/doge/main.go index b005851..931fcf0 100644 --- a/plugins/doge/main.go +++ b/plugins/doge/main.go @@ -12,8 +12,9 @@ import ( ) type ActionInfo struct { - Name string `json:"name"` - Description string `json:"description"` + Name string `json:"name"` + Description string `json:"description"` + Params map[string]any `json:"params,omitempty"` } type Request struct { @@ -32,8 +33,18 @@ var pluginMeta = map[string]interface{}{ "description": "部署到多吉云", "version": "1.0.0", "author": "主包", + "config": map[string]interface{}{ + "access_key": "多吉云 AccessKey", + "secret_key": "多吉云 SecretKey", + }, "actions": []ActionInfo{ - {Name: "cdn", Description: "部署到多吉云cdn"}, + { + Name: "cdn", + Description: "部署到多吉云cdn", + Params: map[string]any{ + "domain": "CDN 域名", + }, + }, }, }