Files
im-demo-server/app/Enum/MessageTypeEnum.php
2025-06-26 10:05:04 +08:00

35 lines
754 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Enum;
enum MessageTypeEnum: int
{
// 消息类型 0文本 1图片 2音频 3视频 4处方 5病例 6视频通话
case Text = 0;
case Image = 1;
case Audio = 2;
case Video = 3;
case Prescription = 4;
case Case = 5;
case VideoCall = 6;
/**
* @return string
*/
public function description(): string
{
return match ($this) {
self::Text => '文本',
self::Image => '图片',
self::Audio => '音频',
self::Video => '视频',
self::Prescription => '处方',
self::Case => '病例',
self::VideoCall => '视频通话',
default => '未知',
};
}
}