user.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare (strict_types = 1);
  3. use App\Controller\UserController;
  4. use App\Middleware\Auth\FooMiddleware;
  5. use Hyperf\HttpServer\Router\Router;
  6. Router::addGroup(
  7. '/user', function () {
  8. Router::post('/createUser', [UserController::class, 'createUser']);
  9. Router::post('/updateUser', [UserController::class, 'updateUser']);
  10. //通过token获取用户信息
  11. Router::get('/getUserInfo', [UserController::class, 'getUserInfo']);
  12. //获取用户信息
  13. Router::get('/getUser', [UserController::class, 'getUser']);
  14. Router::get('/getUserList', [UserController::class, 'getUserList']);
  15. Router::post('/delUser', [UserController::class, 'delUser']);
  16. Router::post('/verifyUserInfo', [UserController::class, 'verifyUserInfo']);
  17. //角色列表
  18. Router::get('/roleList', [UserController::class, 'roleList']);
  19. //查看角色
  20. Router::get('/roleInfo', [UserController::class, 'roleInfo']);
  21. //添加角色
  22. Router::post('/addRole', [UserController::class, 'addRole']);
  23. //删除角色
  24. Router::post('/delRole', [UserController::class, 'delRole']);
  25. //更新角色
  26. Router::post('/updateRole', [UserController::class, 'updateRole']);
  27. Router::post('/changePassword', [UserController::class, 'changePassword']);
  28. //修改用户状态
  29. Router::post('/upUserStatus', [UserController::class, 'upUserStatus']);
  30. Router::post('/getToken', [UserController::class, 'getToken']);
  31. },
  32. ['middleware' => [FooMiddleware::class]]
  33. );