1. 学校课程模块
SmartFlow-Agent
  • 用户模块
    • 注册
      POST
    • 登录
      POST
    • 刷新Token
      POST
    • 登出
      POST
  • 任务模块
    • 获取任务队列中的任务
      GET
    • 新增任务至任务队列
      POST
    • 标记任务为完成
      PUT
    • 取消任务已完成勾选
      PUT
    • 更新任务属性(部分更新)
      PUT
    • 删除任务(硬删除)
      DELETE
  • 日程模块
    • 今日日程一览
      GET
    • 正式应用日程
      PUT
    • 获取周总日程
      GET
    • 获取最近已完成任务列表
      GET
    • 撤回任务完成状态
      DELETE
    • 智能一键编排
      GET
    • 删除日程/解除安排
      DELETE
    • 获取当前正在进行的任务
      GET
    • 批量智能粗排
      POST
  • Agent模块
    • Memory
      • 列出当前用户的记忆
      • 新增一条记忆
      • 查看单条记忆详情
      • 修改一条记忆
      • 删除一条记忆
      • 恢复一条记忆
    • AI Agent&聊天
      POST
    • 查询会话元信息
      GET
    • 获取当前用户会话列表
      GET
    • 查询排程预览
      GET
    • 获取会话列表
      GET
    • 获取会话历史
      GET
    • 获取上下文窗口 token 分布统计
      GET
    • 暂存前端日程调整
      POST
  • 监控模块
    • 获取 Token 消耗监控
  • 任务类模块
    • 创建任务类
    • 获取任务类列表
    • 修改任务类
    • 获取完整任务类
    • 将任务块加入日程
    • 删除任务块
    • 删除任务类
  • 学校课程模块
    • 批量导入课程
      POST
    • 预检查新增课程合法性
      POST
  1. 学校课程模块

批量导入课程

POST
/course/import
用户在底部的“课程列表”确认无误后,点击右下角的“确认”按钮,一次性提交全量数据。
后端开启数据库事务,将整个学期的课表批量写入数据库,并关联当前 user_id。

请求参数

Header 参数

Body 参数application/json必填

示例
{
    "courses": [
        {
            "course_name": "数据结构A",
            "location": "2406",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 1,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 1,
                    "end_week": 15,
                    "day_of_week": 4,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "odd"
                }
            ]
        },
        {
            "course_name": "数字与逻辑电路基础",
            "location": "2106",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 12,
                    "day_of_week": 1,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                },
                {
                    "start_week": 1,
                    "end_week": 12,
                    "day_of_week": 4,
                    "start_section": 9,
                    "end_section": 10,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "概率论与数理统计",
            "location": "2217",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 7,
                    "end_section": 8,
                    "week_type": "all"
                },
                {
                    "start_week": 4,
                    "end_week": 16,
                    "day_of_week": 5,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "even"
                }
            ]
        },
        {
            "course_name": "面向对象程序设计-C++",
            "location": "2301",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 10,
                    "day_of_week": 2,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "all"
                },
                {
                    "start_week": 12,
                    "end_week": 17,
                    "day_of_week": 2,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "数据结构A (实验)",
            "location": "B505/B506",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 7,
                    "end_week": 14,
                    "day_of_week": 4,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "数字电路实验B",
            "location": "B209/B210",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 4,
                    "end_week": 4,
                    "day_of_week": 2,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                },
                {
                    "start_week": 6,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "生活中的法律",
            "location": "3302",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 9,
                    "end_section": 10,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "体育影视中的文化透视",
            "location": "3206",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 2,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 11,
                    "end_section": 12,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "离散数学",
            "location": "2406",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 2,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 4,
                    "end_week": 16,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 18,
                    "end_week": 18,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "习近平新时代中国特色社会主义思想概论",
            "location": "2415",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 3,
                    "start_section": 9,
                    "end_section": 11,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "毛泽东思想和中国特色社会主义理论体系概论",
            "location": "2308",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 4,
                    "start_section": 7,
                    "end_section": 8,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "面向对象程序设计-C++",
            "location": "C405/C406/C407",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 3,
                    "end_week": 9,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "odd"
                },
                {
                    "start_week": 13,
                    "end_week": 15,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "odd"
                },
                {
                    "start_week": 17,
                    "end_week": 18,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                }
            ]
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'http://test-cn.your-api-server.com/course/import' \
--header 'Authorization;' \
--header 'X-Idempotency-Key: {{$string.uuid}}' \
--header 'Content-Type: application/json' \
--data '{
    "courses": [
        {
            "course_name": "数据结构A",
            "location": "2406",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 1,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 1,
                    "end_week": 15,
                    "day_of_week": 4,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "odd"
                }
            ]
        },
        {
            "course_name": "数字与逻辑电路基础",
            "location": "2106",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 12,
                    "day_of_week": 1,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                },
                {
                    "start_week": 1,
                    "end_week": 12,
                    "day_of_week": 4,
                    "start_section": 9,
                    "end_section": 10,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "概率论与数理统计",
            "location": "2217",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 7,
                    "end_section": 8,
                    "week_type": "all"
                },
                {
                    "start_week": 4,
                    "end_week": 16,
                    "day_of_week": 5,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "even"
                }
            ]
        },
        {
            "course_name": "面向对象程序设计-C++",
            "location": "2301",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 10,
                    "day_of_week": 2,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "all"
                },
                {
                    "start_week": 12,
                    "end_week": 17,
                    "day_of_week": 2,
                    "start_section": 1,
                    "end_section": 2,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "数据结构A (实验)",
            "location": "B505/B506",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 7,
                    "end_week": 14,
                    "day_of_week": 4,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "数字电路实验B",
            "location": "B209/B210",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 4,
                    "end_week": 4,
                    "day_of_week": 2,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                },
                {
                    "start_week": 6,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "生活中的法律",
            "location": "3302",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 9,
                    "end_section": 10,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "体育影视中的文化透视",
            "location": "3206",
            "is_allow_tasks": true,
            "arrangements": [
                {
                    "start_week": 2,
                    "end_week": 16,
                    "day_of_week": 2,
                    "start_section": 11,
                    "end_section": 12,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "离散数学",
            "location": "2406",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 2,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 4,
                    "end_week": 16,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                },
                {
                    "start_week": 18,
                    "end_week": 18,
                    "day_of_week": 5,
                    "start_section": 3,
                    "end_section": 4,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "习近平新时代中国特色社会主义思想概论",
            "location": "2415",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 3,
                    "start_section": 9,
                    "end_section": 11,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "毛泽东思想和中国特色社会主义理论体系概论",
            "location": "2308",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 1,
                    "end_week": 16,
                    "day_of_week": 4,
                    "start_section": 7,
                    "end_section": 8,
                    "week_type": "all"
                }
            ]
        },
        {
            "course_name": "面向对象程序设计-C++",
            "location": "C405/C406/C407",
            "is_allow_tasks": false,
            "arrangements": [
                {
                    "start_week": 3,
                    "end_week": 9,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "odd"
                },
                {
                    "start_week": 13,
                    "end_week": 15,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "odd"
                },
                {
                    "start_week": 17,
                    "end_week": 18,
                    "day_of_week": 3,
                    "start_section": 5,
                    "end_section": 6,
                    "week_type": "all"
                }
            ]
        }
    ]
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code":200,
    "message":"success"
}
🟠400请求有误
🟠409冲突
修改于 2026-02-23 08:39:20
上一页
删除任务类
下一页
预检查新增课程合法性
Built with