springboot基础篇“结尾”
springboot基础篇整合:

总结;
在实体类中设注解@Data,首先的在pom.xml中导入lombok的jar包
优点:简化。

dao继承BaseMapper,设置@mapper
为什么要加上@mapper:
在编译之后会生成相应的接口实现类
https://blog.csdn.net/manchengpiaoxue/article/details/84937257
dao测试类;

@Autowired注入
继承了BaseMapper就可以实现立面的方法,立面会有方法可以点开查看
service(数据接口)层:
使用@Service
https://blog.csdn.net/wrs120/article/details/80468174
只是用来表示此类是业务层组件
使用mybatis-plus接口:

https://blog.csdn.net/weixin_38111957/article/details/92415413
实现类定义:

关于:ServiceImpl
https://www.kmw.com/news/2963199.html
继承IService立面有层删改的方法,直接调用即可
contrller(控制层/表示层):

@RequestMapping用来映射请求
@Controller注入到spring容器中
@Component:spring容器管理
增删改查有对应的请求:
https://blog.csdn.net/qq_37924905/article/details/109137866
@SpringBootApplication注解:
https://blog.csdn.net/qq_28289405/article/details/81302498
https://www.jianshu.com/p/39ee4f98575c
使用restful风格:
它是一种软件架构风格、设计风格,而不是标准,只是提供了一组设计原则和约束条件,它主要用于客户端和服务端交互类的软件。基于这个风格设计的软件可以更简介,更有层次,更易于实现缓存等机制。
https://blog.csdn.net/qq_27026603/article/details/82012277
https://zhuanlan.zhihu.com/p/97507715
创建Mybatis拦截器:

拦截器:

最后test测试包下的包必须和上面的包一样,不然运行报错!


浙公网安备 33010602011771号