- 添加 `last_message_id` 字段至 `chat_sessions` 表,更新其关联索引 - 实现会话更新接口,支持修改名称与状态并添加验证逻辑 - 增加会话列表接口,支持状态过滤与关键字查询 - 提供会话和消息相关的资源类和请求验证类 - 扩展 `ChatService` 服务层逻辑以处理会话更新和消息附加 - 编写测试用例以验证新功能的正确性 - 增加接口文档及 OpenAPI 规范文件,覆盖新增功能 - 更新数据库播种器,添加默认用户
40 lines
929 B
PHP
40 lines
929 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
use WithoutModelEvents;
|
|
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
User::updateOrCreate(
|
|
['email' => 'root@example.com'],
|
|
[
|
|
'name' => 'root',
|
|
'password' => Hash::make('Root@123456'),
|
|
'is_active' => true,
|
|
'email_verified_at' => now(),
|
|
],
|
|
);
|
|
|
|
User::updateOrCreate(
|
|
['email' => 'guxinpei@qq.com'],
|
|
[
|
|
'name' => 'roog',
|
|
'password' => Hash::make('w2021976'),
|
|
'is_active' => true,
|
|
'email_verified_at' => now(),
|
|
],
|
|
);
|
|
}
|
|
}
|