1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Http\Controllers\Client;
- use App\Http\Controllers\Controller;
- use App\Services\Client\CommentService;
- use Illuminate\Http\Request;
- class CommentController extends Controller
- {
- protected CommentService $service;
- public function __construct(CommentService $service)
- {
- $this->service = $service;
- }
- /**
- * 发表评价
- */
- public function create(Request $request)
- {
- $coachId = $request->input('coach_id');
- $content = $request->input('content');
- $rating = $request->input('rating');
-
- return $this->service->createComment($coachId, $content, $rating);
- }
- /**
- * 评价列表
- */
- public function list(Request $request)
- {
- $coachId = $request->input('coach_id');
- return $this->service->getCommentList($coachId);
- }
- }
|