Commit ae02e1ac authored by liuyu's avatar liuyu

chagne 253 245

parent 25b8a4bd
No preview for this file type
......@@ -201,6 +201,8 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string
char *filed = row[i];
unsigned int field_length = lengths[i];
field = mysql_fetch_field(result);
// mysql_fetch_fields(result);
//json[field->name] = filed;
printf("column[%d],length[%d],field[%s]:data[%s]\n", i, field_length, field->name,filed ? filed : "null");
......@@ -214,8 +216,30 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string
}
else{
json["Content-ID"] = field->name ;
json["Content-Type"] = "varchar(32)" ;
json["content"] = filed ;
printf("field->type---%d\n",(int)field->type);
switch (field->type)
{
case 253:
{
printf("253\n");
json["Content-Type"] = "varchar";
break;
}
case 245:
{
printf("245\n");
json["Content-Type"] = "JSON";
break;
}
}
if(json["Content-Type"] == "JSON")
{
json["content"] = nlohmann::json::parse(filed) ;
}
else
{
json["content"] = filed ;
}
//Blocks_objects = Blocks_objects + json.dump() ;
objects["blocks"].push_back(json);
//if(i != num_fields-1){ Blocks_objects = Blocks_objects + ",";}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment