syncaccount

24
SyncAccount http+Json 手手 Upload Download Search 手手手 IndexBuilde r Mysql (Partition By User) Favor Del UserPatitio n CloudStorageAdpter MemoryCache Login/ Logout

Upload: xiomara-lamorena

Post on 02-Jan-2016

40 views

Category:

Documents


14 download

DESCRIPTION

手机. 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 ). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SyncAccount

SyncAccount

http+Json

手机

Upload Download Search

云存储

IndexBuilder

Mysql(Partition By User)

Favor Del UserPatition

CloudStorageAdpter MemoryCacheLogin/Logout

Page 2: SyncAccount

图片(Img)

分表分库

图片(Img)

文本(theText

)

录音(theRec

ord)

节点 (Node)

图片(Img)

图片(Img)

文本(theText

)

录音(theRec

ord)

节点 (Node)

图片(Img)

图片(Img)

文本(theText

)

录音(theRec

ord)

节点 (Node)

游记 (Travel)

用户 (User) 游记(Travel)

游记(Travel)

用户分区 (Partition)

SearchIndex

Page 3: SyncAccount

Partition_Conf

• PartitionID• Datasource_ip• Datasource_username• Datasource_password

Page 4: SyncAccount

User_Summary

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

Page 5: SyncAccount

User_Detail

• PartitionID• UserID• Sex• BirthDay• City• CreateTime• LastLoginTime

Page 6: SyncAccount

Travel• PartitionID• UserID• TravelID• TravelTitle• CreateTime• FinishTime• Status

– 0/null:active– 1/other:close

• FavorNum: 收藏次数• DownloadNum: 下载次数• RePubNum: 转发次数• IsDel

– 0/null: no– 1: yes

Page 7: SyncAccount

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: 标签

Page 8: SyncAccount

User_Favor

• PartitionID• UserID• FavorID• Type

– 1: onTravel– 2: onNode

• CreateTime• TargetID• IsDel

– 0/null: no– 1: yes

Page 9: SyncAccount

User_Favor

• PartitionID• UserID• FavorID• Type

– 1: onTravel– 2: onNode

• CreateTime• TargetID• IsDel

– 0/null: no– 1: yes

Page 10: SyncAccount

第 1 类 API :用户相关

Page 11: SyncAccount

• 请求 (http://serverIP/usr/checkimg• 返回 : png 数字图片• 处理– http header cookie 设置• rid=11212121212• t=123213ABCDDEEE

1 ) API: 获得验证码图片

Page 12: SyncAccount

• 请求 (http://serverIP/usr/[email protected]&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

2 ) API: 注册

Page 13: SyncAccount

• 请求 (http://serverIP/usr/login?type=0&[email protected]&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

3 ) API: 登录

Page 14: SyncAccount

• 请求 (http://serverIP/usr/logout)• 返回– { “r": “ok“}

• 处理– http header cookie 注销

4 ) API: 退出登录

Page 15: SyncAccount

第 2 类 API :游记相关

Page 16: SyncAccount

• 请求 (http://serverIP/s/travel/getid)• 返回– { “r”:”ok”,“m":“123ABCDE1D“}– {“r”:”fail”,”m”:”NotLogin”}

• 处理– 判断是否登录(根据 cokiee)– 生产新 ID

1 ) API: 新建一个游记

Page 17: SyncAccount

• 请求 (http://serverIP/s/travel/del?id=1213sdfsdf)

• 返回– { “r”:”ok”}– {“r”:”fail”,”m”:”NotLogin”}

• 处理– 判断是否登录(根据 cokiee)– 置 travel 为 isDel ,返回给客户端

2 ) API: 删除游记

Page 18: SyncAccount

• 请求 (http://serverIP/s/travel/list)• 返回– { “r”:”ok”, “travels“:[{“id”:”sfsdf1213“,”title”:”this…”}] }– {“r”:”fail”,”m”:”NotLogin”}

• 处理– 判断是否登录(根据 cokiee)– 排序 travel ,返回给客户端

3 ) API:List 登录用户下的所有游记

Page 19: SyncAccount

• 请求 (http://serverIP/s/travel/node/list?id=sfsdf)• 返回– { “r”:”ok”, “nodes“:[{“id”:”sfsdf1213“,”title”:”this…”}] }– {“r”:”fail”,”m”:”NotLogin”}

• 处理– 判断是否登录(根据 cokiee)– 根据 travel id ,返回给客户端

4 ) API:List Node

Page 20: SyncAccount

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

式待定

5 ) API:package

Page 21: SyncAccount

• 请求 (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

6 ) API: 新建一组节点

Page 22: SyncAccount

• 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)– 往数据库、存储设备上写数据

7 ) API: 上传 ( 更新 ) 节点

Page 23: SyncAccount

分库分表• P1– Travel_1,Travel_2– Node_1,Node_2

• P2– Travel_1,Travel_2– Node_1,Node_2

Page 24: SyncAccount

手机 网站

后台

Json