GetPluginList 获取插件列表
(httpResponse http.ResponseWriter, httpRequest *http.Request)
| 44 | |
| 45 | // GetPluginList 获取插件列表 |
| 46 | func GetPluginList(httpResponse http.ResponseWriter, httpRequest *http.Request) { |
| 47 | |
| 48 | httpRequest.ParseForm() |
| 49 | keyword := httpRequest.Form.Get("keyword") |
| 50 | condition := httpRequest.Form.Get("condition") |
| 51 | op, err := strconv.Atoi(condition) |
| 52 | if err != nil && condition != "" { |
| 53 | controller.WriteError(httpResponse, "210006", "plugin", "[ERROR]Illegal condition!", err) |
| 54 | return |
| 55 | } |
| 56 | flag, result, err := plugin.GetPluginList(keyword, op) |
| 57 | if !flag { |
| 58 | |
| 59 | controller.WriteError(httpResponse, |
| 60 | "210000", |
| 61 | "plugin", |
| 62 | "[ERROR]Empty plugin list!", |
| 63 | err) |
| 64 | return |
| 65 | |
| 66 | } |
| 67 | controller.WriteResultInfo(httpResponse, "plugin", "pluginList", result) |
| 68 | return |
| 69 | } |
| 70 | |
| 71 | //AddPlugin 新增插件信息 |
| 72 | func AddPlugin(httpResponse http.ResponseWriter, httpRequest *http.Request) { |
nothing calls this directly
no test coverage detected