2020-02-05 12:16:15 +08:00
|
|
|
#include "cson.h"
|
|
|
|
#include "stdio.h"
|
|
|
|
#include "stdlib.h"
|
2020-04-07 17:32:11 +08:00
|
|
|
#include "string.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "assert.h"
|
|
|
|
#include "math.h"
|
|
|
|
|
|
|
|
#define CHECK_STRING(a, b) assert(strcmp(a, b) == 0)
|
|
|
|
#define CHECK_NUMBER(a, b) assert(a == b)
|
|
|
|
#define CHECK_REAL(a, b) assert(fabs(a-b) <= 1e-6)
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char* name;
|
|
|
|
char* jump_url;
|
2020-02-25 17:38:54 +08:00
|
|
|
} ClassInfoChild;
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
typedef struct {
|
2020-02-25 17:38:54 +08:00
|
|
|
int has_child;
|
|
|
|
char* icon;
|
|
|
|
int id;
|
|
|
|
char* name;
|
|
|
|
char childrenNum;
|
2020-02-05 12:16:15 +08:00
|
|
|
ClassInfoChild* children;
|
2020-02-25 17:38:54 +08:00
|
|
|
} ClassInfo;
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
typedef struct {
|
2020-02-25 17:38:54 +08:00
|
|
|
long long timestamp;
|
2020-03-12 21:37:45 +08:00
|
|
|
int infoNum;
|
2020-02-25 17:38:54 +08:00
|
|
|
ClassInfo* info;
|
|
|
|
} Data;
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
typedef struct {
|
2020-02-25 17:38:54 +08:00
|
|
|
int status;
|
|
|
|
Data data;
|
|
|
|
int errcode;
|
|
|
|
} Response;
|
2020-02-05 12:16:15 +08:00
|
|
|
|
2020-02-25 17:38:54 +08:00
|
|
|
reflect_item_t ClassInfoChildTbl[] = {
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_string(ClassInfoChild, name),
|
|
|
|
_property_string(ClassInfoChild, jump_url),
|
|
|
|
_property_end()
|
|
|
|
};
|
|
|
|
|
2020-02-25 17:38:54 +08:00
|
|
|
reflect_item_t ClassInfoTbl[] = {
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_int(ClassInfo, has_child),
|
|
|
|
_property_string(ClassInfo, icon),
|
|
|
|
_property_int(ClassInfo, id),
|
|
|
|
_property_string(ClassInfo, name),
|
2020-04-07 17:32:11 +08:00
|
|
|
_property_int_ex(ClassInfo, childrenNum, _ex_args_all),
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_array_object(ClassInfo, children, ClassInfoChildTbl, ClassInfoChild, childrenNum),
|
|
|
|
_property_end()
|
|
|
|
};
|
|
|
|
|
2020-02-25 17:38:54 +08:00
|
|
|
reflect_item_t DataTbl[] = {
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_int(Data, timestamp),
|
2020-04-07 17:32:11 +08:00
|
|
|
_property_int_ex(Data, infoNum, _ex_args_all),
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_array_object(Data, info, ClassInfoTbl, ClassInfo, infoNum),
|
|
|
|
_property_end()
|
|
|
|
};
|
|
|
|
|
2020-02-25 17:38:54 +08:00
|
|
|
reflect_item_t ResponseTbl[] = {
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_int(Response, status),
|
2020-02-25 17:38:54 +08:00
|
|
|
_property_obj(Response, data, DataTbl),
|
2020-02-05 12:16:15 +08:00
|
|
|
_property_int(Response, errcode),
|
|
|
|
_property_end()
|
|
|
|
};
|
|
|
|
|
2020-04-07 17:32:11 +08:00
|
|
|
const static char* jStr = "{\"status\":1,\"error\":\"\",\"data\":{\"timestamp\":1579069151,\"info\":[{\"has_child\":1,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181130/20181130172444711866.png\",\"id\":153,\"children\":[{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F1\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20190402/20190402165900910180.png\",\"id\":185,\"name\":\"DJ专区\",\"special_tag_id\":0,\"bannerurl\":\"http://imge.kugou.com/v2/mobile_class_banner/{size}/T1hFCsBvW_1RCvBVdK.png\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"http://imge.kugou.com/mcommon/{size}/20150825/20150825145251513968.png\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F45\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20190711/20190711142859901220.png\",\"id\":1401,\"name\":\"抖音专区\",\"special_tag_id\":0,\"bannerurl\":\"\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F3\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20190402/20190402165839822861.png\",\"id\":227,\"name\":\"儿童专区\",\"special_tag_id\":0,\"bannerurl\":\"http://imge.kugou.com/v2/mobile_class_banner/{size}/T1xNKsBmb_1RCvBVdK.png\",\"song_tag_id\":0,\"is_hot\":1,\"imgurl\":\"http://imge.kugou.com/mcommon/{size}/20150819/20150819142111579284.png\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F23\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181101/20181101110341142930.png\",\"id\":781,\"name\":\"网络专区\",\"special_tag_id\":0,\"bannerurl\":\"\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F9\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181101/20181101110304370142.png\",\"id\":405,\"name\":\"车载专区\",\"special_tag_id\":0,\"bannerurl\":\"http://imge.kugou.com/v2/mobile_class_banner/{size}/T1TJKsB_K_1RCvBVdK.png\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"http://imge.kugou.com/mcommon/{size}/20151020/20151020185634232826.png\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F11\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181101/20181101110531714649.png\",\"id\":483,\"name\":\"广场舞专区\",\"special_tag_id\":0,\"bannerurl\":\"http://imge.kugou.com/v2/mobile_class_banner/{size}/T13ebsBgC_1RCvBVdK.png\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"http://imge.kugou.com/mcommon/{size}/20151030/20151030100347338896.png\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F17\",\"album_tag_id\":0,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181101/20181101110434661130.png\",\"id\":439,\"name\":\"轻音乐专区\",\"special_tag_id\":0,\"bannerurl\":\"http://imge.kugou.com/v2/mobile_class_banner/{size}/T1jTJsBmZT1RCvBVdK.png\",\"song_tag_id\":0,\"is_hot\":0,\"imgurl\":\"http://imge.kugou.com/mcommon/{size}/20151026/20151026102137944162.png\",\"banner_hd\":\"\",\"is_new\":0,\"has_child\":1,\"theme\":1,\"subtitle\":\"\",\"description\":\"\"},{\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F
|
2020-02-05 12:16:15 +08:00
|
|
|
|
2020-04-07 17:32:11 +08:00
|
|
|
const char* encodeTest = "{\"status\":1,\"data\":{\"timestamp\":1579069151,\"info\":[{\"has_child\":1,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181130/20181130172444711866.png\",\"id\":153,\"name\":\"专区\",\"children\":[{\"name\":\"DJ专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F1\"},{\"name\":\"抖音专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F45\"},{\"name\":\"儿童专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F3\"},{\"name\":\"网络专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F23\"},{\"name\":\"车载专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F9\"},{\"name\":\"广场舞专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F11\"},{\"name\":\"轻音乐专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F17\"},{\"name\":\"情歌专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F19\"},{\"name\":\"国风专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F7\"},{\"name\":\"电音专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F27\"},{\"name\":\"欧美专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F29\"},{\"name\":\"ACG专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F5\"},{\"name\":\"影视专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F15\"},{\"name\":\"戏曲专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F25\"},{\"name\":\"粤剧专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F13\"},{\"name\":\"韩流专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F31\"}]},{\"has_child\":1,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20191104/20191104103209217784.png\",\"id\":2005,\"name\":\"心情\",\"children\":[{\"name\":\"伤感专区\",\"jump_url\":\"\"},{\"name\":\"安静专区\",\"jump_url\":\"\"},{\"name\":\"对抗抑郁专区\",\"jump_url\":\"\"},{\"name\":\"轻松专区\",\"jump_url\":\"\"},{\"name\":\"激情专区\",\"jump_url\":\"\"},{\"name\":\"甜蜜专区\",\"jump_url\":\"\"},{\"name\":\"开心专区\",\"jump_url\":\"\"},{\"name\":\"想念专区\",\"jump_url\":\"\"},{\"name\":\"疗伤专区\",\"jump_url\":\"\"}]},{\"has_child\":1,\"icon\":\"http://imge.kugou.com/mcommon/{size}/20181130/20181130172455112096.png\",\"id\":1263,\"name\":\"特色\",\"children\":[{\"name\":\"官方歌单\",\"jump_url\":\"\"},{\"name\":\"重返2010专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F65\"},{\"name\":\"佛乐专区\",\"jump_url\":\"\"},{\"name\":\"综艺专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2findex.html%23%2fmobile%2fhome%2f37\"},{\"name\":\"首发专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F35\"},{\"name\":\"音乐人专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F33\"},{\"name\":\"古典乐专区\",\"jump_url\":\"\"},{\"name\":\"HiFi专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F21\"},{\"name\":\"英语学习专区\",\"jump_url\":\"\"},{\"name\":\"2019年终专区\",\"jump_url\":\"https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmo
|
2020-02-05 12:16:15 +08:00
|
|
|
|
2020-04-07 17:32:11 +08:00
|
|
|
|
|
|
|
static void checkResult(Response* resp, char* jstrOutput);
|
2020-02-05 12:16:15 +08:00
|
|
|
|
2020-02-25 17:38:54 +08:00
|
|
|
void test2()
|
|
|
|
{
|
|
|
|
printf("=========================================\n");
|
2020-02-05 12:16:15 +08:00
|
|
|
printf("\t\tRunning %s\n", __FUNCTION__);
|
|
|
|
printf("=========================================\n");
|
|
|
|
Response resp;
|
2020-04-07 17:32:11 +08:00
|
|
|
memset(&resp, 0, sizeof(resp));
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
/* string to struct */
|
|
|
|
int ret = csonJsonStr2Struct(jStr, &resp, ResponseTbl);
|
2020-04-07 17:32:11 +08:00
|
|
|
printf("decode ret=%d\n", ret);
|
|
|
|
CHECK_NUMBER(ret, 0);
|
|
|
|
|
2020-02-05 12:16:15 +08:00
|
|
|
/* test print */
|
2020-04-07 17:32:11 +08:00
|
|
|
//csonPrintProperty(&resp, ResponseTbl);
|
2020-02-05 12:16:15 +08:00
|
|
|
|
|
|
|
char* jstrOutput;
|
|
|
|
ret = csonStruct2JsonStr(&jstrOutput, &resp, ResponseTbl);
|
2020-04-07 17:32:11 +08:00
|
|
|
CHECK_NUMBER(ret, 0);
|
|
|
|
printf("encode ret=%d\nJson:%s\n", ret, jstrOutput);
|
|
|
|
|
|
|
|
/*assert check*/
|
|
|
|
checkResult(&resp, jstrOutput);
|
|
|
|
|
2020-02-05 12:16:15 +08:00
|
|
|
free(jstrOutput);
|
2020-03-12 21:37:45 +08:00
|
|
|
csonFreePointer(&resp, ResponseTbl);
|
2020-04-07 17:32:11 +08:00
|
|
|
|
|
|
|
printf("Successed %s.\n", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
void checkResult(Response* resp, char* jstrOutput){
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->status, 1);
|
|
|
|
CHECK_NUMBER(resp->data.timestamp, 1579069151);
|
|
|
|
CHECK_NUMBER(resp->data.infoNum, 9);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[0].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[0].icon, "http://imge.kugou.com/mcommon/{size}/20181130/20181130172444711866.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[0].id, 153);
|
|
|
|
CHECK_STRING(resp->data.info[0].name, "专区");
|
|
|
|
CHECK_NUMBER(resp->data.info[0].childrenNum, 16);
|
|
|
|
CHECK_STRING(resp->data.info[0].children[0].name, "DJ专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[0].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F1");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[1].name, "抖音专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[1].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F45");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[2].name, "儿童专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[2].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F3");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[3].name, "网络专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[3].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F23");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[4].name, "车载专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[4].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F9");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[5].name, "广场舞专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[5].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F11");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[6].name, "轻音乐专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[6].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F17");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[7].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F19");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[7].name, "情歌专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[8].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F7");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[8].name, "国风专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[9].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F27");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[9].name, "电音专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[10].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F29");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[10].name, "欧美专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[11].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F5");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[11].name, "ACG专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[12].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F15");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[12].name, "影视专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[13].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F25");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[13].name, "戏曲专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[14].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F13");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[14].name, "粤剧专区");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[15].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F31");
|
|
|
|
CHECK_STRING(resp->data.info[0].children[15].name, "韩流专区");
|
|
|
|
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[1].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[1].icon, "http://imge.kugou.com/mcommon/{size}/20191104/20191104103209217784.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[1].id, 2005);
|
|
|
|
CHECK_STRING(resp->data.info[1].name, "心情");
|
|
|
|
CHECK_NUMBER(resp->data.info[1].childrenNum, 9);
|
|
|
|
CHECK_STRING(resp->data.info[1].children[0].name, "伤感专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[1].name, "安静专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[2].name, "对抗抑郁专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[3].name, "轻松专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[4].name, "激情专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[5].name, "甜蜜专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[6].name, "开心专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[7].name, "想念专区");
|
|
|
|
CHECK_STRING(resp->data.info[1].children[8].name, "疗伤专区");
|
|
|
|
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[2].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[2].icon, "http://imge.kugou.com/mcommon/{size}/20181130/20181130172455112096.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[2].id, 1263);
|
|
|
|
CHECK_STRING(resp->data.info[2].name, "特色");
|
|
|
|
CHECK_NUMBER(resp->data.info[2].childrenNum, 16);
|
|
|
|
CHECK_STRING(resp->data.info[2].children[0].name, "官方歌单");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[1].name, "重返2010专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[2].name, "佛乐专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[3].name, "综艺专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[4].name, "首发专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[5].name, "音乐人专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[6].name, "古典乐专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[7].name, "HiFi专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[8].name, "英语学习专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[9].name, "2019年终专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[10].name, "有声电台");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[11].name, "Urban专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[12].name, "入驻厂牌专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[13].name, "游戏专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[14].name, "说唱专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[15].name, "冬天听什么专区");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[1].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F65");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[3].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2findex.html%23%2fmobile%2fhome%2f37");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[4].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F35");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[5].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F33");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[7].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F21");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[9].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F69");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[10].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F39");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[13].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F71");
|
|
|
|
CHECK_STRING(resp->data.info[2].children[14].jump_url, "https://miniapp.kugou.com/node/v2?type=1&id=74&path=%2Findex.html%23%2Fmobile%2Fhome%2F63");
|
|
|
|
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[3].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[3].icon, "http://imge.kugou.com/mcommon/{size}/20191104/20191104103220446249.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[3].id, 2003);
|
|
|
|
CHECK_STRING(resp->data.info[3].name, "场景");
|
|
|
|
CHECK_NUMBER(resp->data.info[3].childrenNum, 9);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[4].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[4].icon, "http://imge.kugou.com/mcommon/{size}/20191104/20191104103232420148.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[4].id, 2007);
|
|
|
|
CHECK_STRING(resp->data.info[4].name, "主题");
|
|
|
|
CHECK_NUMBER(resp->data.info[4].childrenNum, 14);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[5].has_child, 0);
|
|
|
|
CHECK_STRING(resp->data.info[5].icon, "http://imge.kugou.com/mcommon/{size}/20181130/20181130172345416784.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[5].id, 32);
|
|
|
|
CHECK_STRING(resp->data.info[5].name, "年代");
|
|
|
|
CHECK_NUMBER(resp->data.info[5].childrenNum, 4);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[6].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[6].icon, "http://imge.kugou.com/mcommon/{size}/20191202/20191202161746384633.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[6].id, 2009);
|
|
|
|
CHECK_STRING(resp->data.info[6].name, "语言");
|
|
|
|
CHECK_NUMBER(resp->data.info[6].childrenNum, 9);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[7].has_child, 1);
|
|
|
|
CHECK_STRING(resp->data.info[7].icon, "http://imge.kugou.com/mcommon/{size}/20191104/20191104102344527371.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[7].id, 1599);
|
|
|
|
CHECK_STRING(resp->data.info[7].name, "风格");
|
|
|
|
CHECK_NUMBER(resp->data.info[7].childrenNum, 21);
|
|
|
|
|
|
|
|
CHECK_NUMBER(resp->data.info[8].has_child, 0);
|
|
|
|
CHECK_STRING(resp->data.info[8].icon, "http://imge.kugou.com/mcommon/{size}/20181130/20181130172408696210.png");
|
|
|
|
CHECK_NUMBER(resp->data.info[8].id, 58);
|
|
|
|
CHECK_STRING(resp->data.info[8].name, "乐器");
|
|
|
|
CHECK_NUMBER(resp->data.info[8].childrenNum, 10);
|
|
|
|
|
|
|
|
CHECK_STRING(jstrOutput, encodeTest);
|
2020-02-05 12:16:15 +08:00
|
|
|
}
|