1 / 24

SyncAccount

手机. http+Json. SyncAccount. Upload. Download. Search. Favor. Del. UserPatition. IndexBuilder. Login/Logout. CloudStorageAdpter. MemoryCache. 云存储. Mysql (Partition By User). 分表分库. 用户分区 (Partition). SearchIndex. 游记 (Travel). 用户 (User). 游记 (Travel). 图片 ( Img ). 图片 ( Img ).

Download Presentation

SyncAccount

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 手机 http+Json SyncAccount Upload Download Search Favor Del UserPatition IndexBuilder Login/Logout CloudStorageAdpter MemoryCache 云存储 Mysql (Partition By User)

  2. 分表分库 用户分区(Partition) SearchIndex 游记 (Travel) 用户(User) 游记 (Travel) 图片 (Img) 图片 (Img) 图片 (Img) 图片 (Img) 图片 (Img) 图片 (Img) 文本 (theText) 文本 (theText) 文本 (theText) 录音 (theRecord) 录音 (theRecord) 录音 (theRecord) 节点(Node) 节点(Node) 节点(Node) 游记(Travel)

  3. Partition_Conf • PartitionID • Datasource_ip • Datasource_username • Datasource_password

  4. User_Summary • PartitionID • UserID • UserEmail • Password(MD5) • SinaWeiBoID • QQWeiBoID • IsDel • 0/null: no • 1: yes

  5. User_Detail • PartitionID • UserID • Sex • BirthDay • City • CreateTime • LastLoginTime

  6. Travel • PartitionID • UserID • TravelID • TravelTitle • CreateTime • FinishTime • Status • 0/null:active • 1/other:close • FavorNum:收藏次数 • DownloadNum:下载次数 • RePubNum:转发次数 • IsDel • 0/null: no • 1: yes

  7. Travel_Node • PartitionID • UserID • TravelID • NodeID • CreateTime • IsDel • 0/null: no • 1: yes • FavorNum:收藏次数 • DownloadNum:下载次数 • RePubNum:转发次数 • Img_Inner_URI:图片URI • Record_Inner_URI:录音URI • textContext:文本描述 • tag:标签

  8. User_Favor • PartitionID • UserID • FavorID • Type • 1: onTravel • 2: onNode • CreateTime • TargetID • IsDel • 0/null: no • 1: yes

  9. User_Favor • PartitionID • UserID • FavorID • Type • 1: onTravel • 2: onNode • CreateTime • TargetID • IsDel • 0/null: no • 1: yes

  10. 第1类API:用户相关

  11. 1)API: 获得验证码图片 • 请求(http://serverIP/usr/checkimg • 返回: png数字图片 • 处理 • http header cookie设置 • rid=11212121212 • t=123213ABCDDEEE

  12. 2)API: 注册 • 请求(http://serverIP/usr/reg?email=moumou@gmail.com&pwd=12311&check=1234) • email,必须,String • pwd,必须,String • check,必须,int4 数字验证码 • 返回 • { “r": “ok“} • { “r": “fail“, “m": “the use exists“} • 处理 • http header cookie设置 • uid=11212121212 • t=123213ABCDDEEE

  13. 3)API: 登录 • 请求(http://serverIP/usr/login?type=0&name=moumou@gmail.com&pwd=12311) • type, 必须, int1 • 0:自己的注册用户 • 1:新浪微博 • 2:腾讯微博 • name,必须,String • pwd,必须(type=0),String • 返回 • { “r": “ok“} • { “r": “fail“, “m": “the use is invalid“} • 处理 • http header cookie设置 • uid=11212121212 • t=123213ABCDDEEE

  14. 4)API: 退出登录 • 请求(http://serverIP/usr/logout) • 返回 • { “r": “ok“} • 处理 • http header cookie注销

  15. 第2类API:游记相关

  16. 1)API:新建一个游记 • 请求(http://serverIP/s/travel/getid) • 返回 • { “r”:”ok”,“m":“123ABCDE1D“} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 生产新ID

  17. 2)API:删除游记 • 请求(http://serverIP/s/travel/del?id=1213sdfsdf) • 返回 • { “r”:”ok”} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 置travel为isDel,返回给客户端

  18. 3)API:List登录用户下的所有游记 • 请求(http://serverIP/s/travel/list) • 返回 • { “r”:”ok”, “travels“:[{“id”:”sfsdf1213“,”title”:”this…”}] } • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 排序travel,返回给客户端

  19. 4)API:List Node • 请求(http://serverIP/s/travel/node/list?id=sfsdf) • 返回 • { “r”:”ok”, “nodes“:[{“id”:”sfsdf1213“,”title”:”this…”}] } • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 根据travel id,返回给客户端

  20. 5)API:package • 请求(http://serverIP/s/travel/pkg?id=sfsdf) • 返回 • 处理 • 判断是否登录(根据cokiee) • 根据travel id,返回给客户端一个package,格式待定

  21. 6)API:新建一组节点 • 请求(http://serverIP/s/travel/node/getid?c=10&id=12133131) • c, 必须, int4 • Id,必须,是travle的ID,char • 返回 • { “r”:”ok”,“ids":“123ABCDE1D“} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 生产一组NodeID

  22. 7)API:上传(更新)节点 • POST请求(http://serverIP/s/travel/node/update?id=123ABCDE1D) • Id,必须,String • type, 必须,int1,1:图片|2:录音 • text,可选,String,必须做URLencode,内容不超过140个汉字 • data, 必须,binary,仅支持JPEG、GIF、PNG格式,大小小于5M • lat,可选,float,纬度,有效范围:-90.0到+90.0,+表示北纬,默认为0.0 • long,可选,float,经度,有效范围:-90.0到+90.0,+表示北纬,默认为0.0。 • 返回 • { “r”:”ok“} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 往数据库、存储设备上写数据

  23. 分库分表 • P1 • Travel_1,Travel_2 • Node_1,Node_2 • P2 • Travel_1,Travel_2 • Node_1,Node_2

  24. 手机 网站 Json 后台

More Related