摘要: 消息发送 1 ​ 2 @SpringBootTest(classes = MqApplication.class) 3 @RunWith(SpringRunner.class) 4 public class TestSpringBootMQ { 5 @Autowired 6 private Rabb 阅读全文
posted @ 2020-09-09 10:38 小智多磨 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 单例模式是设计模式中比较常见简单的一种,典型双重检测写法如下: public class SingletonClass { ​ private volatile static SingletonClass instance = null; ​ public static SingletonClass 阅读全文
posted @ 2020-08-24 16:10 小智多磨 阅读(528) 评论(0) 推荐(0) 编辑
摘要: springboot问题总结 1.在service的接口上声明@Service还是在service的接口的实现类上声明@Service? 答: `@Service`注解是标注在实现类上的,因为`@Service`是把`spring`容器中的`bean`进行实例化,也就是等同于`new`操作,只有`实 阅读全文
posted @ 2020-08-20 23:11 小智多磨 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1、创建表格时添加: create table tablename(id int auto_increment primary key,...) 2、创建表格后添加: mysql alter table tablename add id int auto_increment primary key 阅读全文
posted @ 2020-08-06 13:50 小智多磨 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 摘要 跨域问题 在前后端交互的时候,会经常出现,对于这种问题,前端和后端都有自己的解决方式; 问题复现 上面出现的问题:前端项目在端口号为8080上部署的,后端项目是在端口号为8181上部署的,如果没有相应的跨域请求的处理,就会出现CORS跨域的问题。 解决方案 后端解决: 解决方法: 在服务端只需 阅读全文
posted @ 2020-08-06 13:46 小智多磨 阅读(1234) 评论(0) 推荐(0) 编辑