FileController.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller;
  15. use app\adminapi\lists\file\FileCateLists;
  16. use app\adminapi\lists\file\FileLists;
  17. use app\adminapi\logic\FileLogic;
  18. use app\adminapi\validate\FileValidate;
  19. use think\response\Json;
  20. /**文件管理
  21. * Class FileController
  22. * @package app\adminapi\controller
  23. */
  24. class FileController extends BaseAdminController
  25. {
  26. /**
  27. * @notes 文件列表
  28. * @return Json
  29. * @author 段誉
  30. * @date 2021/12/29 14:30
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists(new FileLists());
  35. }
  36. /**
  37. * @notes 文件移动成功
  38. * @return Json
  39. * @author 段誉
  40. * @date 2021/12/29 14:30
  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/12/29 14:31
  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. * @return Json
  63. * @author 段誉
  64. * @date 2021/12/29 14:31
  65. */
  66. public function delete()
  67. {
  68. $params = (new FileValidate())->post()->goCheck('delete');
  69. FileLogic::delete($params);
  70. return $this->success('删除成功', [], 1, 1);
  71. }
  72. /**
  73. * @notes 分类列表
  74. * @return Json
  75. * @author 段誉
  76. * @date 2021/12/29 14:31
  77. */
  78. public function listCate()
  79. {
  80. return $this->dataLists(new FileCateLists());
  81. }
  82. /**
  83. * @notes 添加文件分类
  84. * @return Json
  85. * @author 段誉
  86. * @date 2021/12/29 14:31
  87. */
  88. public function addCate()
  89. {
  90. $params = (new FileValidate())->post()->goCheck('addCate');
  91. FileLogic::addCate($params);
  92. return $this->success('添加成功', [], 1, 1);
  93. }
  94. /**
  95. * @notes 编辑文件分类
  96. * @return Json
  97. * @author 段誉
  98. * @date 2021/12/29 14:31
  99. */
  100. public function editCate()
  101. {
  102. $params = (new FileValidate())->post()->goCheck('editCate');
  103. FileLogic::editCate($params);
  104. return $this->success('编辑成功', [], 1, 1);
  105. }
  106. /**
  107. * @notes 删除文件分类
  108. * @return Json
  109. * @author 段誉
  110. * @date 2021/12/29 14:32
  111. */
  112. public function delCate()
  113. {
  114. $params = (new FileValidate())->post()->goCheck('id');
  115. FileLogic::delCate($params);
  116. return $this->success('删除成功', [], 1, 1);
  117. }
  118. }