mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:24:17 +00:00
perf: AI机器人支持多会话
This commit is contained in:
parent
0272933f70
commit
da0fa31181
@ -489,8 +489,6 @@ class DialogController extends AbstractController
|
|||||||
* @apiName msg__list
|
* @apiName msg__list
|
||||||
*
|
*
|
||||||
* @apiParam {Number} dialog_id 对话ID
|
* @apiParam {Number} dialog_id 对话ID
|
||||||
* @apiParam {Number} [session_id] 会话ID
|
|
||||||
* - 此参数目前仅和AI的对话有效,AI对话支持新建对话,此参数为会话ID
|
|
||||||
* @apiParam {Number} [msg_id] 消息ID
|
* @apiParam {Number} [msg_id] 消息ID
|
||||||
* @apiParam {Number} [position_id] 此消息ID前后的数据
|
* @apiParam {Number} [position_id] 此消息ID前后的数据
|
||||||
* @apiParam {Number} [prev_id] 此消息ID之前的数据
|
* @apiParam {Number} [prev_id] 此消息ID之前的数据
|
||||||
@ -516,7 +514,6 @@ class DialogController extends AbstractController
|
|||||||
$user = User::auth();
|
$user = User::auth();
|
||||||
//
|
//
|
||||||
$dialog_id = intval(Request::input('dialog_id'));
|
$dialog_id = intval(Request::input('dialog_id'));
|
||||||
$session_id = intval(Request::input('session_id'));
|
|
||||||
$msg_id = intval(Request::input('msg_id'));
|
$msg_id = intval(Request::input('msg_id'));
|
||||||
$position_id = intval(Request::input('position_id'));
|
$position_id = intval(Request::input('position_id'));
|
||||||
$prev_id = intval(Request::input('prev_id'));
|
$prev_id = intval(Request::input('prev_id'));
|
||||||
@ -539,9 +536,7 @@ class DialogController extends AbstractController
|
|||||||
->on('read.msg_id', '=', 'web_socket_dialog_msgs.id');
|
->on('read.msg_id', '=', 'web_socket_dialog_msgs.id');
|
||||||
})->where('web_socket_dialog_msgs.dialog_id', $dialog_id);
|
})->where('web_socket_dialog_msgs.dialog_id', $dialog_id);
|
||||||
//
|
//
|
||||||
if ($session_id > 0) {
|
if ($dialog->session_id > 0) {
|
||||||
$builder->whereSessionId($session_id);
|
|
||||||
} elseif ($dialog->session_id > 0) {
|
|
||||||
$builder->whereSessionId($dialog->session_id);
|
$builder->whereSessionId($dialog->session_id);
|
||||||
}
|
}
|
||||||
if ($msg_type) {
|
if ($msg_type) {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $type 对话类型
|
* @property string|null $type 对话类型
|
||||||
* @property string|null $group_type 聊天室类型
|
* @property string|null $group_type 聊天室类型
|
||||||
* @property int|null $session_id 会话ID(最新)
|
* @property int|null $session_id 会话ID
|
||||||
* @property string|null $name 对话名称
|
* @property string|null $name 对话名称
|
||||||
* @property string $avatar 头像(群)
|
* @property string $avatar 头像(群)
|
||||||
* @property int|null $owner_id 群主用户ID
|
* @property int|null $owner_id 群主用户ID
|
||||||
|
|||||||
@ -1181,6 +1181,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$dialogMsg = self::createInstance([
|
$dialogMsg = self::createInstance([
|
||||||
'dialog_id' => $dialog_id,
|
'dialog_id' => $dialog_id,
|
||||||
'dialog_type' => $dialog->type,
|
'dialog_type' => $dialog->type,
|
||||||
|
'session_id' => $dialog->session_id,
|
||||||
'reply_id' => $reply_id,
|
'reply_id' => $reply_id,
|
||||||
'forward_id' => $forward_id,
|
'forward_id' => $forward_id,
|
||||||
'userid' => $sender,
|
'userid' => $sender,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class WebSocketDialogsAddSessionId extends Migration
|
|||||||
{
|
{
|
||||||
Schema::table('web_socket_dialogs', function (Blueprint $table) {
|
Schema::table('web_socket_dialogs', function (Blueprint $table) {
|
||||||
if (!Schema::hasColumn('web_socket_dialogs', 'session_id')) {
|
if (!Schema::hasColumn('web_socket_dialogs', 'session_id')) {
|
||||||
$table->bigInteger('session_id')->index()->nullable()->default(0)->after('group_type')->comment('会话ID(最新)');
|
$table->bigInteger('session_id')->index()->nullable()->default(0)->after('group_type')->comment('会话ID');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user