摘要: 1.常用代码 2.好的功能性代码 和设计 3.bug记录 4.项目经验 5.代码库 二、开发便捷 表代码生成 D:\learnCode\test D:\javaCode\selfCode\gieee\superstars easycode 3、导入excel根据日志输出sql D:\learnCod 阅读全文
posted @ 2022-07-05 13:27 爱生活(^_-) 阅读(40) 评论(0) 推荐(0)
摘要: ### 一、mysql #### 1.1 建表语句(含索引) ```java DROP TABLE IF EXISTS `VEHICLE_BRAND`; CREATE TABLE `admin_bu` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `admin 阅读全文
posted @ 2022-04-28 15:35 爱生活(^_-) 阅读(114) 评论(0) 推荐(0)
摘要: 核心代码库 cool 核心代码库 D:\learnCode\cool 过去临时使用的 D:\learnCode\smallTool 一、Controller import com.ne.boot.common.entity.Page; import com.ne.boot.common.entity 阅读全文
posted @ 2022-04-28 13:33 爱生活(^_-) 阅读(76) 评论(0) 推荐(0)
摘要: ## 1、isPresent 使用isPresent方法来判断非空,isPresent相当于!=null isPresent 返回一个boolean ``` Optional optional = Optional.ofNullable(new Student("王五", 80)); if (opt 阅读全文
posted @ 2023-06-20 15:15 爱生活(^_-) 阅读(93) 评论(0) 推荐(0)
摘要: ## 1、三目表达式 获取对象的属性,判断对象是否为空,为空返回默认值 ``` C c = new C("c"); String name = c != null ? c.getName() :DEFAULT_NAME; ``` ## 2、判断不为空再赋值 ``` User user = userD 阅读全文
posted @ 2023-06-20 15:05 爱生活(^_-) 阅读(70) 评论(0) 推荐(0)
摘要: 常量 contants 采用接口(Interface)中变量默认为static final的特性 public interface Constants { String LOGIN_KEY = "OTA:VEHICLE:LOGIN"; } public final static String OTA 阅读全文
posted @ 2023-04-12 14:14 爱生活(^_-) 阅读(20) 评论(0) 推荐(0)
摘要: 项目启动 -Dspring.profiles.active=dev 日志 log.error("[滴滴取消订单]-leecancelDidiOrder-订单编号:{},异常信息:{}", orderNo, Throwables.getStackTraceAsString(e)); <dependen 阅读全文
posted @ 2023-04-12 14:09 爱生活(^_-) 阅读(26) 评论(0) 推荐(0)
摘要: Map entrySet遍历,在键和值都需要时使用(最常用) Map<Integer, Integer> map = new HashMap<Integer, Integer>(); map.put(1, 2); for (Map.Entry<Integer, Integer> entry : ma 阅读全文
posted @ 2023-04-12 14:06 爱生活(^_-) 阅读(39) 评论(0) 推荐(0)
摘要: import cn.hutool.core.date.DateUtil; /** * DatePattern * DatePattern.NORM_DATE_PATTERN = "yyyy-MM-dd"; * * DatePattern.NORM_DATETIME_PATTERN = "yyyy-M 阅读全文
posted @ 2023-04-12 09:46 爱生活(^_-) 阅读(33) 评论(0) 推荐(0)
摘要: Kafka 是一个多分区、多副本且基于 ZooKeeper 协调的分布式消息系统 Kafka 之所以受到越来越多的青睐,与它所“扮演”的三大角色是分不开的: 消息系统: Kafka 和传统的消息中间件都具备系统解耦、冗余存储、流量削峰、缓冲、异步通信、扩展性、可恢复性等功能。与此同时,Kafka 还 阅读全文
posted @ 2022-10-18 08:50 爱生活(^_-) 阅读(45) 评论(0) 推荐(0)
摘要: 第一周【10.3 -- 10.9】 10.8 输出日志到文件 thread项目多线程加强 如果配置多个线程池,使用时需要指定。如果只有一个线程池,则无需指定 第三周【10.17 -- 10.23】 初识Kafka (10.18 & 10.19) 查询结果作为参数在更新 update left joi 阅读全文
posted @ 2022-10-08 21:50 爱生活(^_-) 阅读(19) 评论(0) 推荐(0)
摘要: Spring,hutool 工具库和 Apache common 工具包都提供了各自的 StopWatch // 创建一个 StopWatch 实例 StopWatch sw = new StopWatch("沉默王二是傻 X"); // 开始计时 sw.start("任务1"); Thread.s 阅读全文
posted @ 2022-10-08 16:22 爱生活(^_-) 阅读(153) 评论(0) 推荐(0)
摘要: 项目中使用RestTemplate 通常会有如下使用,加上@LoadBalanced注解使restTemplate具有负载均衡能力 @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); } openf 阅读全文
posted @ 2022-09-29 15:03 爱生活(^_-) 阅读(28) 评论(0) 推荐(0)