diff --git a/app/Constants/TalkMessageType.php b/app/Constants/TalkMessageType.php index 7c5cd29..e02a5ba 100644 --- a/app/Constants/TalkMessageType.php +++ b/app/Constants/TalkMessageType.php @@ -10,16 +10,17 @@ namespace App\Constants; */ class TalkMessageType { - const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息 - const TEXT_MESSAGE = 1; //文本消息 - const FILE_MESSAGE = 2; //文件消息 - const FORWARD_MESSAGE = 3; //会话消息 - const CODE_MESSAGE = 4; //代码消息 - const VOTE_MESSAGE = 5; //投票消息 - const GROUP_NOTICE_MESSAGE = 6; //群组公告 - const FRIEND_APPLY_MESSAGE = 7; //好友申请 - const USER_LOGIN_MESSAGE = 8; //登录通知 - const GROUP_INVITE_MESSAGE = 9; //入群退群消息 + const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息 + const TEXT_MESSAGE = 1; //文本消息 + const FILE_MESSAGE = 2; //文件消息 + const FORWARD_MESSAGE = 3; //会话消息 + const CODE_MESSAGE = 4; //代码消息 + const VOTE_MESSAGE = 5; //投票消息 + const GROUP_NOTICE_MESSAGE = 6; //群组公告 + const FRIEND_APPLY_MESSAGE = 7; //好友申请 + const USER_LOGIN_MESSAGE = 8; //登录通知 + const GROUP_INVITE_MESSAGE = 9; //入群退群消息 + const LOCATION_MESSAGE = 10; //位置消息(预留) /** * 获取可转发的消息类型列表 diff --git a/migrations/2021_10_31_212234_create_talk_records_location.php b/migrations/2021_10_31_212234_create_talk_records_location.php new file mode 100644 index 0000000..b0dad26 --- /dev/null +++ b/migrations/2021_10_31_212234_create_talk_records_location.php @@ -0,0 +1,40 @@ +unsignedInteger('id', true)->comment('自增ID'); + $table->unsignedInteger('record_id')->default(0)->comment('消息记录ID'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->decimal('longitude', 11, 6)->default('0.000000')->comment('经度'); + $table->decimal('latitude', 11, 6)->default('0.000000')->comment('纬度'); + $table->dateTime('created_at')->nullable(true)->comment('创建时间'); + + $table->charset = 'utf8'; + $table->collation = 'utf8_general_ci'; + $table->engine = 'InnoDB'; + + $table->unique(['record_id'], 'uk_record_id'); + $table->index(['user_id'], 'idx_user_id'); + + $table->comment('聊天对话记录(位置消息)'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('talk_records_location'); + } +}