|
@@ -20,7 +20,6 @@ use App\Models\PostLike;
|
|
|
use App\Models\PostShare;
|
|
|
use App\Models\Topic;
|
|
|
use App\Service\DetectionService;
|
|
|
-use App\Service\RabbitMqUtil;
|
|
|
use App\Traits\PostTrait;
|
|
|
use App\Traits\UserTrait;
|
|
|
use Illuminate\Database\QueryException;
|
|
@@ -42,7 +41,6 @@ class PostRepositories
|
|
|
PostCollect $postCollect,
|
|
|
PostShare $postShare,
|
|
|
DetectionService $detectionService,
|
|
|
- RabbitMqUtil $rabbitMqUtil,
|
|
|
Topic $topic)
|
|
|
{
|
|
|
$this->post = $post;
|
|
@@ -52,7 +50,6 @@ class PostRepositories
|
|
|
$this->postCollect = $postCollect;
|
|
|
$this->postShare = $postShare;
|
|
|
$this->detectionService = $detectionService;
|
|
|
- $this->rabbitMqUtil = $rabbitMqUtil;
|
|
|
$this->topic = $topic;
|
|
|
}
|
|
|
|
|
@@ -227,44 +224,10 @@ class PostRepositories
|
|
|
if(isset($request['reply_uid']) && isset($request['reply_username'])){
|
|
|
$data['reply_uid'] = $request['reply_uid'];
|
|
|
$data['reply_username'] = $request['reply_username'];
|
|
|
- $this->rabbitMqUtil->push('add_message', [
|
|
|
- 'uid' => $request['reply_uid'],
|
|
|
- 'message_show_type' => 'post_reply_main',
|
|
|
- 'param' => [
|
|
|
- 'uid' => $userInfo['uid'],
|
|
|
- 'username' => $userInfo['username'],
|
|
|
- 'post_id' => $post->id,
|
|
|
- 'cover' => $post->img,
|
|
|
- 'content' => subtext($request['content'], 20),
|
|
|
- ]
|
|
|
- ]);
|
|
|
}else{
|
|
|
$data['reply_uid'] = 0;
|
|
|
$data['reply_username'] = '';
|
|
|
- $this->rabbitMqUtil->push('add_message', [
|
|
|
- 'uid' => $comment->uid,
|
|
|
- 'message_show_type' => 'post_reply',
|
|
|
- 'param' => [
|
|
|
- 'uid' => $userInfo['uid'],
|
|
|
- 'username' => $userInfo['username'],
|
|
|
- 'post_id' => $post->id,
|
|
|
- 'cover' => $post->img,
|
|
|
- 'content' => subtext($request['content'], 20),
|
|
|
- ]
|
|
|
- ]);
|
|
|
}
|
|
|
- }else{
|
|
|
- $this->rabbitMqUtil->push('add_message', [
|
|
|
- 'uid' => $post->uid,
|
|
|
- 'message_show_type' => 'post_comment',
|
|
|
- 'param' => [
|
|
|
- 'uid' => $userInfo['uid'],
|
|
|
- 'username' => $userInfo['username'],
|
|
|
- 'post_id' => $post->id,
|
|
|
- 'cover' => $post->img,
|
|
|
- 'content' => subtext($request['content'], 20),
|
|
|
- ]
|
|
|
- ]);
|
|
|
}
|
|
|
|
|
|
DB::beginTransaction();
|