雷姬家的阁楼书架
我真的很服同事的耐心,他们最经典的做法就是解析消息这种操作会写无数遍。比方说: cJSON *method = cJSON_GetObjectItem(json, “method”); if (method == “foo”) { cJSON* ip = cJSON_GetObjectItem(json, “ip”); cJSON* id = cJSON_GetObjectItem(json, “id”); foo(ip, id); } else if (method == “bar”)…