IOS同步请求API测试

第一次操作数据:
用户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"}
      ]
   } 
}
最后编辑于
?著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,172评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,346评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事?!?“怎么了?”我有些...
    开封第一讲书人阅读 159,788评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,299评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,409评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,467评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,476评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,262评论 0 269
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,699评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,994评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,167评论 1 343
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,827评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,499评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,149评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,387评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,028评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,055评论 2 352

推荐阅读更多精彩内容

  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,608评论 18 399
  • 国家电网公司企业标准(Q/GDW)- 面向对象的用电信息数据交换协议 - 报批稿:20170802 前言: 排版 ...
    庭说阅读 10,939评论 6 13
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,644评论 18 139
  • 昨天下午,参加公司的,经理训练营的考试。 在这家公司,从最初的CR入职面试,销售主管的面试,市场部调岗的面试,营业...
    走在雨的缝中阅读 489评论 1 1
  • 授课教师:XTQ 教学内容:教科书第76页例3、做一做,练习十四第1~4题。 教学目标: 知识与技能:让学生经历除...
    赣西小城阅读 1,738评论 0 0