文档
测试

获取房源统计信息

GET
housing/statistics

接口描述

获取房源统计信息。返回被占用/未被占用的房源的个数。

接口概要

参数名
类型
描述
必填
需要登陆
必填
需要登陆为超级管理员
必填

请求参数

参数名
类型
描述
必填
mode
String
统计的模式。可用值见下方。
可选
可用值
必填
"all_sum“
String
返回园区内所有的房源的总和统计数据。如:园区内共有300个房源,返回显示有100间空闲,200间被租出。
必填
“all_buildings"
String
返回园区内所有楼内的房源的统计数据,以楼号为索引。如:园区内有1,2,3号楼,返回显示1号楼有a个空闲房源,b个被租出的房源,2号楼有有c个空闲房源,d个被租出的房源,以此类推。
必填
"building"
String
若选用此模式,则需另提交参数building的值。返回园区内指定楼内的房源的统计数据。
必填
若为空
启用默认值"all_sum"。
必填
building
Integer
当选用模式"building"时,提交此值。为想要指定获取房源统计数据的楼号。若填写为x,则返回x楼内有a个空闲房源,b个被租出的房源。
可选

响应参数 (Json)

参数名
类型
描述
必填
status
表Bool的Integer
为1或0。1表获取成功,0表获取失败。
必填
error-diag
String
若status为0则不为空,显示错误类型。若status为1则为空。
必填
error-note
String
进一步解释错误原因。若status为1则为空。
必填
data
若status为1则不为空,为返回的房源统计信息。若status为0则为空。
必填
选中mode为"all_sum"时
Dict
必填
empty
Integer
所有园区内空房源的数量。
必填
occupied
Integer
所有园区内被租出的房源的数量。
必填
total_rooms
Integer
园区内房源的总数量。
必填
选中mode为"all_buildings"时
Dict
必填
单个房源条目
Dict
必填
楼号
Integer
楼号索引。
必填
empty
Integer
该楼内空房源的数量。
必填
occupied
Integer
该楼内被租出房源的数量。
必填
total_rooms
Integer
该楼内的房源总数量。
必填
选中mode为"building"时
Dict
必填
empty
Integer
指定楼的空房源数量。
必填
occupied
Integer
指定楼的被租出的房源的数量。
必填
total_rooms
Integer
指定楼的房源总数量。
必填

响应值示范

``` { "status": 1, "error-diag": "", "error-note": "", "data": { "empty": 12, "occupied": 8, "total_rooms": 20 } } # mode = "all_sum" { "status": 1, "error-diag": "", "error-note": "", "data": { "10": { #10号楼 "empty": 4, "occupied": 2, "total_rooms": 6 }, "11": { #11号楼 "empty": 5, "occupied": 1, "total_rooms": 6 }, "12": { #12号楼 "empty": 3, "occupied": 5, "total_rooms": 8 } } } # mode = "all_buildings" { "status": 1, "error-diag": "", "error-note": "", "data": { "10": { #指定10号楼 "empty": 4, "occupied": 2, "total_rooms": 6 } } } # mode = "building" # building = 10 ```