FileController.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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;
  20. use app\adminapi\lists\FileCateLists;
  21. use app\adminapi\lists\FileLists;
  22. use app\adminapi\logic\FileLogic;
  23. use app\adminapi\validate\FileValidate;
  24. use think\response\Json;
  25. class FileController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 文件列表
  29. * @author 张无忌
  30. * @date 2021/7/28 14:52
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists(new FileLists());
  35. }
  36. /**
  37. * @notes 移动成功
  38. * @return Json
  39. * @author 张无忌
  40. * @date 2021/7/28 15:33
  41. */
  42. public function move()
  43. {
  44. $params = (new FileValidate())->post()->goCheck('move');
  45. FileLogic::move($params);
  46. return $this->success('移动成功', [], 1, 1);
  47. }
  48. /**
  49. * @notes 重命名文件
  50. * @return Json
  51. * @author 张无忌
  52. * @date 2021/7/29 17:17
  53. */
  54. public function rename()
  55. {
  56. $params = (new FileValidate())->post()->goCheck('rename');
  57. FileLogic::rename($params);
  58. return $this->success('重命名成功', [], 1, 1);
  59. }
  60. /**
  61. * @notes 删除文件
  62. * @author 张无忌
  63. * @date 2021/7/28 15:40
  64. */
  65. public function delete()
  66. {
  67. $params = (new FileValidate())->post()->goCheck('delete');
  68. FileLogic::delete($params);
  69. return $this->success('删除成功', [], 1, 1);
  70. }
  71. /**
  72. * @notes 分类列表
  73. * @author 张无忌
  74. * @date 2021/7/28 18:34
  75. */
  76. public function listCate()
  77. {
  78. return $this->dataLists(new FileCateLists());
  79. }
  80. /**
  81. * @notes 添加文件分类
  82. * @return Json
  83. * @author 张无忌
  84. * @date 2021/7/28 14:02
  85. */
  86. public function addCate()
  87. {
  88. $params = (new FileValidate())->post()->goCheck('addCate');
  89. FileLogic::addCate($params);
  90. return $this->success('添加成功', [], 1, 1);
  91. }
  92. /**
  93. * @notes 编辑文件分类
  94. * @return Json
  95. * @author 张无忌
  96. * @date 2021/7/28 14:16
  97. */
  98. public function editCate()
  99. {
  100. $params = (new FileValidate())->post()->goCheck('editCate');
  101. FileLogic::editCate($params);
  102. return $this->success('编辑成功', [], 1, 1);
  103. }
  104. /**
  105. * @notes 删除文件分类
  106. * @return Json
  107. * @author 张无忌
  108. * @date 2021/7/28 14:50
  109. */
  110. public function delCate()
  111. {
  112. $params = (new FileValidate())->post()->goCheck('id');
  113. FileLogic::delCate($params);
  114. return $this->success('删除成功', [], 1, 1);
  115. }
  116. }