OriginalGuidesController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: hp
  5. * Date: 2017/11/20
  6. * Time: 16:17
  7. */
  8. namespace App\Http\Controllers\Channel\Promotion;
  9. use App\Http\Controllers\Channel\BaseController;
  10. use App\Http\Controllers\Channel\Promotion\Transformers\OriginalGuidesTransformer;
  11. use App\Http\Controllers\Controller;
  12. use App\Modules\Promotion\Services\PromotionService;
  13. use DB;
  14. class OriginalGuidesController extends BaseController
  15. {
  16. /**
  17. * @apiDefine promotion 推广
  18. */
  19. /**
  20. * @apiVersion 1.0.0
  21. * @api {GET} promotion/originalGuides 获取原文引导列表
  22. * @apiGroup promotion
  23. * @apiName getPromotion0riginalGuides
  24. * @apiSuccess {Number} id ID.
  25. * @apiSuccess {String} content 内容.
  26. * @apiSuccessExample {json} Success-Response:
  27. *
  28. * {
  29. * "code": 0,
  30. * "msg": "",
  31. *
  32. * "data": [
  33. * {
  34. * "id": 1,
  35. * "content": "sfsd"
  36. * },
  37. * {
  38. * "id": 2,
  39. * "content": "sfsd"
  40. * }
  41. * ]
  42. * }
  43. */
  44. function getPromotion0riginalGuides()
  45. {
  46. $promotionOriginalGuidesResult = PromotionService::getAllOriginalGuides();
  47. return response()->collection(new OriginalGuidesTransformer(), $promotionOriginalGuidesResult);
  48. }
  49. }