接口列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\ServerModel::serverList |
| 所属业务 | 公共接口 |
| 来源模块/系统 | 接口模型 |
功能说明
接口列表
调用示例
$param = ['keywords' => '示例关键字', 'status' => '1', 'page' => 1, 'limit' => 20, 'orderby' => 'id', 'sort' => 'desc', 'module' => 'string'];
$result = (new \app\common\model\ServerModel())->serverList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.keywords | string | 否 | — | — | 关键字,搜索接口ID/接口名称/分组名称 |
param.status | string | 否 | — | — | 状态0禁用,1启用 |
param.page | int | 否 | 1 | — | 页数 |
param.limit | int | 否 | 20 | — | 每页条数 |
param.orderby | string | 否 | id | — | 排序(id,name,server_group_id,status) |
param.sort | string | 否 | desc | — | 升/降序(asc=升序,desc=降序) |
param.module | string | 否 | — | — | 搜索:模块类型 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 接口列表 |
list[].id | int | 接口ID |
list[].name | string | 接口名称 |
list[].module | string | 模块类型 |
list[].url | string | 地址 |
list[].username | string | 用户名 |
list[].password | string | 密码 |
list[].hash | string | hash |
list[].status | int | 是否启用(0=禁用,1=启用) |
list[].server_group_id | int | 接口分组ID |
list[].server_group_name | string | 接口分组名称 |
list[].host_num | int | 已开通数量 |
list[].module_name | string | 模块名称 |
count | int | 总条数 |
正常返回
{
"list": [
{
"id": 1,
"name": "示例名称",
"module": "string",
"url": "https://example.com/callback",
"username": "示例名称",
"password": "Example@123",
"hash": "string",
"status": 1,
"server_group_id": 1,
"server_group_name": "示例名称",
"host_num": 1,
"module_name": "示例名称"
}
],
"count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |