saveHouseAndRoomData 保存房屋与房间数据

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

时间: 2024-10-10 00:06:30

saveHouseAndRoomData 保存房屋与房间数据的相关文章

saveHouseAndRoomDataV2 保存房屋与房间数据 V2

POST: request: { "action": "saveHouseAndRoomDataV2", "requestData": { "HouseTypeKey": "fa2ad2e1-818e-49ff-838b-7a484adf5ccd", "TotalArea": "11", "TotalPeopleCount": "1&qu

getHouseAndRoomData 取房屋与房间数据

*** /api/ashx/service.ashx POST REQUEST: { "action": "getHouseAndRoomData", "token": "59ebefa6-214f-4141-a889-4c3e98fbaafd", "appUserKey": "79bb640d-9ce0-46d6-bf2b-7d9d548fc460" } RESPONSE: { &qu

getRoomData 取房间数据

post: request: { "action": "getRoomData", "isDebug":1, "token": "23b16784-54c5-4ca9-a885-e4b472ddc177", "requestData": { "Key": "e57c4868-937d-4a03-a1b0-bd3ef769d803" } } post

saveCardMachineConfig 保存卡机空调配置数据

post request: { "action": "saveCardMachineConfig", "isDebug": 1, "token": "687ed3af-bc9d-400e-ac5e-ac73d593405e", "requestData": [ { "DeviceBrandKey": "64f5bd96-db3c-45ad-a467-a8c1

saveObviousInstallRadiatorConfig 保存明装暖气片配置数据

post request: { "action": "saveObviousInstallRadiatorConfig", "isDebug": 1, "token": "687ed3af-bc9d-400e-ac5e-ac73d593405e", "requestData": [ { "FurnaceBrandKey": "de0f18b7-c07d-4e

DHTMLX 前端框架 建立你的一个应用程序 教程(十)--保存表单中的数据

保存表单中的数据 现在我们所要做的是 当用户点击提交按钮的时候  我们将表单中的数据进行保存操作. 我们可以使用dhtmlxDataProcessor. 来进行操作.它是一个数据组件,可以提供与服务器端的通信和交互.  它监控所有的数据更改  可以与服务器进行增删改查的操作 这里我们需要的是进行更新的操作 保存更改的数据到后台 1.在首页中我们添加一下代码 'index.html' file var dpg = new dataProcessor("data/contacts.php"

Android 使用Application类保存应用的全局数据

在实际应用我们经常需要对数据进行交互与保存,但Intent中默认的方法对传输数据是有类型限制的,当我们需要传输或保存一个复杂的泛型数据时,使用Application是一个很好的解决办法. 顾名思义,Application对应整个应用,就如Activity对应当前的活动窗口一样,当我们需要使用它的时候,一定要在AndroidManifest.xml中对它进行声明. <application android:name="MeterApplication" android:allowB

android用存到缓存的方法来保存ListView里的数据

对于这样的数据: <?xml version="1.0" encoding="utf-8" ?> <rss><sid>77f265bb46de068e78f35afbadec62af</sid><count>3</count><control>0</control> <mblog><uid>1195224593</uid><fav

学会python可以上天!20行代码获取斗鱼平台房间数据,就是这么牛逼!

Python(发音:英[?pa?θ?n],美[?pa?θɑ:n]),是一种面向对象.直译式电脑编程语言,也是一种功能强大的通用型语言,已经具有近二十年的发展历史,成熟且稳定.它包含了一组完善而且容易理解的标准库,能够轻松完成很多常见的任务.它的语法非常简捷和清晰,与其它大多数程序设计语言不一样,它使用缩进来定义语句. Python支持命令式程序设计.面向对象程序设计.函数式编程.面向切面编程.泛型编程多种编程范式.与Scheme.Ruby.Perl.Tcl等动态语言一样,Python具备垃圾回收