mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 17:52:24 +00:00
add "about" to scripts
you can get a description if you send a request where in params there is a field about with any content
This commit is contained in:
10
com/List.lua
10
com/List.lua
@@ -1,5 +1,15 @@
|
||||
-- com/List.lua
|
||||
|
||||
if In.Params and In.Params.about then
|
||||
Out.Result = {
|
||||
description = "Returns a list of available methods",
|
||||
params = {
|
||||
layer = "select which layer list to display"
|
||||
}
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
local function isValidCommand(name)
|
||||
return name:match("^[%w]+$") ~= nil
|
||||
end
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
if In.Params and In.Params.about then
|
||||
Out.Result = {
|
||||
description = "Echo of the message",
|
||||
params = {
|
||||
msg = "just message"
|
||||
}
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
local function validate()
|
||||
if not In.Params.msg or In.Params.msg == "" then
|
||||
Out.Error = {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
Log.Event("got ping")
|
||||
Log.EventWarn("got ping")
|
||||
Log.EventError("got ping")
|
||||
|
||||
Log.Error("mm")
|
||||
if In.Params and In.Params.about then
|
||||
Out.Result = {
|
||||
description = "Just ping"
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
Out.Result.answer = "pong"
|
||||
Reference in New Issue
Block a user