Graphic.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin [Just Like ~ ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. namespace catchAdmin\wechat\controller;
  12. use catchAdmin\wechat\repository\WechatGraphicRepository;
  13. use catchAdmin\wechat\repository\WechatUsersRepository;
  14. use catcher\base\CatchController;
  15. use catcher\base\CatchRequest;
  16. use catcher\CatchResponse;
  17. use catcher\library\WeChat;
  18. use catcher\Utils;
  19. use think\facade\Console;
  20. use think\Request;
  21. class Graphic extends CatchController
  22. {
  23. protected $graphic;
  24. public function __construct(WechatGraphicRepository $graphic)
  25. {
  26. $this->graphic = $graphic;
  27. }
  28. /**
  29. * list
  30. *
  31. * @time 2020年06月27日
  32. * @param CatchRequest $request
  33. * @return \think\response\Json
  34. */
  35. public function index(CatchRequest $request)
  36. {
  37. return CatchResponse::paginate($this->graphic->getList($request->param()));
  38. }
  39. public function read($id)
  40. {
  41. return CatchResponse::success($this->graphic->findBy($id));
  42. }
  43. public function save(CatchRequest $request)
  44. {
  45. return CatchResponse::success($this->graphic->storeBy($request->param()));
  46. }
  47. public function update($id, CatchRequest $request)
  48. {
  49. return CatchResponse::success($this->graphic->updateBy($id, $request->param()));
  50. }
  51. public function delete($id)
  52. {
  53. return CatchResponse::success($this->graphic->deleteBy($id));
  54. }
  55. }