Fix auto-code generation header file with #include json/json.h

This commit is contained in:
lixiumei
2021-12-09 17:57:14 +08:00
committed by Parker Liu
parent 654ba660d2
commit 268e6b568b
9 changed files with 21 additions and 19 deletions
-10
View File
@@ -1,10 +0,0 @@
{
"mqtt_req": {
"function": 2,
"uuid": "554f5fd8-f437-11eb-975c-7704b9e17821"
},
"mqtt_resp": {
"function": 2,
"uuid": "554f5fd8-f437-11eb-975c-7704b9e17821"
}
}
+2
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_ERROR_H_
#define _NEU_JSON_API_NEU_JSON_ERROR_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
+2
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_GROUP_CONFIG_H_
#define _NEU_JSON_API_NEU_JSON_GROUP_CONFIG_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
+3 -1
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_NODE_H_
#define _NEU_JSON_API_NEU_JSON_NODE_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -73,8 +75,8 @@ typedef struct {
int neu_json_encode_get_nodes_resp(void *json_object, void *param);
typedef struct {
int64_t id;
char * name;
int64_t id;
} neu_json_update_node_req_t;
int neu_json_decode_update_node_req(char * buf,
+2
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_PLUGIN_H_
#define _NEU_JSON_API_NEU_JSON_PLUGIN_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
+2 -2
View File
@@ -25,12 +25,12 @@
#ifndef _NEU_JSON_API_NEU_JSON_RW_H_
#define _NEU_JSON_API_NEU_JSON_RW_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "json/json.h"
typedef struct {
int64_t id;
enum neu_json_type t;
+2
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_TAG_H_
#define _NEU_JSON_API_NEU_JSON_TAG_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
+2
View File
@@ -25,6 +25,8 @@
#ifndef _NEU_JSON_API_NEU_JSON_TTY_H_
#define _NEU_JSON_API_NEU_JSON_TTY_H_
#include "json/json.h"
#ifdef __cplusplus
extern "C" {
#endif
+6 -6
View File
@@ -207,20 +207,20 @@ int neu_json_decode_update_node_req(char * buf,
neu_json_update_node_req_t *req =
calloc(1, sizeof(neu_json_update_node_req_t));
neu_json_elem_t req_elems[] = { {
.name = "id",
.t = NEU_JSON_INT,
},
{
.name = "name",
.t = NEU_JSON_STR,
},
{
.name = "id",
.t = NEU_JSON_INT,
} };
ret = neu_json_decode(buf, NEU_JSON_ELEM_SIZE(req_elems), req_elems);
if (ret != 0) {
goto decode_fail;
}
req->id = req_elems[0].v.val_int;
req->name = req_elems[1].v.val_str;
req->name = req_elems[0].v.val_str;
req->id = req_elems[1].v.val_int;
*result = req;
return ret;