<portalStatistics_uri>/user/onlinelist[.<format>]
onlineUserList 资源是 iPortal 在线用户数列表资源。通过发送 GET 请求,可以获取 iPortal 在线用户数列表。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiportal 是服务器名。
http://supermapiportal:8190/iportal/manager/portalstatistics/user/onlinelist.rjson
获取 iPortal 在线用户数列表。
参数未设置,默认返回按照用户名升序排序的在线用户列表信息,参数设置后,可根据设置的参数返回在线用户列表信息, 请求参数必须包含在 URI 中。
名称 | 类型 | 含义 |
orderBy | Orderby | 按排序字段查询。 |
orderType | OrderType | 按排序时升序/降序查询。 |
currentPage | int | 分页页码。 |
pageSize | int | 分页中每页大小。 |
对 onlineUserList 资源执行 GET 请求,返回在线用户列表信息。由以下字段组成:
字段 | 类型 | 说明 |
content | List<IportalUserWithLoginInfo> | 页面内容。 |
currentPage | int | 当前第几页。 |
pageSize | int | 每页大小。 |
searchParameter | SearchParameter | 当前页搜索参数。 |
total | int | 总记录数。 |
totalPage | int | 总页数。 |
对 onlineUserList 资源:http://localhost:8190/iportal/manager/portalstatistics/user/onlinelist.rjson 执行 GET 请求,返回 rjson 格式的资源表述如下:
{
"content": [
{
"departmentId": null,
"departmentNames": null,
"description": null,
"elapsedTime": 183883,
"email": null,
"isLocked": false,
"joinTime": 1497430323280,
"loginCount": 1,
"loginTime": 1497430333117,
"name": "admin",
"nickname": "admin",
"ownRoles": [
"ADMIN",
"SYSTEM"
],
"password": null,
"passwordLastModified": {
"date": 14,
"hours": 16,
"minutes": 52,
"month": 5,
"seconds": 3,
"time": 1497430323170,
"year": 117
},
"passwordQuestion": null,
"roles": [
"ADMIN",
"SYSTEM"
],
"userGroups": []
},
{
"departmentId": null,
"departmentNames": null,
"description": "",
"elapsedTime": 44920,
"email": null,
"isLocked": false,
"joinTime": 1497430374014,
"loginCount": 1,
"loginTime": 1497430472080,
"name": "user1",
"nickname": "user1",
"ownRoles": [
"PORTAL_USER"
],
"password": null,
"passwordLastModified": {
"date": 14,
"hours": 16,
"minutes": 52,
"month": 5,
"seconds": 53,
"time": 1497430373922,
"year": 117
},
"passwordQuestion": null,
"roles": [
"PORTAL_USER"
],
"userGroups": []
}
],
"currentPage": 1,
"pageSize": 10,
"searchParameter": {
"currentPage": 1,
"keywords": null,
"orderBy": null,
"orderType": "ASC",
"pageSize": 10,
"userNames": [
"user1",
"admin"
]
},
"total": 2,
"totalPage": 1
}
如果希望获取指定的在线用户列表信息,如获取按登录时长降序排序,则需设置 orderBy=ELAPSEDTIME,orderType=DESC。即对 onlineUserList 资源:http://localhost:8190/iportal/manager/portalstatistics/user/onlinelist.rjson?orderBy=ELAPSEDTIME&orderType=DESC 执行 GET 请求,则返回的 rjson 资源表述如下:
{
"content": [
{
"departmentId": null,
"departmentNames": null,
"description": null,
"elapsedTime": 395883,
"email": null,
"isLocked": false,
"joinTime": 1497430323280,
"loginCount": 1,
"loginTime": 1497430333117,
"name": "admin",
"nickname": "admin",
"ownRoles": [
"ADMIN",
"SYSTEM"
],
"password": null,
"passwordLastModified": {
"date": 14,
"hours": 16,
"minutes": 52,
"month": 5,
"seconds": 3,
"time": 1497430323170,
"year": 117
},
"passwordQuestion": null,
"roles": [
"ADMIN",
"SYSTEM"
],
"userGroups": []
},
{
"departmentId": null,
"departmentNames": null,
"description": "",
"elapsedTime": 256920,
"email": null,
"isLocked": false,
"joinTime": 1497430374014,
"loginCount": 1,
"loginTime": 1497430472080,
"name": "user1",
"nickname": "user1",
"ownRoles": [
"PORTAL_USER"
],
"password": null,
"passwordLastModified": {
"date": 14,
"hours": 16,
"minutes": 52,
"month": 5,
"seconds": 53,
"time": 1497430373922,
"year": 117
},
"passwordQuestion": null,
"roles": [
"PORTAL_USER"
],
"userGroups": []
}
],
"currentPage": 1,
"pageSize": 10,
"searchParameter": {
"currentPage": 1,
"keywords": null,
"orderBy": "ELAPSEDTIME",
"orderType": "DESC",
"pageSize": 10,
"userNames": [
"user1",
"admin"
]
},
"total": 2,
"totalPage": 1
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 onlineUserList 资源是否存在,或者客户端是否有权限访问 onlineUserList 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 onlineUserList 资源是否支持<format>格式的表述。