6
http://localhost:8080/idoserver/ j_spring_security_check post 提提提提j_password=1234// 提提 j_username=100102// 提提 {"priority":null,"type":null,"date":null,"data":" 提提提 ","success":true,"code":null}

Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

Embed Size (px)

Citation preview

Page 1: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

http://localhost:8080/idoserver/j_spring_security_checkpost提交参数:j_password=1234//密码j_username=100102//账号{"priority":null,"type":null,"date":null,"data":"登录成功。 ","success":true,"code":null}

Page 2: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

获得当前用户信息:http://localhost:8080/idoserver/app1000/getCurrentUser{"id":"de6ae765a6bb4e0881fec1d94d1e37ef","type":null,"data":{"name":"廖欣 ","location":null,"id":"edb4a1d6362d7ca401362d88f0870008","accountId":"100102","sex":"male","ip":"0:0:0:0:0:0:0:1","nickname":"kscner","status":"online","authorities":["admin"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332203947060},"success":true}

获得客服:http://localhost:8080/idoserver/app1000/getUsers?role=service,admin{"id":"968eedc4e11f41219eaa43afdb194e21","type":null,"data":[{"name":"廖欣 ","location":null,"id":"edb4a1d6362d7ca401362d88f0870008","accountId":"100102","sex":"male","ip":"0:0:0:0:0:0:0:1","nickname":"kscner","status":"online","authorities":["admin"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332203947060},{"name":"100103","location":null,"id":"edb4a1d6362d7ca401362d8a7556000e","accountId":"100103","sex":"male","ip":null,"nickname":null,"status":"offline","authorities":["service"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":null}],"success":true}

获得访客:http://localhost:8080/idoserver/app1000/getContacts{"id":"8ef8c7835874424086a6763e25d18e83","type":null,"data":[{"name":null,"location":null,"id":"A8DB708F41EEE673DB88E667897230EC","accountId":null,"sex":null,"ip":"0:0:0:0:0:0:0:1","nickname":"访客 0","status":"online","authorities":["visitor"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332204283724}],"success":true}

移除访客 (不能移除客服 ):http://localhost:8080/idoserver/app1000/removeContact?contactId=0316A54CE92FA78AA03862AF193D2034

Page 3: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

心跳检测:http://localhost:8080/idoserver/app1000/polling可能的响应结果 (结果是一个数组, ):联系人上线:[{"id":"0e17652a0212483fb8dc790f92caf18d","type":"contact_enter","data":{"name":null,"location":null,"id":"2330732317CD8422D82D55FCA12009EE","accountId":null,"sex":null,"ip":"0:0:0:0:0:0:0:1","nickname":"访客 1","status":"online","authorities":["visitor"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332205060263},"success":true}]说明 (其他类似 ):id//唯一编号type//有联系人上线了data//上线的联系人的信息 :

name//名称location//地理位置id//用户编号accountId//账号编号 (忽略 )sex//性别ip//ip地址nickname//昵称status//是否在线 ,可选值 online/offlineauthorities//权限数组,可能出现的权限 admin,service,visitorownerId//所有者编号

success//是否执行成功,为 false时,返回的 data中将是具体的错误信息, true时是上线的联系人信息

