码迷,mamicode.com
首页 > 其他好文 > 详细

saveHouseAndRoomData 保存房屋与房间数据

时间:2016-05-06 07:08:11      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:

*****/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"
                }
            ]
        }
    ]
}
View Code

response:

技术分享
    {
        "data": true,
        "msg": "success",
        "responseCode":
        {
            "msgCode": 200,
            "msgDetail": "OK"
        },
        "serverTime": "2016-05-06 04:16:22",
        "success": true
    }
View Code

 

另外, input 的数据格式大致如下 :

技术分享
input
    HouseTypeKey
    TotalArea
    TotalPeopleCount
    AppUserKey
            array of 
                   RoomTypeKey
                   RoomCountForRoomType
                   TotalAreaForRoomType
                   Remark
                        array of
                                SingleRoomArea
                                RoomTypeKey
View Code

 

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"
                }
            ]
        }
    ]
}
View Code

RESPONSE 2:

技术分享
    {
        "data": null,
        "msg": null,
        "responseCode":
        {
            "msgCode": 401,
            "msgDetail": "Unauthorized"
        },
        "serverTime": "2016-05-06 04:20:26",
        "success": false
    }
View Code

 

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
                }
            ]
        }
    ]
}
View Code

response 3:

技术分享
    {
        "data": null,
        "msg": "将字符串转换为 uniqueidentifier 时失败。",
        "responseCode":
        {
            "msgCode": 500,
            "msgDetail": "Crash"
        },
        "serverTime": "2016-05-06 04:22:15",
        "success": false
    }
View Code

 

saveHouseAndRoomData 保存房屋与房间数据

标签:

原文地址:http://www.cnblogs.com/jwiter/p/5464033.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!