visitDetails


URI

<portalStatistics_uri>/resource/visit/details[.<format>]

支持的方法

GETHEAD

父资源

portalStatistics

介绍

visitDetails 资源是某类资源的访问历史记录详情资源。通过发送 GET 请求,可以获取某类资源的访问历史记录详情。目前支持获取门户中服务资源的访问历史记录详情,需要您开启服务代理功能以及服务代理访问统计功能。

支持的方法:

支持的表述格式:RJSON、JSON、HTML、XML。

资源层次

HTTP 请求方法

对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiportal 是服务器名。

http://supermapiportal:8190/iportal/manager/portalstatistics/resource/visit/details.rjson

GET 请求

获取某类资源的访问历史记录详情。

请求参数

发送请求时,需要在请求体中包含如下参数, 请求参数必须包含在 URI 中。

名称 类型 含义
userNames List<String> 【可选参数】资源访问者。
resourceType ResourceType 【必选参数】资源类型。目前支持 SERVICE(服务资源)。
resourceId Integer 【可选参数】资源的 id。
startTime Long 【可选参数】资源访问记录的起始时间,如果不为正数则从最早保存的历史记录开始查询。值为自 1970 年 1 月 1 日 00:00:00 GMT 以来此日期表示的毫秒数。
endTime Long 【可选参数】资源访问记录的终止时间,如果不为正数或不传此参数,则以服务器当前时间作为终止时间。值为自 1970 年 1 月 1 日 00:00:00 GMT 以来此日期表示的毫秒数。
orderBy ResVisitDetailOrderBy 【可选参数】按排序字段查询。
orderType OrderType 【可选参数】按排序时升序/降序查询。
currentPage int 【可选参数】分页页码。
pageSize int 【可选参数】分页中每页大小。

响应结构

对 visitDetails 资源执行 GET 请求,返回资源访问记录详情信息。由以下字段组成:

字段 类型 说明
content List<ResAccessRecord> 页面内容。
currentPage int 当前第几页。
pageSize int 每页大小。
searchParameter SearchParameter 当前页搜索参数。
total int 总记录数。
totalPage int 总页数。

响应示例

统计一段时间内,服务资源中 id 为 914669511 的服务访问记录详情信息,则需设置 resourceType=SERVICE&resourceIds=914669511&startTime=1583047567007&endTime=1599549967007。即对 visitDetails 资源:http://localhost:8190/manager/portalstatistics/resource/visit/details.json?resourceType=SERVICE&resourceId=914669511&startTime=1583047567007&endTime=1599549967007 执行 GET 请求,则返回的 rjson 资源表述如下:

{

    "total": 1106,

    "totalPage": 111,

    "pageSize": 10,

    "searchParameter": {

        "orderType": "ASC",

        "resourceId": 914669511,

        "keywords": null,

        "userNames": null,

        "orderBy": null,

        "pageSize": 10,

        "startTime": 1583047567007,

        "endTime": 1599549967007,

        "currentPage": 1,

        "resourceType": "SERVICE"

    },

    "currentPage": 1,

    "content": [

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China.json",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585187537781,

            "userName": "admin",

            "remoteAddress": "192.168.112.121",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296775581,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296775581,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296775581,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296778244,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296775591,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296778245,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296778246,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296778246,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        },

        {

            "method": "GET",

            "requestURL": "http://192.168.120.40:8095/5fu2xw8o/iserver/services/map-china400/rest/maps/China/tileimage.png",

            "responseTime": 0,

            "resourceName": "china",

            "time": 1585296778244,

            "userName": "admin",

            "remoteAddress": "192.168.120.40",

            "responseCode": 200,

            "errorMsg": null

        }

    ]

}

HEAD 请求

返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。

HEAD 请求可以用来判断 visitDetails 资源是否存在,或者客户端是否有权限访问 visitDetails 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 visitDetails 资源是否支持<format>格式的表述。

请参见