联系人离线:[{"id":"3335080f59bd4bbf917337ba518ef448","type":"contact_exit","data":{"name":null,"location":null,"id":"DD48D23D2DA729E233125FC239837880","accountId":null,"sex":null,"ip":"0:0:0:0:0:0:0:1","nickname":"访客 2","status":"offline","authorities":["visitor"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332205202787},"success":true}]移除联系人:[{"id":"e489a3c45b4f41dda287e7d3e58acc07","type":"remove_contact","data":{"name":null,"location":null,"id":"DD48D23D2DA729E233125FC239837880","accountId":null,"sex":null,"ip":"0:0:0:0:0:0:0:1","nickname":"访客 2","status":"offline","authorities":["visitor"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332205202787},"success":true}]接收信息:[{"id":"315ecca625e44902af9fee13bdc522d0","type":"receive_message","data":{"id":"4b82be1a9c434e3d84aa7f16b8fbb41b","content":"aaaaa","date":1332205426175,"userId":"7A7EB46FB95D38F167817C351CA497A6","contactId":"edb4a1d6362d7ca401362d88f0870008","contentId":null,"status":0,"userName":"访客3","contactName":"kscner"},"success":true}]

显示正在输入:[{"id":"0b40f8d88860476fa4a230412f81b13e","type":"contact_typing","data":"7A7EB46FB95D38F167817C351CA497A6","success":true}]

Page 4: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

打开对话窗口后获得聊天记录:http://localhost:8080/idoserver/app1000/getMessageRecorduserId=xxxx//当前用户 idcontactId=xxxx//联系人 idstart=0//写死limit=50//写死

{"id":"c342a8689c2f4f20b1460c5f736d5fc8","type":null,"data":{"totalCount":1,"results":[{"id":"4b82be1a9c434e3d84aa7f16b8fbb41b","content":"aaaaa","date":1332205426000,"userId":"7A7EB46FB95D38F167817C351CA497A6","contactId":"edb4a1d6362d7ca401362d88f0870008","contentId":null,"status":0,"userName":"访客3","contactName":"kscner"}]},"success":true}

发送正在输入事件:http://localhost:8080/idoserver/app1000/typingcontactId=xxxx//联系人 id

发送信息:http://localhost:8080/idoserver/app1000/sendTocontactId=xxxx//联系人 idcontent=xxxx//发送内容contentId=1332205744200//唯一编号,用来区分发内容

Page 5: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

http://localhost:8080/idoserver/app1000/getUsers?role=service,admin

查看最近联系人(都跟谁聊过)http://localhost:8080/idoserver/app1000/getDialogRecorduserId=xxxx//待查看用户的 idlimit=8//每页显示个数start=0//从第几条记录开始显示, eg要显示第 n页 start=(n-1)*8

查看两个用户之间的聊天内容http://localhost:8080/idoserver/app1000/getMessageRecorduserId=xxxx//联系人 A编号contactId=xxxx//联系人 B编号limit=8//每页显示个数start=0//从第几条记录开始显示, eg要显示第 n页 start=(n-1)*8{"id":"28c56677bc0a416db1734ec6c4254968","type":null,"data":{"totalCount":1,"results":[{"id":"45985a71f0d541c5b22ab13997bb8395","content":"sdfsf","date":1332230882000,"status":0,"userName":"访客0","userId":"2D425D67C30555D38AC2D4066D779A9C","contactId":"edb4a1d6362edaa001362edd36a70008","contentId":null,"contactName":"技术部 "}]},"success":true}

{"id":"0004d4f1c1524911986645dfb06faa5b","type":null,"data":{"totalCount":1,"results":[{"id":"edb4a1d6362f227301362f2606210004","date":1332230882000,"userId":"edb4a1d6362edaa001362edd36a70008","contactId":"2D425D67C30555D38AC2D4066D779A9C","contactName":"访客 0"}]},"success":true}

查看最近联系人页面要用到的链接:

{"id":"a2f10668493b483baef1202e7bc6aca1","type":null,"data":[{"name":"廖欣 ","location":null,"id":"edb4a1d6362edaa001362edd36a70008","status":"online","authorities":["admin"],"ownerId":"100102","accountId":"100102","sex":"male","ip":"0:0:0:0:0:0:0:1","nickname":"技术部 ","hasUnreadMessage":true,"lastVisitTime":1332231878607}],"success":true}

Page 6: Http://localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码 j_username=100102// 账号 {"priority":null,"type":null,"date":null,"data":"

{"id":"968eedc4e11f41219eaa43afdb194e21","type":null,"data":[{"name":"廖欣 ","location":null,"id":"edb4a1d6362d7ca401362d88f0870008","accountId":"100102","sex":"male","ip":"0:0:0:0:0:0:0:1","nickname":"kscner","status":"online","authorities":["admin"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":1332203947060},{"name":"100103","location":null,"id":"edb4a1d6362d7ca401362d8a7556000e","accountId":"100103","sex":"male","ip":null,"nickname":null,"status":"offline","authorities":["service"],"ownerId":"100102","hasUnreadMessage":true,"lastVisitTime":null}],"success":true}

说明:

服务器返回的信息都是 json格式 :id//唯一编号type//服务器推送 (polling)时根据类型的不同执行不同的操作,主动请求时不用理会data//具体的信息内容,不同的 type具有不同的 datasuccess//是否成功,若为 false则直接弹出 data中的内容