1 / 6

localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码

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/app1000/getCurrentUser.

dobry
Download Presentation

localhost:8080/idoserver/j_spring_security_check post 提交参数: j_password=1234// 密码

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://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}

  2. 获得当前用户信息: 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

  3. 心跳检测: 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/offline • authorities//权限数组,可能出现的权限admin,service,visitor • ownerId//所有者编号 • 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}]

  4. 打开对话窗口后获得聊天记录: http://localhost:8080/idoserver/app1000/getMessageRecord userId=xxxx//当前用户id contactId=xxxx//联系人id start=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/sendTo contactId=xxxx//联系人id content=xxxx//发送内容 contentId=1332205744200//唯一编号,用来区分发内容

  5. 查看最近联系人页面要用到的链接: http://localhost:8080/idoserver/app1000/getUsers?role=service,admin {"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} 查看最近联系人(都跟谁聊过) http://localhost:8080/idoserver/app1000/getDialogRecord userId=xxxx//待查看用户的id limit=8//每页显示个数 start=0//从第几条记录开始显示,eg要显示第n页start=(n-1)*8 {"id":"0004d4f1c1524911986645dfb06faa5b","type":null,"data":{"totalCount":1,"results":[{"id":"edb4a1d6362f227301362f2606210004","date":1332230882000,"userId":"edb4a1d6362edaa001362edd36a70008","contactId":"2D425D67C30555D38AC2D4066D779A9C","contactName":"访客0"}]},"success":true} 查看两个用户之间的聊天内容 http://localhost:8080/idoserver/app1000/getMessageRecord userId=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}

  6. 服务器返回的信息都是json格式: id//唯一编号 type//服务器推送(polling)时根据类型的不同执行不同的操作,主动请求时不用理会 data//具体的信息内容,不同的type具有不同的data success//是否成功,若为false则直接弹出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} 说明:

More Related