摘要: 问题 两种计算时间戳的结果不一样。 int days = 30; Instant now = Instant.now(); long timestamp_cur = now.toEpochMilli(); long nowPre = timestamp_cur - 1000 * 60 * 60 * 阅读全文
posted @ 2024-06-05 21:25 jihite 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 设计模式:https://blog.csdn.net/mrluo735/article/details/131600083 阅读全文
posted @ 2024-05-19 16:53 jihite 阅读(6) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/5526d24f04fc 阅读全文
posted @ 2023-12-01 15:23 jihite 阅读(10) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/d7c9b3e68f9a 阅读全文
posted @ 2023-10-23 14:08 jihite 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 示例 @Test void str2arr() { String ids = "1,2,3,4,5,6"; //字符串 --> String数组 String[] arrayStr = ids.split(","); System.out.println(arrayStr); } @Test voi 阅读全文
posted @ 2023-10-15 20:36 jihite 阅读(10) 评论(0) 推荐(0) 编辑
摘要: RestTemplate简介 RestTemplate是执行HTTP请求的同步阻塞式的客户端,它在HTTP客户端库(如JDK HttpURLConnection,Apache HttpComponents,okHttp等)基础封装了更加简单易用的模板方法API。即RestTemplate是一个封装, 阅读全文
posted @ 2023-10-10 21:28 jihite 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 简介 Java并发包提供了一套框架,大大简化了执行异步任务所需要的开发。框架引入了“执行服务”的概念,封装了任务执行的细节,对任务提交者而言,他可以关注任务本身,如提交任务、获取结果、取消任务。而不用关注任务执行的细节。 基本接口 ①Runnable和Callable: 表示要执行的任务 ②Exce 阅读全文
posted @ 2023-10-08 20:17 jihite 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 说明 注解提供方: @Autowired这个由Spring提供;@Resource由JDK提供 区别 ①注解内参数不同 @Autowired只包含一个required参数,默认为true,表示注入的时候,该bean必须存在,否则就会注入失败;required=false,表示忽略当前要注入的bean 阅读全文
posted @ 2023-10-07 22:55 jihite 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1.列表拼接成字符串 #1.1 String result = Joiner.on("_").join(list); #1.2 String result = list.stream().collect(Collectors.joining("_")); 2.Java8的foreach()中使用re 阅读全文
posted @ 2023-08-07 09:36 jihite 阅读(169) 评论(0) 推荐(0) 编辑
摘要: # ? 区别 #{} 使用#{}意味着使用的预编译的语句,即在使用jdbc时的preparedStatement,sql语句中如果存在参数则会使用?作占位符,我们知道这种方式可以防止sql注入,并且在使用#{}时形成的sql语句,已经带有引号,例,select * from table1 where 阅读全文
posted @ 2023-07-06 09:36 jihite 阅读(183) 评论(0) 推荐(0) 编辑