<portalConfig_uri>/keyinfoswithvisitcount[.<format>]
keyInfosWithVisitCount 是带有访问统计信息的密钥资源。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiportal:8190/iportal/manager/iportalconfig/keyinfoswithvisitcount.rjson
获取带有访问统计信息的密钥
发送请求时,需要在请求体中包含如下参数, 请求参数必须包含在 URI 中。
名称 | 类型 | 含义 |
ids | List<Integer> | 【可选参数】密钥的 id 数组 |
visitStart | Long | 【可选参数】查询 key 在此时间值及此时间值之后的访问量,如果为null或者小于0,则起始时间不限制。值为自 1970 年 1 月 1 日 00:00:00 GMT 以来此日期表示的毫秒数。 |
visitEnd | Long | 【可选参数】查询 key 在此时间值及此时间值之前的访问量,如果为null或者小于0,则截止时间不限制。值为自 1970 年 1 月 1 日 00:00:00 GMT 以来此日期表示的毫秒数。 |
tags | String[] | 【可选参数】key 标签 |
orderBy | KeyOrderBy | 【可选参数】排序类型 |
orderType | OrderType | 【可选参数】排序时升序/降序 |
pageSize | int | 【可选参数】 每页大小 |
currentPage | int | 【可选参数】当前页码 |
对 keyInfosWithVisitCount 资源执行 GET 请求,返回资源被客户端访问的概览信息。由以下字段组成:
字段 | 类型 | 说明 |
content | List<KeyInfoWithVisitCount> | 页面内容 |
currentPage | int | 当前第几页 |
pageSize | int | 每页大小 |
searchParameter | KeySearchParameter | 当前页搜索参数 |
total | int | 总记录数 |
totalPage | int | 总页数 |
查询全部时间段内,密钥资源中 id 为23的密钥的访问记录详情信息,则需设置 ids=[23]。即对 keyInfosWithVisitCount 资源:http://localhost:8190/iportal/manager/iportalconfig/keyinfoswithvisitcount.json?visitStart=-1&visitEnd=1663225779990&orderBy=VISITCOUNT&orderType=DESC&pageSize=5¤tPage=1&ids=[23] 执行 GET 请求,则返回的 rjson 资源表述如下
{
"total": 1,
"totalPage": 1,
"pageSize": 5,
"searchParameter": {
"orderType": "DESC",
"types": null,
"visitEnd": 1663225779990,
"keywords": null,
"userNames": null,
"ids": [
23
],
"orderBy": "VISITCOUNT",
"pageSize": 5,
"userName": null,
"visitStart": -1,
"currentPage": 1,
"tags": null
},
"currentPage": 1,
"content": [
{
"limitation": "0.0.0.0",
"resources": [
{
"ids": [
1483124953
],
"type": "SERVICE"
}
],
"updateTime": null,
"userName": "wujr",
"tags": [],
"clientType": "SERVER",
"visitCount": 3,
"createTime": null,
"name": "population",
"expiration": null,
"id": 23,
"keyType": "CUSTOM",
"key": "TdruN5cMM32fdVdfD5caHg0L"
}
]
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 keyInfosWithVisitCount 资源是否存在,或者客户端是否有权限访问 keyInfosWithVisitCount 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 keyInfosWithVisitCount 资源是否支持<format>格式的表述。