240 likes | 317 Views
手机. 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 ).
E N D
手机 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) 图片 (Img) 图片 (Img) 图片 (Img) 图片 (Img) 文本 (theText) 文本 (theText) 文本 (theText) 录音 (theRecord) 录音 (theRecord) 录音 (theRecord) 节点(Node) 节点(Node) 节点(Node) 游记(Travel)
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
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
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
4)API: 退出登录 • 请求(http://serverIP/usr/logout) • 返回 • { “r": “ok“} • 处理 • http header cookie注销
1)API:新建一个游记 • 请求(http://serverIP/s/travel/getid) • 返回 • { “r”:”ok”,“m":“123ABCDE1D“} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 生产新ID
2)API:删除游记 • 请求(http://serverIP/s/travel/del?id=1213sdfsdf) • 返回 • { “r”:”ok”} • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 置travel为isDel,返回给客户端
3)API:List登录用户下的所有游记 • 请求(http://serverIP/s/travel/list) • 返回 • { “r”:”ok”, “travels“:[{“id”:”sfsdf1213“,”title”:”this…”}] } • {“r”:”fail”,”m”:”NotLogin”} • 处理 • 判断是否登录(根据cokiee) • 排序travel,返回给客户端
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,返回给客户端
5)API:package • 请求(http://serverIP/s/travel/pkg?id=sfsdf) • 返回 • 处理 • 判断是否登录(根据cokiee) • 根据travel id,返回给客户端一个package,格式待定
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
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) • 往数据库、存储设备上写数据
分库分表 • P1 • Travel_1,Travel_2 • Node_1,Node_2 • P2 • Travel_1,Travel_2 • Node_1,Node_2
手机 网站 Json 后台