标签:
*****/api/ashx/service.ashx
POST
REQUEST: (注意:这里放入 isDebug 仅用来显示 详细的ERROR信息,如果不需要知道详细ERROR, 可以不传 isDebug )
{ "action": "saveHouseAndRoomData", "token": "59ebefa6-214f-4141-a889-4c3e98fbaafd", "isDebug": 1, "houseTypeKey": "F1CF0D0E-F991-4BBF-8E48-23004786ED8C", "totalArea": 879.35, "totalPeopleCount": 5, "appUserKey": "79bb640d-9ce0-46d6-bf2b-7d9d548fc460", "RoomTypes": [ { "roomCountForRoomType": 9, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6", "totalAreaForRoomType": 343.3, "remark": "test11", "Rooms": [ { "SingleRoomArea": 73.3, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" }, { "SingleRoomArea": 53.8, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" } ] }, { "roomCountForRoomType": 4, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D", "totalAreaForRoomType": 83.3, "remark": "223aaa", "Rooms": [ { "SingleRoomArea": 23.3, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 73.8, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 4.5, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" } ] } ] }
response:
{ "data": true, "msg": "success", "responseCode": { "msgCode": 200, "msgDetail": "OK" }, "serverTime": "2016-05-06 04:16:22", "success": true }
另外, input 的数据格式大致如下 :
input
HouseTypeKey
TotalArea
TotalPeopleCount
AppUserKey
array of
RoomTypeKey
RoomCountForRoomType
TotalAreaForRoomType
Remark
array of
SingleRoomArea
RoomTypeKey
REQUEST 2: (错误的TOKEN)
{ "action": "saveHouseAndRoomData", "token": "59ebefa6-214f-4141-a889-4c3e98fbaafd1", "isDebug": 1, "houseTypeKey": "F1CF0D0E-F991-4BBF-8E48-23004786ED8C", "totalArea": 879.35, "totalPeopleCount": 5, "appUserKey": "79bb640d-9ce0-46d6-bf2b-7d9d548fc460", "RoomTypes": [ { "roomCountForRoomType": 9, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6", "totalAreaForRoomType": 343.3, "remark": "test11", "Rooms": [ { "SingleRoomArea": 73.3, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" }, { "SingleRoomArea": 53.8, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" } ] }, { "roomCountForRoomType": 4, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D", "totalAreaForRoomType": 83.3, "remark": "223aaa", "Rooms": [ { "SingleRoomArea": 23.3, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 73.8, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 4.5, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" } ] } ] }
RESPONSE 2:
{ "data": null, "msg": null, "responseCode": { "msgCode": 401, "msgDetail": "Unauthorized" }, "serverTime": "2016-05-06 04:20:26", "success": false }
REQUEST 3: error format of input
{ "action": "saveHouseAndRoomData", "token": "59ebefa6-214f-4141-a889-4c3e98fbaafd", "isDebug": 1, "houseTypeKey": "F1CF0D0E-F991-4BBF-8E48-23004786ED8C", "totalArea": 879.35, "totalPeopleCount": 5, "appUserKey": "79bb640d-9ce0-46d6-bf2b-7d9d548fc460", "RoomTypes": [ { "roomCountForRoomType": 9, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6", "totalAreaForRoomType": 343.3, "remark": "test11", "Rooms": [ { "SingleRoomArea": 73.3, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" }, { "SingleRoomArea": 53.8, "roomTypeKey": "1D2734F3-5F7A-4E25-B750-1478E3D614C6" } ] }, { "roomCountForRoomType": 4, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D", "totalAreaForRoomType": 83.3, "remark": "223aaa", "Rooms": [ { "SingleRoomArea": 23.3, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 73.8, "roomTypeKey": "90B69EE8-5DC5-4882-B69D-E7BC26DA449D" }, { "SingleRoomArea": 4.5 } ] } ] }
response 3:
{ "data": null, "msg": "将字符串转换为 uniqueidentifier 时失败。", "responseCode": { "msgCode": 500, "msgDetail": "Crash" }, "serverTime": "2016-05-06 04:22:15", "success": false }
saveHouseAndRoomData 保存房屋与房间数据
标签:
原文地址:http://www.cnblogs.com/jwiter/p/5464033.html