后端
Sun_lightYY
这个作者很懒,什么都没留下…
展开
-
Springboot使用@EnableScheduling实现WebSocket定时器
1、在主类Application类中添加@EnableScheduling注解2、新建一个Controller, 比如此处的AnnounceController, 添加@Component和@Scheduled注解3、设置对应的service,此处我实现的是发送会议通知4、启动后效果:每隔五秒(自定义)发送一个websocket消息,此处先用sout测试输出效果...原创 2021-08-10 12:03:54 · 393 阅读 · 0 评论 -
springboot JPA 实现jpql查询时报错:org.springframework.core.convert.ConverterNotFoundException 解决方案
在接口中写入jpql语句想要查询表中的特定字段,接口中的代码如下: @Query("select unitName, createTime, status, serviceCount, averageEval from UnitDetail") List<UnitDetail> loadUnitDetailList();使用postman测试时,存在错误信息如下:·org.springframework.core.convert.ConversionFailedExcep原创 2021-07-08 17:08:35 · 5357 阅读 · 1 评论