AIGEO 内容生成平台 API 接口文档
本文档为 Vue3 前端开发工程师提供完整的 API 接口说明,包括接口地址、请求方法、参数说明和返回结果等。
1. 认证相关接口
1.1 用户登录
接口地址: POST /api/auth/login
接口说明: 用户登录认证
请求参数:
{
"username": "string", // 用户名或邮箱
"password": "string" // 密码
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"token": "string", // 访问令牌
"refreshToken": "string", // 刷新令牌
"expiresIn": 0, // 过期时间(秒)
"user": {
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string"
}
}
}
1.2 用户注册
接口地址: POST /api/auth/register
接口说明: 新用户注册
请求参数:
{
"username": "string", // 用户名
"email": "string", // 邮箱
"password": "string", // 密码
"fullName": "string" // 姓名
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0
}
}
1.3 刷新令牌
接口地址: POST /api/auth/refresh
接口说明: 使用刷新令牌获取新的访问令牌
请求参数:
{
"refreshToken": "string"
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"token": "string",
"refreshToken": "string",
"expiresIn": 0
}
}
2. 用户管理接口
2.1 分页查询用户列表
接口地址: GET /api/users/list
接口说明: 支持按用户名、邮箱、角色等条件分页查询用户列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) | | sortBy | string | 否 | 排序字段 | | sortDir | string | 否 | 排序方向(asc/desc) | | username | string | 否 | 用户名筛选 | | email | string | 否 | 邮箱筛选 | | role | string | 否 | 角色筛选 |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
2.2 获取所有用户
接口地址: GET /api/users
接口说明: 获取所有用户列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
2.3 根据ID获取用户
接口地址: GET /api/users/{id}
接口说明: 根据用户ID获取用户详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
2.4 根据公司ID获取用户列表
接口地址: GET /api/users/company/{companyId}
接口说明: 根据公司ID获取用户列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
2.5 创建用户
接口地址: POST /api/users
接口说明: 创建新用户
请求参数:
{
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
2.6 更新用户
接口地址: PUT /api/users/{id}
接口说明: 根据用户ID更新用户信息
请求参数:
{
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"username": "string",
"email": "string",
"fullName": "string",
"role": "string",
"companyId": 0,
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
2.7 删除用户
接口地址: DELETE /api/users/{id}
接口说明: 根据用户ID删除用户
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
3. 公司管理接口
3.1 分页查询公司列表
接口地址: GET /api/companies/list
接口说明: 支持按公司名称、状态等条件分页查询公司列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) | | sortBy | string | 否 | 排序字段 | | sortDir | string | 否 | 排序方向(asc/desc) | | name | string | 否 | 公司名称筛选 | | status | string | 否 | 状态筛选 |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {},
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
3.2 获取所有公司
接口地址: GET /api/companies
接口说明: 获取所有公司列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {},
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
3.3 根据ID获取公司
接口地址: GET /api/companies/{id}
接口说明: 根据公司ID获取公司详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {},
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
3.4 创建公司
接口地址: POST /api/companies
接口说明: 创建新公司
请求参数:
{
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {}
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {},
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
3.5 更新公司
接口地址: PUT /api/companies/{id}
接口说明: 根据公司ID更新公司信息
请求参数:
{
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {}
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"subdomain": "string",
"planType": "string",
"maxUsers": 0,
"maxArticlesPerMonth": 0,
"status": "string",
"trialExpiryDate": "2023-01-01T00:00:00",
"defaultSettings": {},
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
3.6 删除公司
接口地址: DELETE /api/companies/{id}
接口说明: 根据公司ID删除公司
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
4. AI配置管理接口
4.1 获取所有AI配置
接口地址: GET /api/ai-configs
接口说明: 获取所有AI配置列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
4.2 分页查询AI配置
接口地址: GET /api/ai-configs/list
接口说明: 分页查询AI配置列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
4.3 根据ID获取AI配置
接口地址: GET /api/ai-configs/{id}
接口说明: 根据配置ID获取AI配置详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
4.4 根据公司ID获取AI配置
接口地址: GET /api/ai-configs/company/{companyId}
接口说明: 根据公司ID获取AI配置列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
4.5 获取共享的AI配置
接口地址: GET /api/ai-configs/shared
接口说明: 获取共享的AI配置列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
4.6 获取激活的AI配置
接口地址: GET /api/ai-configs/active
接口说明: 获取激活的AI配置列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
4.7 创建AI配置
接口地址: POST /api/ai-configs
接口说明: 创建新的AI配置
请求参数:
{
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
4.8 更新AI配置
接口地址: PUT /api/ai-configs/{id}
接口说明: 根据配置ID更新AI配置
请求参数:
{
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"provider": "string",
"name": "string",
"baseUrl": "string",
"apiKey": "string",
"modelName": "string",
"temperature": 0,
"topP": 0,
"maxTokens": 0,
"requestHeaders": {},
"isActive": true,
"isShared": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
4.9 删除AI配置
接口地址: DELETE /api/ai-configs/{id}
接口说明: 根据配置ID删除AI配置
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
5. 文章生成任务管理接口
5.1 分页查询文章生成任务列表
接口地址: GET /api/article-tasks/list
接口说明: 支持按任务状态、用户、公司等条件分页查询文章生成任务列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) | | sortBy | string | 否 | 排序字段 | | sortDir | string | 否 | 排序方向(asc/desc) | | status | string | 否 | 任务状态筛选 | | userId | integer | 否 | 用户ID筛选 | | companyId | integer | 否 | 公司ID筛选 |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"title": "string",
"description": "string",
"keywords": "string",
"aiTasteLevel": "string",
"status": "string",
"referenceUrls": [],
"generatedContent": "string",
"errorMessage": "string",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00",
"scheduledAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
6. 关键词管理接口
6.1 分页查询关键词列表
接口地址: GET /api/keywords/list
接口说明: 支持按关键词、状态、公司等条件分页查询关键词列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) | | sortBy | string | 否 | 排序字段 | | sortDir | string | 否 | 排序方向(asc/desc) | | keyword | string | 否 | 关键词筛选 | | status | string | 否 | 状态筛选 | | companyId | integer | 否 | 公司ID筛选 |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
6.2 获取所有关键词
接口地址: GET /api/keywords
接口说明: 获取所有关键词列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
6.3 根据ID获取关键词
接口地址: GET /api/keywords/{id}
接口说明: 根据关键词ID获取关键词详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
6.4 根据公司ID获取关键词列表
接口地址: GET /api/keywords/company/{companyId}
接口说明: 根据公司ID获取关键词列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
6.5 根据公司ID和状态获取关键词列表
接口地址: GET /api/keywords/company/{companyId}/status/{status}
接口说明: 根据公司ID和状态获取关键词列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
6.6 创建关键词
接口地址: POST /api/keywords
接口说明: 创建新的关键词
请求参数:
{
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
6.7 更新关键词
接口地址: PUT /api/keywords/{id}
接口说明: 根据关键词ID更新关键词信息
请求参数:
{
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"keyword": "string",
"searchVolume": 0,
"competition": "string",
"status": "string",
"source": "string",
"sourceTaskId": 0,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
6.8 删除关键词
接口地址: DELETE /api/keywords/{id}
接口说明: 根据关键词ID删除关键词
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
7. 话题管理接口
7.1 获取所有话题
接口地址: GET /api/topics
接口说明: 获取所有话题列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
7.2 根据ID获取话题
接口地址: GET /api/topics/{id}
接口说明: 根据话题ID获取话题详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
7.3 根据公司ID获取话题列表
接口地址: GET /api/topics/company/{companyId}
接口说明: 根据公司ID获取话题列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
7.4 根据公司ID和状态获取话题列表
接口地址: GET /api/topics/company/{companyId}/status/{status}
接口说明: 根据公司ID和状态获取话题列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
7.5 根据来源任务ID获取话题列表
接口地址: GET /api/topics/source-task/{sourceTaskId}
接口说明: 根据来源任务ID获取话题列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
7.6 创建话题
接口地址: POST /api/topics
接口说明: 创建新话题
请求参数:
{
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": []
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
7.7 更新话题
接口地址: PUT /api/topics/{id}
接口说明: 根据话题ID更新话题信息
请求参数:
{
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": []
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"title": "string",
"description": "string",
"sourceUrl": "string",
"status": "string",
"sourceTaskId": 0,
"keywords": [],
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
7.8 删除话题
接口地址: DELETE /api/topics/{id}
接口说明: 根据话题ID删除话题
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
8. 发布平台管理接口
8.1 分页查询发布平台列表
接口地址: GET /api/platforms/list
接口说明: 支持按平台名称、类型、状态等条件分页查询发布平台列表
请求参数: | 参数名 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | page | integer | 否 | 页码(默认0) | | size | integer | 否 | 每页大小(默认10) | | sortBy | string | 否 | 排序字段 | | sortDir | string | 否 | 排序方向(asc/desc) | | name | string | 否 | 平台名称筛选 | | type | string | 否 | 平台类型筛选 | | status | string | 否 | 状态筛选 |
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"content": [
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
],
"pageable": {
"pageNumber": 0,
"pageSize": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"paged": true,
"unpaged": false
},
"totalElements": 0,
"totalPages": 0,
"last": true,
"size": 10,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"first": true,
"numberOfElements": 0,
"empty": false
}
}
8.2 获取所有发布平台
接口地址: GET /api/platforms
接口说明: 获取所有发布平台列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
8.3 根据ID获取发布平台
接口地址: GET /api/platforms/{id}
接口说明: 根据发布平台ID获取平台详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
8.4 根据类型ID获取发布平台列表
接口地址: GET /api/platforms/type/{typeId}
接口说明: 根据类型ID获取发布平台列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
8.5 获取激活的发布平台列表
接口地址: GET /api/platforms/active
接口说明: 获取激活的发布平台列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
8.6 根据类型ID获取激活的发布平台列表
接口地址: GET /api/platforms/type/{typeId}/active
接口说明: 根据类型ID获取激活的发布平台列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
8.7 根据编码获取发布平台
接口地址: GET /api/platforms/code/{code}
接口说明: 根据编码获取发布平台
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
8.8 创建发布平台
接口地址: POST /api/platforms
接口说明: 创建新的发布平台
请求参数:
{
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
8.9 更新发布平台
接口地址: PUT /api/platforms/{id}
接口说明: 根据发布平台ID更新平台信息
请求参数:
{
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"description": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
8.10 删除发布平台
接口地址: DELETE /api/platforms/{id}
接口说明: 根据发布平台ID删除平台
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
9. 网站项目管理接口
9.1 获取所有网站项目
接口地址: GET /api/website-projects
接口说明: 获取所有网站项目列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
9.2 根据ID获取网站项目
接口地址: GET /api/website-projects/{id}
接口说明: 根据网站项目ID获取项目详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
9.3 根据公司ID获取网站项目列表
接口地址: GET /api/website-projects/company/{companyId}
接口说明: 根据公司ID获取网站项目列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
9.4 根据用户ID获取网站项目列表
接口地址: GET /api/website-projects/user/{userId}
接口说明: 根据用户ID获取网站项目列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
9.5 根据状态获取网站项目列表
接口地址: GET /api/website-projects/status/{status}
接口说明: 根据状态获取网站项目列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
9.6 根据公司ID和状态获取网站项目列表
接口地址: GET /api/website-projects/company/{companyId}/status/{status}
接口说明: 根据公司ID和状态获取网站项目列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
9.7 创建网站项目
接口地址: POST /api/website-projects
接口说明: 创建新的网站项目
请求参数:
{
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string"
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
9.8 更新网站项目
接口地址: PUT /api/website-projects/{id}
接口说明: 根据网站项目ID更新项目信息
请求参数:
{
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string"
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"companyId": 0,
"userId": 0,
"name": "string",
"domain": "string",
"subdomain": "string",
"status": "string",
"templateId": 0,
"seoSettings": {},
"analyticsCode": "string",
"customCss": "string",
"customJs": "string",
"deployedAt": "2023-01-01T00:00:00",
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
9.9 删除网站项目
接口地址: DELETE /api/website-projects/{id}
接口说明: 根据网站项目ID删除项目
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
10. 落地页模板管理接口
10.1 获取所有落地页模板
接口地址: GET /api/landing-page-templates
接口说明: 获取所有落地页模板列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
10.2 根据ID获取落地页模板
接口地址: GET /api/landing-page-templates/{id}
接口说明: 根据落地页模板ID获取模板详情
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
10.3 获取激活的落地页模板列表
接口地址: GET /api/landing-page-templates/active
接口说明: 获取激活的落地页模板列表
响应结果:
{
"code": 200,
"message": "操作成功",
"data": [
{
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
]
}
10.4 根据编码获取落地页模板
接口地址: GET /api/landing-page-templates/code/{code}
接口说明: 根据编码获取落地页模板
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
10.5 创建落地页模板
接口地址: POST /api/landing-page-templates
接口说明: 创建新的落地页模板
请求参数:
{
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
10.6 更新落地页模板
接口地址: PUT /api/landing-page-templates/{id}
接口说明: 根据落地页模板ID更新模板信息
请求参数:
{
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true
}
响应结果:
{
"code": 200,
"message": "操作成功",
"data": {
"id": 0,
"name": "string",
"code": "string",
"description": "string",
"previewImageUrl": "string",
"htmlTemplate": "string",
"cssStyles": "string",
"jsScripts": "string",
"configSchema": {},
"isActive": true,
"createdAt": "2023-01-01T00:00:00",
"updatedAt": "2023-01-01T00:00:00"
}
}
10.7 删除落地页模板
接口地址: DELETE /api/landing-page-templates/{id}
接口说明: 根据落地页模板ID删除模板
响应结果:
{
"code": 200,
"message": "操作成功",
"data": null
}
通用响应格式
所有API接口都使用统一的响应格式:
{
"code": 200, // 状态码
"message": "操作成功", // 消息说明
"data": {} // 返回数据
}
常用状态码
状态码 | 说明 |
---|---|
200 | 操作成功 |
400 | 请求参数错误 |
401 | 未授权访问 |
403 | 禁止访问 |
404 | 资源未找到 |
500 | 系统内部错误 |
认证方式
除登录、注册等开放接口外,其他接口都需要在请求头中添加认证信息:
Authorization: Bearer {token}
X-Tenant-ID: {tenantId}
其中:
-
{token}
为登录成功后返回的访问令牌 -
{tenantId}
为租户ID,用于多租户数据隔离
业务概述 Company模块负责管理系统中的公司(租户)信息,是整个多租户架构的核心。每个公司作为一个独立的租户,拥有自己的用户、配置和数据。 处理的具体业务 公司信息管理:创建、查询、更新、删除公司信息 多租户支持:通过子域名识别不同公司 套餐管理:支持不同的套餐类型和配额限制 状态管理:管理公司的试用、激活、暂停等状态 搜索功能:支持按关键词搜索公司 数据表字段 操作的数据表是 ai_companies,包含以下字段: 字段名 类型 说明 id Integer 主键,自增ID name String 公司名称 subdomain String 子域名,唯一标识 plan_type PlanType枚举 套餐类型(FREE/TRIAL/BASIC/PREMIUM/ENTERPRISE) max_users Integer 最大用户数 max_articles_per_month Integer 每月最大文章数 status CompanyStatus枚举 公司状态(TRIAL/ACTIVE/SUSPENDED) trial_expiry_date LocalDate 试用期到期日期 default_settings String (JSON) 默认配置(JSON格式) created_at LocalDateTime 创建时间 updated_at LocalDateTime 更新时间 操作的数据表 主表:ai_companies - 存储公司基本信息 索引:在subdomain字段上建立了唯一索引uk_companies_subdomain 提供的API接口 GET /api/companies/list - 分页查询公司列表 GET /api/companies - 获取所有公司 GET /api/companies/{id} - 根据ID查询公司详情 GET /api/companies/subdomain/{subdomain} - 根据子域名查询公司 GET /api/companies/active - 查询活跃公司列表 POST /api/companies - 创建新公司 PUT /api/companies/{id} - 更新公司信息 PUT /api/companies/batch-status - 批量更新公司状态 DELETE /api/companies/{id} - 删除公司(软删除) GET /api/companies/search - 搜索公司 这个模块是整个系统多租户架构的基础,所有其他业务模块都会关联到公司(租户)维度进行数据隔离。