CommentController.php 635 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Controllers\Deed;
  3. use App\Http\Controllers\Controller;
  4. use App\Http\Controllers\Core\Auth;
  5. use App\Services\Deed\CommentService;
  6. use Illuminate\Http\Request;
  7. class CommentController extends Controller
  8. {
  9. public function comment(int $deed_id, Request $request)
  10. {
  11. $this->validate($request, [
  12. 'speed' => 'required',
  13. 'level' => 'required'
  14. ]);
  15. $uid = Auth::auth();
  16. $cs = new CommentService();
  17. $cs->comment($deed_id, $request->toArray());
  18. return array(
  19. 'code' => 200,
  20. 'message' => 'success'
  21. );
  22. }
  23. }