
spring
youngerTree
热爱技术、热爱开发
展开
-
Spring boot设置定时器类的简单方法
直接上代码: package com.ismartgo.uqcode.schedule; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotat...原创 2019-06-10 20:56:36 · 805 阅读 · 0 评论 -
Spring cache常用注解
上面文章从spring boot + spring cache + redis搭建了一个例子,这篇文章主要讲解spring cache常用注解的使用。 而spring cache的常用注解有:@Cacheable、@CachePut、@CacheEvict。 @Cacheable、@CachePut、@CacheEvict 注释介绍 通过上面的例子,我们可以看到 spring cache 主...原创 2019-08-13 20:44:21 · 287 阅读 · 0 评论 -
Spring如何注入静态的bean
在日常开发中某些工具类的静态方法需要使用到service或者dao,而java的语法要求静态方方法的只能调用静态变量,下面为注入静态bean的例子。 /** * @author zsy */ @Component public class WxghOnceMsgHelper { private static EpMsgSendRecordMapper msgSendRecordMapp...原创 2019-08-13 20:48:27 · 611 阅读 · 0 评论