10 2021 档案

摘要:使用Fastjson和Springboot的Converter对全局Long类型统一序列化为字符串类型 直接上代码: 序列化类: public class Serialize2String implements ObjectSerializer { public static final Seria 阅读全文
posted @ 2021-10-16 10:05 御简 阅读(478) 评论(0) 推荐(0)
摘要:直接上代码: @EnableAsync @Configuration public class AsyncConfig { @Bean public ThreadPoolTaskExecutor threadPoolTaskExecutor() { ThreadPoolTaskExecutor ex 阅读全文
posted @ 2021-10-16 10:00 御简 阅读(93) 评论(0) 推荐(0)
摘要:数字类型验证:不是数字 或 是负数 返回 true public static boolean isNotNumOrNegative(Number num) { if (num == null) { return true; } if (num instanceof Integer) { int v 阅读全文
posted @ 2021-10-16 09:51 御简 阅读(67) 评论(0) 推荐(0)
摘要:直接上代码: public class HttpUtils { private static final RestTemplate restTemplate = new RestTemplate(); // Get请求 public static String Get(String url, Map 阅读全文
posted @ 2021-10-16 09:40 御简 阅读(409) 评论(0) 推荐(0)
摘要:直接上代码: 我们的业务是查询当天、当周、当月、当季、当年的记录,所以结束时间直接使用当前时间,就不贴了。 // 今天的开始public static Date getDayStart() { Calendar calendar = Calendar.getInstance(); calendar. 阅读全文
posted @ 2021-10-16 09:27 御简 阅读(169) 评论(0) 推荐(0)
摘要:Springboot项目,要求在程序中调用Python代码,获取PDF文件中的图片。 首先把Python代码贴上来(亲测可用): pdf_path是PDF文件路径,pic_path是图片目录,执行会获取PDF文件第一页的图片,保存到pic目录中(这是我们的业务需求)。 import fitz imp 阅读全文
posted @ 2021-10-06 14:43 御简 阅读(1901) 评论(0) 推荐(0)