SyncAccount
-
Upload
xiomara-lamorena -
Category
Documents
-
view
40 -
download
14
description
Transcript of SyncAccount
SyncAccount
http+Json
手机
Upload Download Search
云存储
IndexBuilder
Mysql(Partition By User)
Favor Del UserPatition
CloudStorageAdpter MemoryCacheLogin/Logout
图片(Img)
分表分库
图片(Img)
文本(theText
)
录音(theRec
ord)
节点 (Node)
图片(Img)
图片(Img)
文本(theText
)
录音(theRec
ord)
节点 (Node)
图片(Img)
图片(Img)
文本(theText
)
录音(theRec
ord)
节点 (Node)
游记 (Travel)
用户 (User) 游记(Travel)
游记(Travel)
用户分区 (Partition)
SearchIndex
Partition_Conf
• PartitionID• Datasource_ip• Datasource_username• Datasource_password
User_Summary
• PartitionID• UserID• UserEmail• Password(MD5)• SinaWeiBoID• QQWeiBoID• IsDel– 0/null: no– 1: yes
User_Detail
• PartitionID• UserID• Sex• BirthDay• City• CreateTime• LastLoginTime
Travel• PartitionID• UserID• TravelID• TravelTitle• CreateTime• FinishTime• Status
– 0/null:active– 1/other:close
• FavorNum: 收藏次数• DownloadNum: 下载次数• RePubNum: 转发次数• IsDel
– 0/null: no– 1: yes
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: 标签
User_Favor
• PartitionID• UserID• FavorID• Type
– 1: onTravel– 2: onNode
• CreateTime• TargetID• IsDel
– 0/null: no– 1: yes
User_Favor
• PartitionID• UserID• FavorID• Type
– 1: onTravel– 2: onNode
• CreateTime• TargetID• IsDel
– 0/null: no– 1: yes
第 1 类 API :用户相关
• 请求 (http://serverIP/usr/checkimg• 返回 : png 数字图片• 处理– http header cookie 设置• rid=11212121212• t=123213ABCDDEEE
1 ) API: 获得验证码图片
• 请求 (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: 注册
• 请求 (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: 登录
• 请求 (http://serverIP/usr/logout)• 返回– { “r": “ok“}
• 处理– http header cookie 注销
4 ) API: 退出登录
第 2 类 API :游记相关
• 请求 (http://serverIP/s/travel/getid)• 返回– { “r”:”ok”,“m":“123ABCDE1D“}– {“r”:”fail”,”m”:”NotLogin”}
• 处理– 判断是否登录(根据 cokiee)– 生产新 ID
1 ) API: 新建一个游记
• 请求 (http://serverIP/s/travel/del?id=1213sdfsdf)
• 返回– { “r”:”ok”}– {“r”:”fail”,”m”:”NotLogin”}
• 处理– 判断是否登录(根据 cokiee)– 置 travel 为 isDel ,返回给客户端
2 ) API: 删除游记
• 请求 (http://serverIP/s/travel/list)• 返回– { “r”:”ok”, “travels“:[{“id”:”sfsdf1213“,”title”:”this…”}] }– {“r”:”fail”,”m”:”NotLogin”}
• 处理– 判断是否登录(根据 cokiee)– 排序 travel ,返回给客户端
3 ) API:List 登录用户下的所有游记
• 请求 (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
• 请求 (http://serverIP/s/travel/pkg?id=sfsdf)• 返回• 处理– 判断是否登录(根据 cokiee)– 根据 travel id ,返回给客户端一个 package ,格
式待定
5 ) API:package
• 请求 (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: 新建一组节点
• 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: 上传 ( 更新 ) 节点
分库分表• P1– Travel_1,Travel_2– Node_1,Node_2
• P2– Travel_1,Travel_2– Node_1,Node_2
手机 网站
后台
Json