visitors


URI

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

Supported methods

GET, HEAD

Parent resource

portalStatistics

Introduction

The visitors resource is the overview information resource of the visitors for some resources. It can get the overview information resource of the visitors for some resources by sending the GET request. Currently, you can access the visitor overview information of the service resources in the portal, and you need to enable the service agent function and the service agent accessing statistics function.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/manager/portalstatistics/resource/visit/visitors.rjson

GET request

Get the overview information resource of the visitors for some resources

Request parameter

When sending the request, it needs to include the following parameters in the request entity, and the request parameters should be contained in URI.

Name Type Description
resourceType ResourceType [Required] Resource type. Currently supports SERVICE (Service resource).
resourceIds List<Integer> [Optional] Resource id array.
startTime Long [Optional] The start time of the visitors overview information records. If it is not positive number, it will be queried from the earliest record. It is the value in millisecond of the time since 00:00:00 GMT January 1, 1970.
endTime Long [Optional] The end time of the visitors overview information records. If it is not positive number or not set, it will take the current server time as the end time. It is the value in millisecond of the time since 00:00:00 GMT January 1, 1970.
orderBy ResVisitorOrderBy [Optional] Query by the ordering field.
orderType OrderType [Optional] Query according to sort ascending/descending order.
currentPage int [Optional] Paging number.
pageSize int [Optional] Page size.
keywords String[] [Optional] Fuzzy query by user name.

Response structure

After preforming the GET request for the visitors resource,it will return the resource visitor overview information. Including the following fields:

Field Type Description
content List<ResVisitorInfo> Page content.
currentPage int The current page number.
pageSize int The page size.
searchParameter SearchParameter The search parameter for the current page.
total int The total record number.
totalPage int The total number of pages.

Response example

To make statistics for the visitors overview information for the service whose id is 3 in a period, it needs to set resourceType=SERVICE&resourceIds=[3]startTime=1492063745780&endTime=1592657395201. The returned rjson format representation after implementing the GET request on the visitors resource http://localhost:8090/iportal/manager/portalstatistics/resource/visit/visitors.rjson?resourceType=SERVICE&resourceIds=[3]&startTime=1492063745780&endTime=1592657395201 is as follows:

{

    "content": [

        {

            "nickName": "admin",

            "resourceId": "3",

            "resourceName": "China",

            "userName": "admin",

            "visitCount": 534

        }

    ],

    "currentPage": 1,

    "pageSize": 10,

    "searchParameter": {

        "currentPage": 1,

        "endTime": 1592657395201,

        "keywords": null,

        "orderBy": null,

        "orderType": "ASC",

        "pageSize": 10,

        "resourceIds": [

            3

        ],

        "resourceType": "SERVICE",

        "startTime": 1492063745780

    },

    "total": 1,

    "totalPage": 1

}

HEAD request

Returns the same HTTP response header as the GET request, but does not have the response entity. It can get the metadata information in the response header without transferring the whole response content. Metadata information includes media type, character encoding, compression encoding, entity content length, and so on.

The HEAD request can be used to determine whether the visitors resource exists or whether the client has authority to access the visitors resource. It can quickly determine whether the visitors resource supports the representation in <format> format by performing HEAD request on URI with <format>.

See