ServiceTeamController.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\service\ServiceTeamService;
  4. use app\admin\validate\sys_manage\DeptValidate;
  5. use support\Request;
  6. class ServiceTeamController
  7. {
  8. /**
  9. * @Desc 部门列表
  10. * @Author Gorden
  11. * @Date 2024/2/21 10:29
  12. *
  13. * @param Request $request
  14. * @return \support\Response
  15. */
  16. public function deptList(Request $request)
  17. {
  18. return ServiceTeamService::deptList($request);
  19. }
  20. /**
  21. * @Desc 部门详情
  22. * @Author Gorden
  23. * @Date 2024/2/21 10:35
  24. *
  25. * @param $id
  26. * @return \support\Response
  27. */
  28. public function deptInfo($id)
  29. {
  30. return ServiceTeamService::deptInfo($id);
  31. }
  32. /**
  33. * @Desc 创建部门
  34. * @Author Gorden
  35. * @Date 2024/2/21 9:22
  36. *
  37. * @param Request $request
  38. * @return \support\Response
  39. */
  40. public function addDept(Request $request)
  41. {
  42. $validate = new DeptValidate();
  43. if (!$validate->scene('service_team_add')->check($request->post())) {
  44. return json_fail($validate->getError());
  45. }
  46. return ServiceTeamService::insertDept($request->post());
  47. }
  48. /**
  49. * @Desc 修改部门
  50. * @Author Gorden
  51. * @Date 2024/2/21 10:15
  52. *
  53. * @param $id
  54. * @param Request $request
  55. * @return \support\Response
  56. */
  57. public function updateDept($id, Request $request)
  58. {
  59. $validate = new DeptValidate();
  60. if (!$validate->scene('service_team_update')->check($request->post())) {
  61. return json_fail($validate->getError());
  62. }
  63. return ServiceTeamService::updateDept($id, $request->post());
  64. }
  65. /**
  66. * @Desc 修改部门状态
  67. * @Author Gorden
  68. * @Date 2024/2/21 10:41
  69. *
  70. * @param $id
  71. * @param $status
  72. * @return \support\Response
  73. */
  74. public function updateStatus($id, Request $request)
  75. {
  76. $validate = new DeptValidate();
  77. if (!$validate->scene('update_status')->check($request->post())) {
  78. return json_fail($validate->getError());
  79. }
  80. return ServiceTeamService::updateStatus($id, $request->post('dept_status'));
  81. }
  82. public function delDept(Request $request)
  83. {
  84. return ServiceTeamService::delDept($request);
  85. }
  86. }