摘要: 使用Fastjson和Springboot的Converter对全局Long类型统一序列化为字符串类型 直接上代码: 序列化类: public class Serialize2String implements ObjectSerializer { public static final Seria 阅读全文
posted @ 2021-10-16 10:05 御简 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 直接上代码: @EnableAsync @Configuration public class AsyncConfig { @Bean public ThreadPoolTaskExecutor threadPoolTaskExecutor() { ThreadPoolTaskExecutor ex 阅读全文
posted @ 2021-10-16 10:00 御简 阅读(76) 评论(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 御简 阅读(47) 评论(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 御简 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 直接上代码: 我们的业务是查询当天、当周、当月、当季、当年的记录,所以结束时间直接使用当前时间,就不贴了。 // 今天的开始public static Date getDayStart() { Calendar calendar = Calendar.getInstance(); calendar. 阅读全文
posted @ 2021-10-16 09:27 御简 阅读(149) 评论(0) 推荐(0) 编辑