seltongithub / got Goto Github PK
View Code? Open in Web Editor NEWGame of Thrones(GoT)
Game of Thrones(GoT)
将数据存入到数据库中而不是hashmap中
完成chapter1任务.
项目推进中,如果说第一件事是搭Spring框架的话,那么第二件事情就是在Sring基础上搭建日志框架,尤其是线上Web项目,因为日志可能是我们了解应用如何执行的唯一方式,这一了解过程尤其在线上项目出现bug时更加重要.
如何发现了任何觉得有帮助理解和练习等的文档,可以在下方评论
完成chapter1_2任务.
在上个任务 #2 的代码基础上 完成以下
使用postman工具模拟http请求
提示: 不用使用数据库 使用类似static的Map或者List临时存储就可以 顺带熟悉一下postman的使用 不用写前端页面了
使用postman工具模拟http请求
模拟在controller中抛出异常(比如直接在controller中throw一个异常) 然后使用springboot的统一异常捕获 将其捕获 并且封装成固定格式的json返回
提示: 我们不应该在每个controller中写入try catch 来封装异常, springboot有实现了类似java的叫做动态代理的名为aop的切面处理, 关键字 advice.
例: http get请求访问localhost:8080/user/2
controller中抛出了某种异常 程序返回结果为 {"status": 500, "data": "a exception occur"}
如果controller没有抛出异常 程序返回结果为 {"status": 200, "data": {"id": 2, "name":"xiaolin", "age": 21}}
how to get the value config in application.properties.
controller主要完成的是路由的功能,在controller中写入诸多代码显然是不合理的,使用@ Service注解的Service实现类将业务逻辑代码从controller中提取出来
注意: 更进一步: 1. 使用 @ Service 注解,也就是使用spring提供的依赖注入 2.完全的剥离
本地将原本在主分支master上的代表各个组的文件夹分别拆分到了名称为文件夹名称的分支中
在小组对应的分支中的内容 就是以前小组文件夹内的内容
有问题和有建议等一切问题可以随时评论
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.