PromotionPagesController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: hp
  5. * Date: 2017/11/22
  6. * Time: 10:45
  7. */
  8. namespace App\Http\Controllers\Channel\Promotion;
  9. use App\Http\Controllers\Channel\BaseController;
  10. use App\Http\Controllers\Channel\Promotion\Transformers\PromotionPagesTransformer;
  11. use App\Modules\Promotion\Services\PromotionService;
  12. class PromotionPagesController extends BaseController
  13. {
  14. /**
  15. * @apiDefine promotion 推广
  16. */
  17. /**
  18. * @apiVersion 1.0.0
  19. * @api {GET} promotion/promotionPages 获取推广页面列表
  20. * @apiGroup promotion
  21. * @apiName getPromotionPages
  22. * @apiSuccess {Number} id ID.
  23. * @apiSuccess {String} title 标题
  24. * @apiSuccess {String} description 描述
  25. * @apiSuccess {String} link 推广链接
  26. * @apiSuccessExample {json} Success-Response:
  27. *
  28. * {
  29. * "code": 0,
  30. * "msg": "",
  31. *
  32. * "data": [
  33. * {
  34. * "id": 1,
  35. * "title": "sfsd",
  36. * "link": "111111111",
  37. * "description": "测试1111"
  38. * },
  39. * {
  40. * "id": 2,
  41. * "title": "sfsd",
  42. * "link": "111111111",
  43. * "description": "测试1111"
  44. * }
  45. * ]
  46. * }
  47. */
  48. function getPromotionPages()
  49. {
  50. $promotionPagesResult = PromotionService::getAllPromotionPage();
  51. return response()->collection(new PromotionPagesTransformer(), $promotionPagesResult);
  52. }
  53. }