params 作为输出参数时,根据任务的 type 值不同,其结构和含义也不同。type 有 1、2、3 三种不同的值,每种类型对应的 params 结构和其具体含义如下。type = 1 表示评论任务,此时 params 的结构包含以下字段:| 字段名称 | 类型 | 描述 |
|---|---|---|
robot_chats_id | uint64 | 机器人评论库的ID,表示该任务所关联的评论库。 |
repeat_times | int | 评论任务的重复次数,表示任务会执行评论的次数。 |
random_interval_start | int | 随机间隔开始时间(秒),表示评论任务之间的最小时间间隔。 |
random_interval_end | int | 随机间隔结束时间(秒),表示评论任务之间的最大时间间隔。 |
{
"id": 1,
"live_id": 1001,
"name": "评论任务",
"type": 1,
"params": {
"robot_chats_id": 123456789,
"repeat_times": 10,
"random_interval_start": 30,
"random_interval_end": 300
}
}type = 2 表示机器人对话任务,此时 params 的结构包含以下字段:| 字段名称 | 类型 | 描述 |
|---|---|---|
executed_on | uint64 | 对话任务执行的具体时间,单位为秒,表示一天内的时间。例如,32400 表示当天的 09:00(从 00:00 开始计时的总秒数)。 |
robot_id | uint64 | 机器人ID,表示执行该对话任务的机器人的唯一标识符。 |
content | string | 对话内容,表示机器人在任务中将要发送的文本消息。 |
{
"id": 2,
"live_id": 1002,
"name": "对话任务",
"type": 2,
"params": {
"executed_on": 32400,
"robot_id": 987654321,
"content": "欢迎来到直播间!"
}
}type = 3 表示机器人赠礼任务,此时 params 的结构包含以下字段:| 字段名称 | 类型 | 描述 |
|---|---|---|
repeat_times | int | 赠礼操作应重复的次数,表示赠送礼物的总次数。 |
random_interval_start | int | 随机间隔的开始时间(秒),表示每次赠礼操作之间的最小时间间隔。 |
random_interval_end | int | 随机间隔的结束时间(秒),表示每次赠礼操作之间的最大时间间隔。 |
{
"id": 3,
"live_id": 1003,
"name": "赠礼任务",
"type": 3,
"params": {
"repeat_times": 5,
"random_interval_start": 10,
"random_interval_end": 60
}
}{
"current": 1,
"page_size": 10,
"live_id": 0
}curl --location --request POST '/api/robot/task/list' \
--header 'Authorization: test' \
--header 'Content-Type: application/json' \
--data-raw '{
"current": 1,
"page_size": 10,
"live_id": 0
}'{
"list": [
{
"id": 0,
"name": "string",
"type": 0,
"params": {},
"created_at": "string"
}
],
"pagination": {
"total": 0,
"page_size": 0,
"current": 0
}
}