DocumentCoversController.php 1.4 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\DocumentCoversTransformer;
  11. use App\Modules\Promotion\Services\PromotionService;
  12. use DB;
  13. class DocumentCoversController extends BaseController
  14. {
  15. /**
  16. * @apiDefine promotion 推广
  17. */
  18. /**
  19. * @apiVersion 1.0.0
  20. * @api {GET} promotion/documentCovers 获取推广文案封面列表
  21. * @apiGroup promotion
  22. * @apiName getPromotionDocumentCovers
  23. * @apiSuccess {Number} id 文案封面id..
  24. * @apiSuccess {String} origin_cover 封面地址.
  25. * @apiSuccessExample {json} Success-Response:
  26. *
  27. * {
  28. * "code": 0,
  29. * "msg": "",
  30. *
  31. * "data": [
  32. * {
  33. * "id": 1,
  34. * "origin_cover": "sfsd"
  35. * },
  36. * {
  37. * "id": 2,
  38. * "origin_cover": "sfsd"
  39. * }
  40. * ]
  41. * }
  42. */
  43. function getPromotionDocumentCovers()
  44. {
  45. $distribution_channel_id = $this->getChannelId();
  46. $promotionDocumentCoversResult = PromotionService::getAllDocumentCovers($distribution_channel_id);
  47. return response()->collection(new DocumentCoversTransformer(), $promotionDocumentCoversResult);
  48. }
  49. }