LiveRoomController.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller\live;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\logic\live\LiveRoomLogic;
  22. use app\adminapi\validate\live\LiveRoomValidate;
  23. /**
  24. * 直播间控制器
  25. * Class LiveRoomController
  26. * @package app\adminapi\controller\live
  27. */
  28. class LiveRoomController extends BaseAdminController
  29. {
  30. /**
  31. * @notes 直播间列表
  32. * @return \think\response\Json
  33. * @author cjhao
  34. * @date 2021/11/22 16:13
  35. */
  36. public function lists()
  37. {
  38. $limitOffset = $this->request->get('page_no');
  39. $limitLength = $this->request->get('page_size');
  40. $result = (new LiveRoomLogic())->lists($limitOffset,$limitLength);
  41. if(is_array($result)){
  42. return $this->success('',$result);
  43. }
  44. return $this->fail($result);
  45. }
  46. /**
  47. * @notes 创建直播间
  48. * @author cjhao
  49. * @date 2021/11/22 17:51
  50. */
  51. public function add()
  52. {
  53. $post = (new LiveRoomValidate())->post()->goCheck('add');
  54. $result = (new LiveRoomLogic())->add($post);
  55. if (true === $result) {
  56. return $this->success('创建成功',[],1,1);
  57. }
  58. return $this->fail($result);
  59. }
  60. /**
  61. * @notes 删除直播间
  62. * @return \think\response\Json
  63. * @author cjhao
  64. * @date 2021/11/23 10:24
  65. */
  66. public function del()
  67. {
  68. $post = (new LiveRoomValidate())->post()->goCheck('del');
  69. $result = (new LiveRoomLogic())->del($post['room_id']);
  70. if (true === $result) {
  71. return $this->success('删除成功',[],1,1);
  72. }
  73. return $this->fail($result);
  74. }
  75. }