Files
makemd/docs/API_Documentation.md
wurenzhi 1b14947e7b refactor: 优化代码结构和类型定义
feat(types): 添加express.d.ts类型引用
style: 格式化express.d.ts中的接口定义
refactor: 移除未使用的AntFC类型导入
chore: 删除自动生成的.umi-production文件
feat: 添加店铺管理相关表和初始化脚本
docs: 更新安全规则和交互指南文档
refactor: 统一使用FC类型替代React.FC
perf: 优化图表组件导入方式
style: 添加.prettierrc配置文件
refactor: 调整组件导入顺序和结构
feat: 添加平台库存管理路由
fix: 修复订单同步时的库存检查逻辑
docs: 更新RBAC设计和租户管理文档
refactor: 优化部门控制器代码
2026-03-30 01:20:57 +08:00

24 KiB
Raw Permalink Blame History

API文档

1. 概述

本文档描述了 Crawlful Hub 系统的API接口包括认证、用户、商品、订单、财务等模块的接口规范。所有API接口都遵循RESTful设计原则使用JSON格式进行数据交换。

2. 基础信息

2.1 API版本

当前API版本v1

2.2 基础URL

https://api.crawlful.com/v1

2.3 认证方式

系统使用JWTJSON Web Token进行认证在请求头中添加Authorization字段:

Authorization: Bearer <token>

2.4 响应格式

所有API响应都遵循以下格式

{
  "success": true,
  "data": {...},
  "error": null
}
  • success:布尔值,表示请求是否成功
  • data:请求成功时返回的数据
  • error:请求失败时返回的错误信息

2.5 错误码

错误码 描述 HTTP状态码
40001 参数错误 400
40101 未授权 401
40301 禁止访问 403
40401 资源不存在 404
50001 服务器内部错误 500

3. 认证接口

3.1 登录

请求

  • 方法POST
  • 路径:/auth/login
  • 内容类型application/json
  • 请求体:
{
  "email": "user@example.com",
  "password": "password123"
}

响应

{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "id": "1",
      "username": "user",
      "email": "user@example.com",
      "role": "OPERATOR"
    }
  },
  "error": null
}

3.2 注册

请求

  • 方法POST
  • 路径:/auth/register
  • 内容类型application/json
  • 请求体:
{
  "username": "user",
  "email": "user@example.com",
  "password": "password123",
  "role": "OPERATOR"
}

响应

{
  "success": true,
  "data": {
    "userId": "1"
  },
  "error": null
}

3.3 刷新令牌

请求

  • 方法POST
  • 路径:/auth/refresh
  • 内容类型application/json
  • 请求体:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

响应

{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  },
  "error": null
}

4. 用户接口

4.1 获取用户列表

请求

  • 方法GET
  • 路径:/users
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • role角色筛选
    • search搜索关键词

响应

