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