fix getting schema api

This commit is contained in:
liyuxi
2023-01-04 03:36:38 +00:00
parent bce7aa4cda
commit 206fc8b59f
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.schema = "ekuiper.json",
.schema = "ekuiper",
.module_name = "ekuiper",
.module_descr = "Neuron and LF Edge eKuiper integration plugin",
.module_descr_zh = "Neuron 和 LF Edge eKuiper 一体化插件",
+1 -1
View File
@@ -52,7 +52,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.schema = "file.json",
.schema = "file",
.module_name = "file",
.module_descr = "The plugin is used to read and write files.",
.module_descr_zh = "该插件用于读写文件。",
+1 -1
View File
@@ -56,7 +56,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.schema = "modbus-tcp.json",
.schema = "modbus-tcp",
.module_name = "modbus-tcp",
.module_descr = "The modbus-tcp plugin is used for devices connected using "
"the modbus protocol tcp mode.",
+1 -1
View File
@@ -469,7 +469,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.schema = "monitor.json",
.schema = "monitor",
.module_name = "monitor",
.module_descr = DEFAULT_MONITOR_PLUGIN_DESCR,
.module_descr_zh = DEFAULT_MONITOR_PLUGIN_DESCR_ZH,
+1 -1
View File
@@ -375,7 +375,7 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
const neu_plugin_module_t neu_plugin_module = {
.version = NEURON_PLUGIN_VER_1_0,
.schema = "mqtt.json",
.schema = "mqtt",
.module_name = "mqtt",
.module_descr = DESCRIPTION,
.module_descr_zh = DESCRIPTION_ZH,
+3 -3
View File
@@ -167,14 +167,14 @@ void handle_get_plugin_schema(nng_aio *aio)
NEU_VALIDATE_JWT(aio);
const char *plugin_name = neu_http_get_param(aio, "plugin_name", &len);
if (plugin_name == NULL || len == 0) {
const char *schema_name = neu_http_get_param(aio, "schema_name", &len);
if (schema_name == NULL || len == 0) {
neu_http_bad_request(aio, "{\"error\": 1002}");
return;
}
if (0 > neu_asprintf(&schema_path, "%s/schema/%s.json", g_plugin_dir,
plugin_name)) {
schema_name)) {
NEU_JSON_RESPONSE_ERROR(NEU_ERR_EINTERNAL, {
neu_http_response(aio, error_code.error, result_error);
});