{
  "success": true,
  "data": {
    "users": [
      {
        "id": "1",
        "username": "user1",
        "email": "user1@example.com",
        "role": "OPERATOR",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

4.2 获取用户详情

请求

  • 方法GET
  • 路径:/users/{id}

响应

{
  "success": true,
  "data": {
    "id": "1",
    "username": "user1",
    "email": "user1@example.com",
    "role": "OPERATOR",
    "createdAt": "2023-01-01T00:00:00Z",
    "updatedAt": "2023-01-01T00:00:00Z"
  },
  "error": null
}

4.3 创建用户

请求

  • 方法POST
  • 路径:/users
  • 内容类型application/json
  • 请求体:
{
  "username": "user1",
  "email": "user1@example.com",
  "password": "password123",
  "role": "OPERATOR",
  "tenantId": "1"
}

响应

{
  "success": true,
  "data": {
    "userId": "1"
  },
  "error": null
}

4.4 更新用户

请求

  • 方法PUT
  • 路径:/users/{id}
  • 内容类型application/json
  • 请求体:
{
  "username": "user1",
  "email": "user1@example.com",
  "role": "MANAGER"
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

4.5 删除用户

请求

  • 方法DELETE
  • 路径:/users/{id}

响应

{
  "success": true,
  "data": null,
  "error": null
}

4.6 批量创建用户

请求

  • 方法POST
  • 路径:/users/batch
  • 内容类型application/json
  • 请求体:
{
  "users": [
    {
      "username": "user1",
      "email": "user1@example.com",
      "password": "password123",
      "role": "OPERATOR",
      "tenantId": "1"
    },
    ...
  ]
}

响应

{
  "success": true,
  "data": {
    "createdIds": ["1", "2", ...]
  },
  "error": null
}

5. 商品接口

5.1 获取商品列表

请求

  • 方法GET
  • 路径:/products
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • category分类筛选
    • status状态筛选
    • search搜索关键词

响应

{
  "success": true,
  "data": {
    "products": [
      {
        "id": "1",
        "name": "Product 1",
        "price": 99.99,
        "stock": 100,
        "category": "Electronics",
        "status": "ACTIVE"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

5.2 获取商品详情

请求

  • 方法GET
  • 路径:/products/{id}

响应

{
  "success": true,
  "data": {
    "id": "1",
    "name": "Product 1",
    "price": 99.99,
    "stock": 100,
    "category": "Electronics",
    "status": "ACTIVE",
    "description": "Product description",
    "images": ["image1.jpg", "image2.jpg"]
  },
  "error": null
}

5.3 创建商品

请求

  • 方法POST
  • 路径:/products
  • 内容类型application/json
  • 请求体:
{
  "name": "Product 1",
  "price": 99.99,
  "stock": 100,
  "category": "Electronics",
  "description": "Product description",
  "images": ["image1.jpg", "image2.jpg"]
}

响应

{
  "success": true,
  "data": {
    "productId": "1"
  },
  "error": null
}

5.4 更新商品

请求

  • 方法PUT
  • 路径:/products/{id}
  • 内容类型application/json
  • 请求体:
{
  "name": "Product 1 Updated",
  "price": 109.99,
  "stock": 150
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

5.5 删除商品

请求

  • 方法DELETE
  • 路径:/products/{id}

响应

{
  "success": true,
  "data": null,
  "error": null
}

6. 订单接口

6.1 获取订单列表

请求

  • 方法GET
  • 路径:/orders
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • status状态筛选
    • startDate开始日期
    • endDate结束日期

响应

{
  "success": true,
  "data": {
    "orders": [
      {
        "id": "1",
        "orderNumber": "ORD-2023-0001",
        "totalAmount": 199.98,
        "status": "PENDING",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

6.2 获取订单详情

请求

  • 方法GET
  • 路径:/orders/{id}

响应

{
  "success": true,
  "data": {
    "id": "1",
    "orderNumber": "ORD-2023-0001",
    "totalAmount": 199.98,
    "status": "PENDING",
    "createdAt": "2023-01-01T00:00:00Z",
    "items": [
      {
        "productId": "1",
        "name": "Product 1",
        "quantity": 2,
        "price": 99.99
      }
    ],
    "customer": {
      "name": "Customer 1",
      "email": "customer1@example.com",
      "address": "123 Main St"
    }
  },
  "error": null
}

6.3 创建订单

请求

  • 方法POST
  • 路径:/orders
  • 内容类型application/json
  • 请求体:
{
  "customer": {
    "name": "Customer 1",
    "email": "customer1@example.com",
    "address": "123 Main St"
  },
  "items": [
    {
      "productId": "1",
      "quantity": 2
    }
  ]
}

响应

{
  "success": true,
  "data": {
    "orderId": "1",
    "orderNumber": "ORD-2023-0001"
  },
  "error": null
}

6.4 更新订单状态

请求

  • 方法PUT
  • 路径:/orders/{id}/status
  • 内容类型application/json
  • 请求体:
{
  "status": "SHIPPED"
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

6.5 取消订单

请求

  • 方法POST
  • 路径:/orders/{id}/cancel

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

7. 财务接口

7.1 获取财务报表

请求

  • 方法GET
  • 路径:/finance/reports
  • 查询参数:
    • startDate开始日期
    • endDate结束日期
    • type报表类型daily, monthly, yearly

响应

{
  "success": true,
  "data": {
    "report": {
      "totalSales": 10000.00,
      "totalExpenses": 5000.00,
      "netProfit": 5000.00,
      "transactions": [
        {
          "date": "2023-01-01",
          "amount": 1000.00,
          "type": "SALE"
        },
        ...
      ]
    }
  },
  "error": null
}

7.2 获取结算记录

请求

  • 方法GET
  • 路径:/finance/settlements
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • status状态筛选

响应

{
  "success": true,
  "data": {
    "settlements": [
      {
        "id": "1",
        "amount": 5000.00,
        "status": "COMPLETED",
        "createdAt": "2023-01-01T00:00:00Z",
        "completedAt": "2023-01-02T00:00:00Z"
      },
      ...
    ],
    "total": 10
  },
  "error": null
}

7.3 发起结算

请求

  • 方法POST
  • 路径:/finance/settlements
  • 内容类型application/json
  • 请求体:
{
  "amount": 5000.00,
  "method": "BANK_TRANSFER"
}

响应

{
  "success": true,
  "data": {
    "settlementId": "1"
  },
  "error": null
}

8. 店铺接口

8.1 获取店铺列表

请求

  • 方法GET
  • 路径:/shops
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • platform平台筛选
    • status状态筛选

响应

{
  "success": true,
  "data": {
    "shops": [
      {
        "id": "1",
        "name": "Shop 1",
        "platform": "Amazon",
        "status": "ACTIVE",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 10
  },
  "error": null
}

8.2 获取店铺详情

请求

  • 方法GET
  • 路径:/shops/{id}

响应

{
  "success": true,
  "data": {
    "id": "1",
    "name": "Shop 1",
    "platform": "Amazon",
    "status": "ACTIVE",
    "createdAt": "2023-01-01T00:00:00Z",
    "updatedAt": "2023-01-01T00:00:00Z",
    "config": {
      "apiKey": "api_key",
      "apiSecret": "api_secret"
    }
  },
  "error": null
}

8.3 添加店铺

请求

  • 方法POST
  • 路径:/shops
  • 内容类型application/json
  • 请求体:
{
  "name": "Shop 1",
  "platform": "Amazon",
  "config": {
    "apiKey": "api_key",
    "apiSecret": "api_secret"
  }
}

响应

{
  "success": true,
  "data": {
    "shopId": "1"
  },
  "error": null
}

8.4 更新店铺

请求

  • 方法PUT
  • 路径:/shops/{id}
  • 内容类型application/json
  • 请求体:
{
  "name": "Shop 1 Updated",
  "config": {
    "apiKey": "new_api_key",
    "apiSecret": "new_api_secret"
  }
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

8.5 删除店铺

请求

  • 方法DELETE
  • 路径:/shops/{id}

响应

{
  "success": true,
  "data": null,
  "error": null
}

9. 部门接口

9.1 获取部门列表

请求

  • 方法GET
  • 路径:/departments

响应

{
  "success": true,
  "data": {
    "departments": [
      {
        "id": "1",
        "name": "Department 1",
        "parentId": null,
        "userCount": 10
      },
      ...
    ]
  },
  "error": null
}

9.2 获取部门详情

请求

  • 方法GET
  • 路径:/departments/{id}

响应

{
  "success": true,
  "data": {
    "id": "1",
    "name": "Department 1",
    "parentId": null,
    "userCount": 10,
    "createdAt": "2023-01-01T00:00:00Z",
    "updatedAt": "2023-01-01T00:00:00Z"
  },
  "error": null
}

9.3 创建部门

请求

  • 方法POST
  • 路径:/departments
  • 内容类型application/json
  • 请求体:
{
  "name": "Department 1",
  "parentId": null,
  "description": "Department description"
}

响应

{
  "success": true,
  "data": {
    "departmentId": "1"
  },
  "error": null
}

9.4 更新部门

请求

  • 方法PUT
  • 路径:/departments/{id}
  • 内容类型application/json
  • 请求体:
{
  "name": "Department 1 Updated",
  "parentId": "2",
  "description": "Updated department description"
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

9.5 删除部门

请求

  • 方法DELETE
  • 路径:/departments/{id}

响应

{
  "success": true,
  "data": null,
  "error": null
}

9.6 设置部门负责人

请求

  • 方法PUT
  • 路径:/departments/{id}/manager
  • 内容类型application/json
  • 请求体:
{
  "userId": "1"
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

10. 订阅接口

10.1 获取套餐列表

请求

  • 方法GET
  • 路径:/subscriptions/plans

响应

{
  "success": true,
  "data": {
    "plans": [
      {
        "id": "1",
        "name": "Free",
        "price": 0,
        "features": ["5 shops", "100 products"]
      },
      {
        "id": "2",
        "name": "Basic",
        "price": 99,
        "features": ["20 shops", "1000 products"]
      },
      ...
    ]
  },
  "error": null
}

10.2 获取当前订阅

请求

  • 方法GET
  • 路径:/subscriptions/current

响应

{
  "success": true,
  "data": {
    "subscription": {
      "id": "1",
      "planId": "2",
      "planName": "Basic",
      "startDate": "2023-01-01T00:00:00Z",
      "endDate": "2023-02-01T00:00:00Z",
      "status": "ACTIVE"
    }
  },
  "error": null
}

10.3 切换套餐

请求

  • 方法POST
  • 路径:/subscriptions/switch
  • 内容类型application/json
  • 请求体:
{
  "planId": "3"
}

响应

{
  "success": true,
  "data": {
    "subscriptionId": "2"
  },
  "error": null
}

10.4 获取使用量统计

请求

  • 方法GET
  • 路径:/subscriptions/usage
  • 查询参数:
    • startDate开始日期
    • endDate结束日期

响应

{
  "success": true,
  "data": {
    "usage": {
      "aiCalls": 100,
      "shops": 5,
      "storage": 1024,
      "apiCalls": 1000
    }
  },
  "error": null
}

11. 数据接口

11.1 导出数据

请求

  • 方法GET
  • 路径:/data/export
  • 查询参数:
    • type数据类型users, products, orders, etc.
    • format导出格式csv, excel
    • startDate开始日期
    • endDate结束日期

响应

  • 类型:文件下载

11.2 导入数据

请求

  • 方法POST
  • 路径:/data/import
  • 内容类型multipart/form-data
  • 请求体:
    • file数据文件
    • type数据类型users, products, orders, etc.

响应

{
  "success": true,
  "data": {
    "importedCount": 100,
    "failedCount": 0
  },
  "error": null
}

12. 日志接口

12.1 获取操作日志

请求

  • 方法GET
  • 路径:/logs/operations
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • user操作人
    • action操作类型
    • startDate开始日期
    • endDate结束日期

响应

{
  "success": true,
  "data": {
    "logs": [
      {
        "id": "1",
        "userId": "1",
        "username": "user1",
        "action": "CREATE_USER",
        "details": "Created user user2",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

12.2 获取登录日志

请求

  • 方法GET
  • 路径:/logs/logins
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • user用户
    • ipIP地址
    • startDate开始日期
    • endDate结束日期

响应

{
  "success": true,
  "data": {
    "logs": [
      {
        "id": "1",
        "userId": "1",
        "username": "user1",
        "ip": "192.168.1.1",
        "status": "SUCCESS",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

12.3 获取异常日志

请求

  • 方法GET
  • 路径:/logs/exceptions
  • 查询参数:
    • page页码默认1
    • pageSize每页数量默认10
    • type异常类型
    • startDate开始日期
    • endDate结束日期

响应

{
  "success": true,
  "data": {
    "logs": [
      {
        "id": "1",
        "type": "API_ERROR",
        "message": "Invalid API key",
        "stack": "Error: Invalid API key\n    at ...",
        "createdAt": "2023-01-01T00:00:00Z"
      },
      ...
    ],
    "total": 100
  },
  "error": null
}

13. 系统接口

13.1 获取系统信息

请求

  • 方法GET
  • 路径:/system/info

响应

{
  "success": true,
  "data": {
    "system": {
      "version": "1.0.0",
      "status": "RUNNING",
      "uptime": "7 days 12 hours 34 minutes"
    }
  },
  "error": null
}

13.2 获取系统配置

请求

  • 方法GET
  • 路径:/system/config

响应

{
  "success": true,
  "data": {
    "config": {
      "systemName": "Crawlful Hub",
      "timezone": "UTC",
      "language": "en"
    }
  },
  "error": null
}

13.3 更新系统配置

请求

  • 方法PUT
  • 路径:/system/config
  • 内容类型application/json
  • 请求体:
{
  "systemName": "Crawlful Hub",
  "timezone": "UTC",
  "language": "en"
}

响应

{
  "success": true,
  "data": {
    "success": true
  },
  "error": null
}

15. 店铺管理接口

15.1 获取我的店铺列表

请求

  • 方法GET
  • 路径:/api/shops/my-shops
  • 认证:需要登录

响应

{
  "success": true,
  "data": [
    {
      "id": "shop_1",
      "tenantId": "tenant_1",
      "name": "TikTok店铺A",
      "platform": "TIKTOK",
      "platformAccountId": "account_1",
      "departmentId": "dept_1_1",
      "status": "ACTIVE",
      "lastSyncAt": "2026-03-29T10:00:00Z",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-29T10:00:00Z"
    }
  ],
  "error": null
}

15.2 获取店铺详情

请求

  • 方法GET
  • 路径:/api/shops/:id
  • 认证:需要店铺成员权限

响应

{
  "success": true,
  "data": {
    "id": "shop_1",
    "tenantId": "tenant_1",
    "name": "TikTok店铺A",
    "platform": "TIKTOK",
    "platformAccountId": "account_1",
    "departmentId": "dept_1_1",
    "status": "ACTIVE",
    "config": {},
    "lastSyncAt": "2026-03-29T10:00:00Z",
    "createdAt": "2026-01-01T00:00:00Z",
    "updatedAt": "2026-03-29T10:00:00Z"
  },
  "error": null
}

15.3 创建店铺

请求

  • 方法POST
  • 路径:/api/shops
  • 认证:需要店铺拥有者权限
  • 内容类型application/json
  • 请求体:
{
  "name": "TikTok店铺A",
  "platform": "TIKTOK",
  "platformAccountId": "account_1",
  "departmentId": "dept_1_1",
  "config": {}
}

响应

{
  "success": true,
  "data": {
    "id": "shop_1",
    "name": "TikTok店铺A",
    "platform": "TIKTOK",
    "status": "INACTIVE",
    "createdAt": "2026-03-29T10:00:00Z"
  },
  "error": null
}

15.4 更新店铺信息

请求

  • 方法PUT
  • 路径:/api/shops/:id
  • 认证:需要店铺拥有者权限
  • 内容类型application/json
  • 请求体:
{
  "name": "TikTok店铺A更新",
  "departmentId": "dept_1_2"
}

响应

{
  "success": true,
  "data": {
    "id": "shop_1",
    "name": "TikTok店铺A更新",
    "platform": "TIKTOK",
    "status": "ACTIVE",
    "updatedAt": "2026-03-29T10:30:00Z"
  },
  "error": null
}

15.5 刷新店铺授权

请求

  • 方法POST
  • 路径:/api/shops/:id/refresh-auth
  • 认证:需要店铺拥有者权限

响应

{
  "success": true,
  "data": {
    "success": true,
    "message": "授权已刷新"
  },
  "error": null
}

15.6 删除店铺

请求

  • 方法DELETE
  • 路径:/api/shops/:id
  • 认证:需要店铺拥有者权限

响应

{
  "success": true,
  "data": null,
  "error": null
}

15.7 获取店铺成员列表

请求

  • 方法GET
  • 路径:/api/shops/:shopId/members
  • 认证:需要店铺成员权限

响应

{
  "success": true,
  "data": [
    {
      "id": "member_1",
      "shopId": "shop_1",
      "userId": "user_1",
      "userName": "李主管",
      "userEmail": "manager@crawlful.com",
      "role": "admin",
      "permissions": ["product:read", "product:write", "order:read"],
      "assignedBy": "user_admin",
      "assignedAt": "2026-03-20T10:00:00Z",
      "createdAt": "2026-03-20T10:00:00Z",
      "updatedAt": "2026-03-20T10:00:00Z"
    }
  ],
  "error": null
}

15.8 获取用户拥有的店铺

请求

  • 方法GET
  • 路径:/api/shops/user/:userId/shops
  • 认证:需要管理员权限或用户本人

响应

{
  "success": true,
  "data": [
    {
      "id": "member_1",
      "shopId": "shop_1",
      "userId": "user_1",
      "role": "admin",
      "permissions": ["product:read", "product:write"],
      "assignedAt": "2026-03-20T10:00:00Z"
    }
  ],
  "error": null
}

15.9 添加店铺成员

请求

  • 方法POST
  • 路径:/api/shop-members
  • 认证:需要店铺拥有者权限
  • 内容类型application/json
  • 请求体:
{
  "shopId": "shop_1",
  "userId": "user_2",
  "role": "operator",
  "permissions": ["product:read", "product:write", "order:read"],
  "assignedBy": "user_1"
}

响应

{
  "success": true,
  "data": {
    "id": "member_2",
    "shopId": "shop_1",
    "userId": "user_2",
    "role": "operator",
    "permissions": ["product:read", "product:write", "order:read"],
    "assignedBy": "user_1",
    "assignedAt": "2026-03-29T11:00:00Z",
    "createdAt": "2026-03-29T11:00:00Z"
  },
  "error": null
}

15.10 移除店铺成员

请求

  • 方法DELETE
  • 路径:/api/shop-members/:shopId/:userId
  • 认证:需要店铺拥有者权限

响应

{
  "success": true,
  "data": null,
  "error": null
}

15.11 更新成员角色和权限

请求

  • 方法PUT
  • 路径:/api/shop-members/:shopId/:userId
  • 认证:需要店铺拥有者权限
  • 内容类型application/json
  • 请求体:
{
  "role": "admin",
  "permissions": ["product:read", "product:write", "product:delete", "order:read", "order:write"]
}

响应

{
  "success": true,
  "data": {
    "id": "member_1",
    "shopId": "shop_1",
    "userId": "user_1",
    "role": "admin",
    "permissions": ["product:read", "product:write", "product:delete", "order:read", "order:write"],
    "updatedAt": "2026-03-29T11:30:00Z"
  },
  "error": null
}

15.12 获取店铺统计信息

请求

  • 方法GET
  • 路径:/api/shops/stats
  • 认证:需要登录

响应

{
  "success": true,
  "data": {
    "total": 10,
    "active": 8,
    "inactive": 1,
    "expired": 1,
    "error": 0
  },
  "error": null
}

16. 集成与扩展接口

16.1 SSO集成

请求

  • 方法GET
  • 路径:/integrations/sso/login
  • 查询参数:
    • provider身份提供商google, microsoft, etc.
    • redirect_uri回调地址

响应

  • 类型:重定向到身份提供商登录页面

16.2 LDAP/AD集成

请求

  • 方法POST
  • 路径:/integrations/ldap/test
  • 内容类型application/json
  • 请求体:
{
  "url": "ldap://example.com",
  "bindDn": "cn=admin,dc=example,dc=com",
  "bindPassword": "password",
  "baseDn": "ou=users,dc=example,dc=com"
}

响应

{
  "success": true,
  "data": {
    "connected": true,
    "userCount": 100
  },
  "error": null
}

16.3 Webhook管理

请求

  • 方法POST
  • 路径:/webhooks
  • 内容类型application/json
  • 请求体:
{
  "url": "https://example.com/webhook",
  "events": ["user.created", "user.updated", "tenant.created"],
  "secret": "secret_key"
}

响应

{
  "success": true,
  "data": {
    "webhookId": "1"
  },
  "error": null
}

本文档会定期更新以反映系统的最新API接口。