Skip to content

Commit

Permalink
feat(*): 音乐 & 资讯评论增加 at 人功能
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Aug 16, 2018
1 parent ef2bc53 commit ae08fe4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
use Zhiyi\Plus\Models\Comment;
use Zhiyi\Plus\Models\UserCount;
use Zhiyi\Plus\Http\Controllers\Controller;
use Zhiyi\Plus\AtMessage\AtMessageHelperTrait;
use Zhiyi\Component\ZhiyiPlus\PlusComponentMusic\Models\Music;
use Zhiyi\Component\ZhiyiPlus\PlusComponentMusic\Models\MusicSpecial;

class MusicCommentController extends Controller
{
use AtMessageHelperTrait;

/**
* 添加音乐评论.
*
Expand Down Expand Up @@ -71,6 +74,8 @@ public function store(Request $request, Music $music, Comment $comment)
app(Push::class)->push(sprintf('%s 回复了您的评论', $user->name), (string) $replyUser->id, ['channel' => 'music:comment-reply']);
}

$this->sendAtMessage($comment->body, $user, $comment);

return response()->json([
'message' => '操作成功',
'comment' => $comment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@
use Zhiyi\Plus\Services\Push;
use Zhiyi\Plus\Models\Comment;
use Zhiyi\Plus\Http\Controllers\Controller;
use Zhiyi\Plus\AtMessage\AtMessageHelperTrait;
use Zhiyi\Plus\Models\UserCount as UserCountModel;
use Zhiyi\Component\ZhiyiPlus\PlusComponentNews\Models\News;
use Zhiyi\Component\ZhiyiPlus\PlusComponentNews\Models\NewsPinned;
use Zhiyi\Component\ZhiyiPlus\PlusComponentNews\API2\Requests\StoreNewsComment;

class CommentController extends Controller
{
use AtMessageHelperTrait;

/**
* 发布资讯评论.
*
Expand Down Expand Up @@ -92,6 +95,8 @@ public function store(StoreNewsComment $request, News $news, Comment $comment)
unset($userCommentedCount);
}

$this->sendAtMessage($comment->body, $user, $comment);

return response()->json([
'message' => '操作成功',
'comment' => $comment,
Expand Down

0 comments on commit ae08fe4

Please sign in to comment.