第一次操作数据:
用户id:101
用户名:wangerxiao
注册接口
返回数据:
{
"meta": {
"status": 1,
"message": "success"
},
"data": {
"userId": 101
}
}
登录接口
返回数据:
{
"meta": {
"status": 1,
"message": "success"
},
"data": {
"userId": 101,
"token": "101:1489461949384",
"synFlage": 1,
"message": "同步成功"
}
}
请求同步元数据接口
请求json数据:
{
"tablemeta":[
{"synId":1,"synTable":"user", "userId": 101, "version":0, "lastModTime":null },
{"synId":1, "synTable":"usercard", "userId": 101,"version":0, "lastModTime":null},
{"synId":1, "synTable":"userlearningstyle","userId": 101,"version":0,"lastModTime":null},
{ "synId":1,"synTable":"userresource", "userId": 101, "version":0, "lastModTime":null },
{ "synId":1,"synTable":"usertest", "userId": 101, "version":0, "lastModTime":null },
{ "synId":1,"synTable":"userword", "userId": 101,"version":0, "lastModTime":null }
]
}
返回数据:
{
"meta": {
"status": 1,
"message": "success"
},
"data": {
"synTableCount": 1,
"upsyntable": [],
"downsyntable": [
{
"synTable": "user"
}
]
}
}
同步接口
请求数据:
{
"downSynTable":[
{ "synTable":"user"}
],
"tableData":{
"user":[{},{}],
"userCard":[{},{}]
}
}
返回数据:
{
"meta": {
"status": 1,
"message": "success"
},
"data": {
"tableMeta": [
{
"synId": 80,
"synTable": "user",
"userId": 101,
"lastModTime": 1489461945665,
"version": 1
},
{
"synId": 81,
"synTable": "Usercard",
"userId": 101,
"lastModTime": null,
"version": 0
},
{
"synId": 82,
"synTable": "Userlearningstyle",
"userId": 101,
"lastModTime": null,
"version": 0
},
{
"synId": 83,
"synTable": "userresource",
"userId": 101,
"lastModTime": null,
"version": 0
},
{
"synId": 84,
"synTable": "usertest",
"userId": 101,
"lastModTime": null,
"version": 0
},
{
"synId": 85,
"synTable": "userword",
"userId": 101,
"lastModTime": null,
"version": 0
}
],
"tableData": {
"user": [
{
"userId": 101,
"adaptive": null,
"classNum": null,
"grade": null,
"learningstyle1": null,
"learningstyle2": null,
"learningstyle3": null,
"learningtyle4": null,
"level": null,
"loginName": "wangerxiao",
"loginTimes": null,
"password": "123",
"presentgrade": null,
"realName": "葬爱家族",
"resourcecount1": null,
"resourcecount2": null,
"resourcecount3": null,
"resourcecount4": null,
"school": null,
"score": null,
"sex": 1,
"topiccount1": null,
"topiccount2": null,
"wordcount": null,
"wordcount1": null,
"workcount": null,
"workcount1": null,
"workcount2": null,
"workcount3": null
}
],
"userCard": null,
"userLearningStyle": null,
"userResource": null,
"userTest": null,
"userWord": null
}
}
}
{
"tablemeta":[
{"synId":1,"synTable":"user", "userId": 101, "version":0, "lastModTime":null },
{"synId":1, "synTable":"usercard", "userId": 101,"version":0, "lastModTime":null},
{"synId":1, "synTable":"userlearningstyle","userId": 101,"version":0,"lastModTime":null},
{ "synId":1,"synTable":"userresource", "userId": 101, "version":0, "lastModTime":null },
{ "synId":1,"synTable":"usertest", "userId": 101, "version":0, "lastModTime":null },
{ "synId":1,"synTable":"userword", "userId": 101,"version":0, "lastModTime":null }
]
}
同步测试
user、userLearningStyle、userCard、userTestCount向上同步
{
"downSynTable":[
{ "synTable":"user"}
],
"tableData":{
"user":[
{"userId":101,"adaptive":3,"classNum":4,"grade":4,"learningstyle1":0,"learningstyle2":0,"learningstyle3":0,"learningstyle4":0,"leavel":1,"loginName":"wangerxiao","loginTimes":2,"password":"123","presentgrade":1,"realName":"张三","resourcecount1":1,"resourcecount2":1,"resourcecount3":1,"resourcecount4":1,"school":"宿迁实验小学","score":69,"sex":1,"topiccount1":1,"topiccount2":1,"wordcount":2,"wordcount1":2,"workcount":2,"workcount1":2,"workcount2":2,"workcount3":2}
],
"userLearningStyle":[
{"userlearningstyleId":1,"userId":101,"style1":1,"style2":2}
],
"userCard":[
{"usercardId":1,"cardclick1":1,"cardclick2":1,"cardclick3":2,"cardclick4":2,"userId":101}
],
"userTestCount":[
{"usertestcountId":1,"userId":101,"testcount":1,"testrightcount":3,"test1count":3,"test1rightcount":5,"test2count":1,"test2rightcount":3,"test3count":2,"test3rightcount":3,"test4count":2,"test4rightcount":3},
]
}
}
userResource向上同步
{
"downSynTable":[
{ "synTable":"userResource"}
],
"tableData":{
"userResource":[
{"userResourceId":1,"userId":101,"learncount":12,"learntimenow":2,"learntimes":2,"rType":2,"resourceId":2,"rloginTime":"2017-03-25 15:58:23","rlogoutTime":"2017-03-25 17:18:07","word":"apple"}
]
}
}
{
"downSynTable":[
{ "synTable":"userResource"}
],
"tableData":{
"userResource":[
{"userResourceId":1,"userId":101,"learncount":12,"learntimenow":2,"learntimes":2,"rType":2,"resourceId":2,"rloginTime":"2017-03-25 15:58:23","rlogoutTime":"2017-03-25 17:18:07","word":"apple"},
{"userResourceId":2,"userId":101,"learncount":4,"learntimenow":6,"learntimes":2,"rType":3,"resourceId":3,"rloginTime":"2017-03-25 15:26:27","rlogoutTime":"2017-03-25 16:56:12","word":"banana"},
{"userResourceId":2,"userId":101,"learncount":8,"learntimenow":3,"learntimes":2,"rType":4,"resourceId":4,"rloginTime":"2017-03-25 15:35:23","rlogoutTime":"2017-03-25 16:39:28","word":"orange"},
{"userResourceId":2,"userId":101,"learncount":6,"learntimenow":4,"learntimes":2,"rType":5,"resourceId":5,"rloginTime":"2017-03-25 15:25:23","rlogoutTime":"2017-03-25 16:12:08","word":"tomato"}
]
}
}
userTest向上同步
{
"downSynTable":[
{ "synTable":"userTest"}
],
"tableData":{
"userTest":[
{"usertestId":1,"userId":101,"answertimes":3,"righttimes":2,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"apple"}
]
}
}
{
"downSynTable":[
{ "synTable":"userTest"}
],
"tableData":{
"userTest":[
{"usertestId":1,"userId":101,"answertimes":3,"righttimes":2,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"apple"},
{"usertestId":1,"userId":101,"answertimes":4,"righttimes":6,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"banana"},
{"usertestId":1,"userId":101,"answertimes":5,"righttimes":7,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"orange"},
{"usertestId":1,"userId":101,"answertimes":6,"righttimes":3,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"tomato"}
]
}
}
userWord向上同步
{
"downSynTable":[
{ "synTable":"userWord"}
],
"tableData":{
"userWord":[
{"userWordId":1,"userId":101,"topi":3,"wordlearn":5,"wordtest":1,"wrongtesttimes":3,"word":"apple"},
]
}
}
{
"downSynTable":[
{ "synTable":"userWord"}
],
"tableData":{
"userWord":[
{"userWordId":1,"userId":101,"topi":3,"wordlearn":5,"wordtest":1,"wrongtesttimes":3,"word":"apple"},
{"userWordId":1,"userId":101,"topi":2,"wordlearn":12,"wordtest":1,"wrongtesttimes":2,"word":"banana"},
{"userWordId":1,"userId":101,"topi":6,"wordlearn":36,"wordtest":1,"wrongtesttimes":6,"word":"orange"},
{"userWordId":1,"userId":101,"topi":13,"wordlearn":7,"wordtest":1,"wrongtesttimes":3,"word":"tomato"}
]
}
}
全部表向下同步
- user、userLearningStyle、userCard、userTestCount、userResource、userTest、userWord
{
"downSynTable":[
{ "synTable":"user"},
{"synTable":"userLearningStyle"},
{"synTable":"userTestCount"},
{"synTable":"userCard"},
{"synTable":"userResource"},
{"synTable":"userTest"},
{"synTable":"userWord"}
],
"tableData":null
}
全部表向上同步
{
"downSynTable":null,
"tableData":{
"user":[
{"userId":101,"adaptive":3,"classNum":4,"grade":4,"learningstyle1":0,"learningstyle2":0,"learningstyle3":0,"learningstyle4":0,"leavel":1,"loginName":"wangerxiao","loginTimes":2,"password":"123","presentgrade":1,"realName":"张三","resourcecount1":1,"resourcecount2":1,"resourcecount3":1,"resourcecount4":1,"school":"宿迁实验小学","score":69,"sex":1,"topiccount1":1,"topiccount2":1,"wordcount":2,"wordcount1":2,"workcount":2,"workcount1":2,"workcount2":2,"workcount3":2}
],
"userLearningStyle":[
{"userlearningstyleId":1,"userId":101,"style1":1,"style2":2}
],
"userCard":[
{"usercardId":1,"cardclick1":1,"cardclick2":1,"cardclick3":2,"cardclick4":2,"userId":101}
],
"userTestCount":[
{"usertestcountId":1,"userId":101,"testcount":1,"testrightcount":3,"test1count":3,"test1rightcount":5,"test2count":1,"test2rightcount":3,"test3count":2,"test3rightcount":3,"test4count":2,"test4rightcount":3},
],
"userResource":[
{"userResourceId":1,"userId":101,"learncount":12,"learntimenow":2,"learntimes":2,"rType":2,"resourceId":2,"rloginTime":"2017-03-25 15:58:23","rlogoutTime":"2017-03-25 17:18:07","word":"apple"},
{"userResourceId":2,"userId":101,"learncount":4,"learntimenow":6,"learntimes":2,"rType":3,"resourceId":3,"rloginTime":"2017-03-25 15:26:27","rlogoutTime":"2017-03-25 16:56:12","word":"banana"},
{"userResourceId":2,"userId":101,"learncount":8,"learntimenow":3,"learntimes":2,"rType":4,"resourceId":4,"rloginTime":"2017-03-25 15:35:23","rlogoutTime":"2017-03-25 16:39:28","word":"orange"},
{"userResourceId":2,"userId":101,"learncount":6,"learntimenow":4,"learntimes":2,"rType":5,"resourceId":5,"rloginTime":"2017-03-25 15:25:23","rlogoutTime":"2017-03-25 16:12:08","word":"tomato"}
],
"userTest":[
{"usertestId":1,"userId":101,"answertimes":3,"righttimes":2,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"apple"},
{"usertestId":1,"userId":101,"answertimes":4,"righttimes":6,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"banana"},
{"usertestId":1,"userId":101,"answertimes":5,"righttimes":7,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"orange"},
{"usertestId":1,"userId":101,"answertimes":6,"righttimes":3,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"tomato"}
],
"userWord":[
{"userWordId":1,"userId":101,"topi":3,"wordlearn":5,"wordtest":1,"wrongtesttimes":3,"word":"apple"},
{"userWordId":1,"userId":101,"topi":2,"wordlearn":12,"wordtest":1,"wrongtesttimes":2,"word":"banana"},
{"userWordId":1,"userId":101,"topi":6,"wordlearn":36,"wordtest":1,"wrongtesttimes":6,"word":"orange"},
{"userWordId":1,"userId":101,"topi":13,"wordlearn":7,"wordtest":1,"wrongtesttimes":3,"word":"tomato"}
]
}
}
向上同步和向下同步
{
"downSynTable":[
{"synTable":"userTestCount"},
{"synTable":"userResource"},
],
"tableData":{
"userLearningStyle":[
{"userlearningstyleId":1,"userId":101,"style1":1,"style2":2}
],
"userCard":[
{"usercardId":1,"cardclick1":1,"cardclick2":1,"cardclick3":2,"cardclick4":2,"userId":101}
],
"userTest":[
{"usertestId":1,"userId":101,"answertimes":3,"righttimes":2,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"apple"},
{"usertestId":1,"userId":101,"answertimes":4,"righttimes":6,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"banana"},
{"usertestId":1,"userId":101,"answertimes":5,"righttimes":7,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"orange"},
{"usertestId":1,"userId":101,"answertimes":6,"righttimes":3,"testinTime":"2017-03-25 15:58:23","testoutTime":"2017-03-25 17:18:07","testtype":1,"wrongtimes":1,"word":"tomato"}
]
}
}
数据回收
{
"trackData":{
"userBehaviour":[
{"userBehaviourId":1,"userId":101,"dowhat":"打豆豆","dowhen":"2017-03-25 02:36:23","dowhere":5},
{"userBehaviourId":2,"userId":101,"dowhat":"练习","dowhen":"2017-03-25 11:58:23","dowhere":3},
{"userBehaviourId":3,"userId":101,"dowhat":"看视频","dowhen":"2017-03-25 08:52:23","dowhere":2},
{"userBehaviourId":4,"userId":101,"dowhat":"看图片","dowhen":"2017-03-25 12:01:23","dowhere":4}
],
"userLogin":[
{"userLoginId":1,"userId":101,"loginState":3,"loginTime":"2017-03-25 02:36:23","logoutTime":"2017-03-26 03:32:23"},
{"userLoginId":1,"userId":101,"loginState":3,"loginTime":"2017-03-25 02:36:23","logoutTime":"2017-03-26 03:32:23"},
{"userLoginId":1,"userId":101,"loginState":3,"loginTime":"2017-03-25 02:36:23","logoutTime":"2017-03-26 03:32:23"},
{"userLoginId":1,"userId":101,"loginState":3,"loginTime":"2017-03-25 02:36:23","logoutTime":"2017-03-26 03:32:23"},
{"userLoginId":1,"userId":101,"loginState":3,"loginTime":"2017-03-25 02:36:23","logoutTime":"2017-03-26 03:32:23"}
]
}
}
网友评论