MCPcopy
hub / github.com/eolinker/goku_lite / CheckIndexIsExist

Function CheckIndexIsExist

console/controller/plugin/plugin.go:264–291  ·  view source on GitHub ↗

CheckIndexIsExist 判断插件优先级是否存在

(httpResponse http.ResponseWriter, httpRequest *http.Request)

Source from the content-addressed store, hash-verified

262
263//CheckIndexIsExist 判断插件优先级是否存在
264func CheckIndexIsExist(httpResponse http.ResponseWriter, httpRequest *http.Request) {
265
266 pluginPriority := httpRequest.PostFormValue("pluginPriority")
267
268 index, err := strconv.Atoi(pluginPriority)
269 if err != nil {
270 controller.WriteError(httpResponse,
271 "210001",
272 "plugin",
273 "[ERROR]Illegal pluginPriority!",
274 err)
275 return
276
277 }
278 flag, err := plugin.CheckIndexIsExist("", index)
279 if !flag {
280
281 controller.WriteError(httpResponse,
282 "210011",
283 "plugin",
284 "[ERROR]Plugin pluginPriority does not exist!",
285 err)
286 return
287
288 }
289 controller.WriteResultInfo(httpResponse, "plugin", "", nil)
290 return
291}
292
293//CheckNameIsExist 检查插件名称是否存在
294func CheckNameIsExist(httpResponse http.ResponseWriter, httpRequest *http.Request) {

Callers

nothing calls this directly

Calls 3

WriteErrorFunction · 0.92
CheckIndexIsExistFunction · 0.92
WriteResultInfoFunction · 0.92

Tested by

no test coverage detected