jeecg-boot 官方文档 快速开始之hello word
jeecg-boot 采过的坑
观看官方视频教程 建立新的模块
下载的代码不同于视频中演示的代码, 在modules 文件下建包(不同于视频中),特别注意包名:org.jeecg.modeles 必不可少
在新建类中
@RestController
@RequestMapping("/test/jeecgTest")
@Slf4j //注解
public class JeecgTestController {
/**
* hello world
*
* @param id
* @return
*/
@GetMapping(value = "/hello")
public Result<String> hello() {
Result<String> result = new Result<String>();
result.setResult("Hello World!");
result.setSuccess(true);
log.info("-----------------------hello world---------------");//输出日志
return result;
}
}
使用快捷键ctrl+shift+o 打开organize imports 导入依赖包
访问请求http://localhost:8080/jeecg-boot//test/jeecgTest/hello 会提示token无效,
所以需要配置下拦截器ShiroConfig排除。
配置文件: jeecg-boot-module-system/src/main/java/org.jeecg.config/ShiroConfig.java
filterChainDefinitionMap.put("/test/jeecgTest/hello", "anon"); //测试
第一次写博客 排版太乱,望读者见谅