This commit is contained in:
2025-05-28 17:55:16 +08:00
parent f2d0b8c118
commit f8ae6e5829
4 changed files with 17 additions and 10 deletions
+2 -2
View File
@@ -43,11 +43,11 @@ class TranslatorService
return $location;
}
public function queue($field,$sourceLang,$type,$id) {
public function queue($field,$sourceLang,$type,$id,$toLang) {
// 队列名
$queue = 'translator';
// 数据,可以直接传数组,无需序列化
$data = ['entityType' => $type, 'sourceFields' => $field, 'sourceLang' => $sourceLang, 'locale' => 'hello', 'id' => $id];
$data = ['entityType' => $type, 'sourceFields' => $field, 'sourceLang' => $sourceLang, 'locale' => 'hello', 'id' => $id, 'toLang' => $toLang];
// 投递消息
Redis::send($queue, $data);
return true;