diff --git a/app/functions.php b/app/functions.php index 5c9c58d..c0c16fa 100644 --- a/app/functions.php +++ b/app/functions.php @@ -2,3 +2,25 @@ /** * Here is your custom functions. */ + +use support\exception\BusinessException; + +/** + * 获取配置 + */ +function getConfig($filePath = null) +{ + // 构建文件路径 + $config_file = app_path($filePath); + // 检查文件是否存在 + if (!file_exists($config_file)) { + return []; + } + // 包含文件并获取返回的数组 + $config = include $config_file; + // 验证是否为数组 + if (!is_array($config)) { + return []; + } + return $config; +} \ No newline at end of file diff --git a/app/queue/translation/config/trans.php b/app/queue/translation/config/trans.php new file mode 100644 index 0000000..73b55b1 --- /dev/null +++ b/app/queue/translation/config/trans.php @@ -0,0 +1,14 @@ + [ + 'ticket_categorie' => [ + 'translation_model' => \app\ticket\model\TicketCategorieTranslation::class, + 'foreign_key' => 'categorie_id', + ], + ], + + // 默认支持的目标语种列表 + 'locales' => ['zh','en','ru','ar'], +]; diff --git a/app/queue/translation/jobs/TranslationJob.php b/app/queue/translation/jobs/TranslationJob.php new file mode 100644 index 0000000..eb5e704 --- /dev/null +++ b/app/queue/translation/jobs/TranslationJob.php @@ -0,0 +1,64 @@ +config = getConfig('/queue/translation/config/trans.php'); + $this->payload = $payload; + } + + public function handle(): void + { + $cfgAll = $this->config['entities']; + $pt = $this->payload; + $type = $pt['entityType']; + $id = $pt['entityId']; + $locale = $pt['locale']; + $sourceLocale = $pt['sourceLocale']; + $sourceFields = $pt['sourceFields']; + $clientFields = $pt['clientFields']; + + if (! isset($cfgAll[$type])) { + Log::warning("TranslationJob: 未配置实体 {$type}"); + return; + } + + $cfg = $cfgAll[$type]; + $modelClass = $cfg['translation_model']; + $foreignKey = $cfg['foreign_key']; + + // 决定采用前端提供、源语种还是第三方翻译 + if (! empty($clientFields)) { + $fields = $clientFields; + } elseif ($locale === $sourceLocale) { + $fields = $sourceFields; + } else { + $translator = new TranslatorClient(); + $fields = []; + foreach ($sourceFields as $key => $text) { + $fields[$key] = $translator->translate($text, $sourceLocale, $locale); + } + } + + // 写库 + try { + $modelClass::updateOrCreate( + [ + $foreignKey => $id, + 'locale' => $locale, + ], + array_merge($fields, ['locale' => $locale]) + ); + } catch (\Throwable $e) { + Log::error("TranslationJob 保存失败: {$type}#{$id} locale={$locale}: ".$e->getMessage()); + } + } +} diff --git a/app/queue/translation/queue/Translation.php b/app/queue/translation/queue/Translation.php new file mode 100644 index 0000000..0b5841a --- /dev/null +++ b/app/queue/translation/queue/Translation.php @@ -0,0 +1,50 @@ + 'tom@gmail.com', 'content' => 'hello'] + + $job = new TranslationJob($data); + $job->handle(); + } catch (\Throwable $e) { + Log::error("TranslationService 异步任务异常: ".$e->getMessage()); + } + } + // 消费失败回调 + /* + $package = [ + 'id' => 1357277951, // 消息ID + 'time' => 1709170510, // 消息时间 + 'delay' => 0, // 延迟时间 + 'attempts' => 2, // 消费次数 + 'queue' => 'send-mail', // 队列名 + 'data' => ['to' => 'tom@gmail.com', 'content' => 'hello'], // 消息内容 + 'max_attempts' => 5, // 最大重试次数 + 'error' => '错误信息' // 错误信息 + ] + */ + public function onConsumeFailure(\Throwable $e, $package) + { + echo "consume failure\n"; + echo $e->getMessage() . "\n"; + // 无需反序列化 + var_export($package); + } +} \ No newline at end of file diff --git a/app/queue/translation/service/TranslationService.php b/app/queue/translation/service/TranslationService.php new file mode 100644 index 0000000..3578d89 --- /dev/null +++ b/app/queue/translation/service/TranslationService.php @@ -0,0 +1,41 @@ +config = getConfig('/queue/translation/config/trans.php'); + } + + /** + * 异步排队所有语种的翻译任务 + * + * @param string $entityType 实体名,如 'vehicle' + * @param int $entityId 主表 ID + * @param string $sourceLocale 源语种,如 'zh' + * @param array $sourceFields 源语种字段 ['name'=>…,'condition_desc'=>…] + * @param array $clientFields 前端已传翻译 ['en'=>[...], …] + */ + public function queueTranslations(string $entityType, int $entityId, string $sourceLocale, array $sourceFields, array $clientFields = []): void + { + foreach ($this->config['locales'] as $locale) { + $payload = [ + 'entityType' => $entityType, + 'entityId' => $entityId, + 'locale' => $locale, + 'sourceLocale' => $sourceLocale, + 'sourceFields' => $sourceFields, + 'clientFields' => $clientFields[$locale] ?? [], + ]; + Redis::send('transTask', $payload); + } + } +} \ No newline at end of file diff --git a/app/queue/translation/service/TranslatorClient.php b/app/queue/translation/service/TranslatorClient.php new file mode 100644 index 0000000..3abc1df --- /dev/null +++ b/app/queue/translation/service/TranslatorClient.php @@ -0,0 +1,38 @@ +endpoint = env('TRANSLATION_API_URL'); + // $this->apiKey = env('TRANSLATION_API_KEY'); + // } + + /** + * 翻译文本 + * @throws \RuntimeException + */ + public function translate(string $text, string $from = 'cn', string $to = 'ru'): string + { + try { + $xunfei = new XunfeiFanyi(); + $rst_dst = $xunfei->fanyi($text, $from, $to); + if ($rst_dst) { + return $rst_dst["trans_result"]["dst"]; + } else { + return ''; + } + } catch (\Throwable $e) { + Log::error("TranslatorClient 错误: ".$e->getMessage()); + throw new \RuntimeException('翻译服务调用失败'); + } + } +} diff --git a/app/queue/utils/Translat.php b/app/queue/utils/Translat.php new file mode 100644 index 0000000..3000756 --- /dev/null +++ b/app/queue/utils/Translat.php @@ -0,0 +1,21 @@ + $header,'body' => $response); + return $data; + } + + + public function xfyun($text = "中华人民共和国于1949年成立", $from = "cn", $to = "en") + { + //在控制台-我的应用-机器翻译获取 + $app_id = "3d46198c"; + //在控制台-我的应用-机器翻译获取 + $api_sec = "ZWY2MmUyNjJjYmFkOTFlYTVmYWVhMGYy"; + //在控制台-我的应用-机器翻译获取 + $api_key = "b6d805f240176ecaea85130cb5f2bca1"; + // 机器翻译接口地址 + $url = "https://ntrans.xfyun.cn/v2/ots"; + //body组装 + // $text = "中华人民共和国于1949年成立";//待翻译文本 + $body = json_encode($this->getBody($app_id, $from, $to, $text)); + + // 组装http请求头 + $date =gmdate('D, d M Y H:i:s') . ' GMT'; + + $digestBase64 = "SHA-256=".base64_encode(hash("sha256", $body, true)); + $builder = sprintf("host: %s +date: %s +POST /v2/ots HTTP/1.1 +digest: %s", "ntrans.xfyun.cn", $date, $digestBase64); + // echo($builder); + $sha = base64_encode(hash_hmac("sha256", $builder, $api_sec, true)); + + $authorization = sprintf("api_key=\"%s\", algorithm=\"%s\", headers=\"%s\", signature=\"%s\"", $api_key,"hmac-sha256", + "host date request-line digest", $sha); + + $header = [ + "Authorization: ".$authorization, + 'Content-Type: application/json', + 'Accept: application/json,version=1.0', + 'Host: ntrans.xfyun.cn', + 'Date: ' .$date, + 'Digest: '.$digestBase64 + ]; + $response = $this->tocurl($url, $header, $body); + + // var_dump($response['body']); + return $response; + } + + + public function getBody($app_id, $from, $to, $text) + { + $common_param = [ + 'app_id' => $app_id + ]; + + $business = [ + 'from' => $from, + 'to' => $to, + ]; + + $data = [ + "text" => base64_encode($text) + ]; + + return $body = [ + 'common' => $common_param, + 'business' => $business, + 'data' => $data + ]; + } + + // 翻译 + public function fanyi($text = "", $from = "", $to = "") + { + try { + $res = $this->xfyun($text, $from, $to); + $data = json_decode($res["body"], true); + if ($data["code"] === 0) { + return $data["data"]["result"]; + } else { + $this->error = $data["message"]; + return false; + } + } catch (\Throwable $th) { + $this->error = $th->getMessage(); + return false; + } + } + + // 异常 + public function error() + { + return $this->error; + } + +} \ No newline at end of file diff --git a/app/ticket/controller/CategorieController.php b/app/ticket/controller/CategorieController.php new file mode 100644 index 0000000..d9fe422 --- /dev/null +++ b/app/ticket/controller/CategorieController.php @@ -0,0 +1,52 @@ +list($request->all()); + return $this->success($this->page($result)); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } + + public function getAll(Request $request) + { + try { + $result = (new CategorieService())->getAll($request->all()); + return $this->success($result); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } + + public function add(Request $request) + { + try { + return (new CategorieService())->add($request->all()) + ? $this->success() + : $this->error(); + } catch (\Throwable $th) { + return $this->error($th->getMessage().' '.$th->getLine().' '.$th->getFile()); + } + } + + public function edit(Request $request) + { + try { + $result = (new CategorieService())->edit($request->all()); + return $result + ? $this->success($result) + : $this->error(); + } catch (\Throwable $th) { + return $this->error($th->getMessage().' '.$th->getLine().' '.$th->getFile()); + } + } +} \ No newline at end of file diff --git a/app/ticket/logic/CategorieLogic.php b/app/ticket/logic/CategorieLogic.php new file mode 100644 index 0000000..ab100b4 --- /dev/null +++ b/app/ticket/logic/CategorieLogic.php @@ -0,0 +1,52 @@ +where($where)->paginate($size, ['*'], 'page', $current); + } + + public function getAll($params) + { + $where = []; + $where[] = ['status', '=', 1]; + return TicketCategorie::with('translation')->where($where)->get(); + } + + public function add(array $data) + { + try { + return TicketCategorie::create($data); + } catch (\Throwable $e) { + Log::error('分类创建失败', [ + 'data' => $data, + 'error' => $e->getMessage() + ]); + throw new BusinessException($e->getMessage().'分类创建失败,请稍后重试', 500); + } + } + + public function edit(array $data) + { + try { + $categorie = TicketCategorie::updateOrCreate(['id' => $data['id']], $data); + return $categorie; + } catch (\Throwable $e) { + Log::error('分类编辑失败', [ + 'data' => $data, + 'error' => $e->getMessage() + ]); + throw new BusinessException($e->getMessage().'分类编辑失败,请稍后重试', 500); + } + } +} \ No newline at end of file diff --git a/app/ticket/logic/TicketLogic.php b/app/ticket/logic/TicketLogic.php index 16fb5ce..21e8539 100644 --- a/app/ticket/logic/TicketLogic.php +++ b/app/ticket/logic/TicketLogic.php @@ -17,9 +17,15 @@ class TicketLogic public function list($params) { $where = []; + if(!empty($params['categorie_id'])){ + $where[] = ['categorie_id', '=', $params['categorie_id']]; + } + if(!empty($params['status'])){ + $where[] = ['status', '=', $params['status']]; + } $size = $params['size']; $current = $params['current']; - return Ticket::with('attachments')->where($where)->paginate($size, ['*'], 'page', $current); + return Ticket::with('attachments')->where($where)->orderBy('id','desc')->paginate($size, ['*'], 'page', $current); } public function add(array $data) { diff --git a/app/ticket/model/TicketCategorie.php b/app/ticket/model/TicketCategorie.php new file mode 100644 index 0000000..79f4f75 --- /dev/null +++ b/app/ticket/model/TicketCategorie.php @@ -0,0 +1,47 @@ + 'datetime:Y-m-d H:i:s', + 'created_at' => 'datetime:Y-m-d H:i:s', + ]; + protected $fillable = [ + 'name', + 'description', + ]; + + /** + * 单条翻译 + */ + public function translation() + { + return $this->hasOne(TicketCategorieTranslation::class, 'categorie_id')->where('locale', locale()); + } + + /** + * 多条翻译 + */ + public function translations() + { + return $this->hasMany(TicketCategorieTranslation::class, 'categorie_id'); + } +} \ No newline at end of file diff --git a/app/ticket/model/TicketCategorieTranslation.php b/app/ticket/model/TicketCategorieTranslation.php new file mode 100644 index 0000000..66a8f95 --- /dev/null +++ b/app/ticket/model/TicketCategorieTranslation.php @@ -0,0 +1,35 @@ + 'datetime:Y-m-d H:i:s', + 'created_at' => 'datetime:Y-m-d H:i:s', + ]; + protected $fillable = [ + 'categorie_id', + 'locale', + 'name', + 'description', + ]; +} \ No newline at end of file diff --git a/app/ticket/service/CategorieService.php b/app/ticket/service/CategorieService.php new file mode 100644 index 0000000..5a0e9ee --- /dev/null +++ b/app/ticket/service/CategorieService.php @@ -0,0 +1,85 @@ +list($params); + + foreach ($result as $key => &$value) { + $value['name'] = isset($item['translation']) ? $item['translation']['name'] : ''; + unset($value['translation']); + } + unset($value); + + return $result; + } + + public function getAll($params) + { + $result = (new CategorieLogic())->getAll($params); + foreach ($result as $key => &$value) { + $value['name'] =isset($item['translation']) ? $item['translation']['name'] : ''; + unset($value['translation']); + } + unset($value); + + return $result; + } + + public $translatFields = ['name']; + + public function add(array $data) + { + try { + Db::beginTransaction(); + $sourceLocale = locale(); + $traitsourceFields = Translat::extractSourceFields($data, $this->translatFields); + + $result = (new CategorieLogic())->add($data); + + (new TranslationService())->queueTranslations( + 'ticket_categorie', + $result->id, + $sourceLocale, + $traitsourceFields + ); + + Db::commit(); + return $result; + } catch (\Throwable $e) { + Db::rollback(); + throw $e; + } + } + public function edit(array $data) + { + try { + Db::beginTransaction(); + $sourceLocale = locale(); + $traitsourceFields = Translat::extractSourceFields($data, $this->translatFields); + + $result = (new CategorieLogic())->edit($data); + + (new TranslationService())->queueTranslations( + 'ticket_categorie', + $data['id'], + $sourceLocale, + $traitsourceFields + ); + Db::commit(); + return $result; + } catch (\Throwable $e) { + Db::rollback(); + throw $e; + } + } +} \ No newline at end of file diff --git a/app/ticket/service/ConversationService.php b/app/ticket/service/ConversationService.php index cc3ef84..1716b8f 100644 --- a/app/ticket/service/ConversationService.php +++ b/app/ticket/service/ConversationService.php @@ -11,8 +11,8 @@ class ConversationService { public function list($params) { -// $locale = locale(); - $locale = 'zh'; + $locale = locale(); +// $locale = 'zh'; $ticket_status = $locale == 'zh'? Constants::TICKET_STATUS_ZH:Constants::TICKET_STATUS_EN; // $ticket_status = Constants::TICKET_STATUS_ZH; // $params['locale'] = locale(); @@ -30,7 +30,6 @@ class ConversationService try { return (new ConversationLogic())->add($data); } catch (\Throwable $e) { - Db::rollback(); throw $e; } } diff --git a/app/ticket/service/TicketService.php b/app/ticket/service/TicketService.php index 4ca7c73..a20c20b 100644 --- a/app/ticket/service/TicketService.php +++ b/app/ticket/service/TicketService.php @@ -65,7 +65,7 @@ class TicketService throw new BusinessException('工单不存在'); } if($data['status'] == $ticket->status){ - throw new BusinessException('状态未修改'); + throw new BusinessException(trans('status_not_modified')); } // if(!in_array($ticket->status, [Constants::TICKET_STATUS['PENDING'], Constants::TICKET_STATUS['CONFIRM']]) diff --git a/composer.json b/composer.json index 20cf41f..ccf259e 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,9 @@ "league/oauth2-server": "^9.2", "topthink/think-validate": "^3.0", "shopwwi/webman-filesystem": "1.1", - "shopwwi/filesystem-oss": "^1.0" + "shopwwi/filesystem-oss": "^1.0", + "webman/redis-queue": "^1.3", + "symfony/translation": "^7.3" }, "suggest": { "ext-event": "For better performance. " diff --git a/composer.lock b/composer.lock index d34c290..01843a4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7421030f864dacf31b06378e1045d034", + "content-hash": "acb636fcb8774558a04bd674f9f95f55", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -5365,7 +5365,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/translation/zipball/4aba29076a29a3aa667e09b791e5f868973a8667", "reference": "4aba29076a29a3aa667e09b791e5f868973a8667", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.2", @@ -6147,6 +6153,43 @@ }, "time": "2025-03-14T03:52:14+00:00" }, + { + "name": "webman/redis-queue", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/webman-php/redis-queue.git", + "reference": "6fd491b19acb006d60931724aa2577a046ccb612" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webman-php/redis-queue/zipball/6fd491b19acb006d60931724aa2577a046ccb612", + "reference": "6fd491b19acb006d60931724aa2577a046ccb612", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "workerman/redis-queue": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webman\\RedisQueue\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "description": "Redis message queue plugin for webman.", + "support": { + "issues": "https://github.com/webman-php/redis-queue/issues", + "source": "https://github.com/webman-php/redis-queue/tree/v1.3.1" + }, + "time": "2024-02-28T07:21:52+00:00" + }, { "name": "workerman/coroutine", "version": "v1.1.3", @@ -6186,6 +6229,90 @@ }, "time": "2025-02-17T03:34:21+00:00" }, + { + "name": "workerman/redis", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/walkor/redis.git", + "reference": "82b398c5bdd5d683a3458aaf645b159b7b39b84e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/walkor/redis/zipball/82b398c5bdd5d683a3458aaf645b159b7b39b84e", + "reference": "82b398c5bdd5d683a3458aaf645b159b7b39b84e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7", + "workerman/workerman": "^4.1.0||^5.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Workerman\\Redis\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "http://www.workerman.net", + "support": { + "issues": "https://github.com/walkor/redis/issues", + "source": "https://github.com/walkor/redis/tree/v2.0.4" + }, + "time": "2025-04-05T07:45:12+00:00" + }, + { + "name": "workerman/redis-queue", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/walkor/redis-queue.git", + "reference": "75dbf7ed2ea228c45dc0df82c0fea35879b715d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/walkor/redis-queue/zipball/75dbf7ed2ea228c45dc0df82c0fea35879b715d0", + "reference": "75dbf7ed2ea228c45dc0df82c0fea35879b715d0", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.0", + "workerman/redis": "^1.0||^2.0", + "workerman/workerman": ">=4.0.20" + }, + "type": "library", + "autoload": { + "psr-4": { + "Workerman\\RedisQueue\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Message queue system written in PHP based on workerman and backed by Redis.", + "homepage": "http://www.workerman.net", + "support": { + "issues": "https://github.com/walkor/redis-queue/issues", + "source": "https://github.com/walkor/redis-queue/tree/v1.2.1" + }, + "time": "2025-01-02T09:21:45+00:00" + }, { "name": "workerman/webman-framework", "version": "v2.1.2", diff --git a/config/plugin/webman/redis-queue/app.php b/config/plugin/webman/redis-queue/app.php new file mode 100644 index 0000000..8f9c426 --- /dev/null +++ b/config/plugin/webman/redis-queue/app.php @@ -0,0 +1,4 @@ + true, +]; \ No newline at end of file diff --git a/config/plugin/webman/redis-queue/command.php b/config/plugin/webman/redis-queue/command.php new file mode 100644 index 0000000..8bfe2a1 --- /dev/null +++ b/config/plugin/webman/redis-queue/command.php @@ -0,0 +1,7 @@ + + * @copyright walkor + * @link http://www.workerman.net/ + * @license http://www.opensource.org/licenses/mit-license.php MIT License + */ + +return [ + 'default' => [ + 'handlers' => [ + [ + 'class' => Monolog\Handler\RotatingFileHandler::class, + 'constructor' => [ + runtime_path() . '/logs/redis-queue/queue.log', + 7, //$maxFiles + Monolog\Logger::DEBUG, + ], + 'formatter' => [ + 'class' => Monolog\Formatter\LineFormatter::class, + 'constructor' => [null, 'Y-m-d H:i:s', true], + ], + ] + ], + ] +]; diff --git a/config/plugin/webman/redis-queue/process.php b/config/plugin/webman/redis-queue/process.php new file mode 100644 index 0000000..9fac733 --- /dev/null +++ b/config/plugin/webman/redis-queue/process.php @@ -0,0 +1,12 @@ + [ + 'handler' => Webman\RedisQueue\Process\Consumer::class, + 'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费 + 'constructor' => [ + // 消费者类目录 + // 'consumer_dir' => app_path() . '/queue/redis' + 'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR') + ] + ] +]; \ No newline at end of file diff --git a/config/plugin/webman/redis-queue/redis.php b/config/plugin/webman/redis-queue/redis.php new file mode 100644 index 0000000..420914d --- /dev/null +++ b/config/plugin/webman/redis-queue/redis.php @@ -0,0 +1,22 @@ + [ +// 'host' => 'redis://127.0.0.1:6379', + 'host' => getenv('REDIS_QUEUE_HOST'), + 'options' => [ + 'auth' => getenv('REDIS_QUEUE_AUTH'), // 密码,字符串类型,可选参数 + 'db' => getenv('REDIS_QUEUE_DB'), // 数据库 + 'prefix' => getenv('REDIS_QUEUE_PREFIX'), // key 前缀 + 'max_attempts' => getenv('REDIS_QUEUE_MAX_ATTEMPTS'), // 消费失败后,重试次数 + 'retry_seconds' => getenv('REDIS_QUEUE_RETRY_SECONDS'), // 重试间隔,单位秒 + ], + // Connection pool, supports only Swoole or Swow drivers. + 'pool' => [ + 'max_connections' => 5, + 'min_connections' => 1, + 'wait_timeout' => 3, + 'idle_timeout' => 60, + 'heartbeat_interval' => 50, + ] + ], +]; diff --git a/config/route.php b/config/route.php index c7b7413..76a9435 100644 --- a/config/route.php +++ b/config/route.php @@ -50,5 +50,11 @@ Route::group('/ticket', function () { Route::any('/conversation/edit', [app\ticket\controller\ConversationController::class, 'edit']); Route::any('/conversation/list', [app\ticket\controller\ConversationController::class, 'index']); + //工单分类 + Route::any('/categorie/add', [app\ticket\controller\CategorieController::class, 'add']); + Route::any('/categorie/edit', [app\ticket\controller\CategorieController::class, 'edit']); + Route::any('/categorie/list', [app\ticket\controller\CategorieController::class, 'index']); + Route::any('/categorie/getAll', [app\ticket\controller\CategorieController::class, 'getAll']); + }); diff --git a/resource/translations/ar/messages.php b/resource/translations/ar/messages.php new file mode 100644 index 0000000..342a451 --- /dev/null +++ b/resource/translations/ar/messages.php @@ -0,0 +1,5 @@ + 'الوضع لم يتغير', +]; \ No newline at end of file diff --git a/resource/translations/en/messages.php b/resource/translations/en/messages.php new file mode 100644 index 0000000..53c6d07 --- /dev/null +++ b/resource/translations/en/messages.php @@ -0,0 +1,5 @@ + 'status not modified', +]; \ No newline at end of file diff --git a/resource/translations/ru/messages.php b/resource/translations/ru/messages.php new file mode 100644 index 0000000..fc398a5 --- /dev/null +++ b/resource/translations/ru/messages.php @@ -0,0 +1,5 @@ + 'Статус не изменен', +]; \ No newline at end of file diff --git a/resource/translations/zh/messages.php b/resource/translations/zh/messages.php new file mode 100644 index 0000000..7c95aaf --- /dev/null +++ b/resource/translations/zh/messages.php @@ -0,0 +1,5 @@ + '状态未修改', +]; \ No newline at end of file