企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 路由分组 此页面参照了EasySwoole Distributed的文档,原文档地址 [https://www.kancloud.cn/tmtbe/goswoole/1086149]: https://www.kancloud.cn/tmtbe/goswoole/1086149 通过给 @RestController 指定默认参数 Index 来设置路由分组,设置后该类下的*Mapping都会应用该前缀。 ```php /** * @RestController("Index") * Class TestController * @package ESD\Plugins\EasyRoute */ class Index extends GoController { ... ``` 如果设置为如下案例 GetMapping("/"),那么该方法的路由为 http://127.0.0.1:8080/Index ```php /** * @GetMapping("/") * @return array */ public function actionInject(){ $id = $this->request->getGet('id',5); return $this->cacheTest($id); } ``` 如果设置为如下案例 @GetMapping(),那么该方法的路由为 http://127.0.0.1:8080/Index/task ```php /** * @GetMapping() */ public function actionTask(){ $a = new test(); $a->test(); } ```