QrCodeController.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\QrCodeTransformer;
  11. use App\Modules\Promotion\Services\PromotionService;
  12. use DB;
  13. class QrCodeController extends BaseController
  14. {
  15. /**
  16. * @apiDefine promotion 推广
  17. */
  18. /**
  19. * @apiVersion 1.0.0
  20. * @api {GET} promotion/getQrCodes 获取二维码列表
  21. * @apiGroup promotion
  22. * @apiName getQrCodes
  23. * @apiSuccess {Number} id ID.
  24. * @apiSuccess {String} codeUrl 链接地址.
  25. * @apiSuccessExample {json} Success-Response:
  26. *
  27. * {
  28. * "code": 0,
  29. * "msg": "",
  30. *
  31. * "data": [
  32. * {
  33. * "id": 1,
  34. * "codeUrl": "https://yueduyun.oss-cn-hangzhou.aliyuncs.com/distribution/push/continue-3.jpg"
  35. * },
  36. * {
  37. * "id": 2,
  38. * "codeUrl": "https://yueduyun.oss-cn-hangzhou.aliyuncs.com/distribution/push/continue-3.jpg"
  39. * }
  40. * ]
  41. * }
  42. */
  43. function getQrCodes()
  44. {
  45. $qrCodesResult = PromotionService::getQrCodes();
  46. return response()->collection(new QrCodeTransformer(), $qrCodesResult);
  47. }
  48. }