![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
工具类
各种类型的工具类,一次写完,多次使用
臧初之
有时候,总想记录点什么东西
展开
-
[DateUtils]时间工具类:获取系统时间并且转换为能存入MySQL的datetime的格式
package cn.imu.utils;import java.sql.Timestamp;import java.util.Date;public class DateUtils { /** * 获取系统时间并且转换为能存入MySQL的datetime的格式 * @return timestamp(能存入MySQL) */ public static Timestamp nowDateTime(){ //获取系统当前时间,格式:原创 2021-06-20 20:45:22 · 406 阅读 · 0 评论 -
[Redis]基于自定义RedisTemplate<String, Object>的RedisUtil工具类
package cn.imu.utils;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.data.redis.core.RedisTemplate;import org.springframework.stereotype.Component;import org.springframework.util.CollectionUtils;import java.u转载 2021-06-20 20:42:10 · 519 阅读 · 0 评论 -
[Redis]自定义RedisTemplate<String,Object>的模版
Bean配置文件如下: @Bean public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory redisConnectionFactory){ //为了开发方便,一般直接使用<String,Object> RedisTemplate<String,Object> template=new RedisTemplate<>();原创 2021-06-20 17:03:48 · 1710 阅读 · 0 评论