摘要:
一、计时器的使用 Stopwatch start = Stopwatch.createStarted().start(); // do something //可以使用不同的时间单位 start.elapsed(TimeUnit.HOURS); 阅读全文
摘要:
一、Live Template 之模板代码 1.定义filed 如果在每个类中,都要添加日志字段,那么就可以使用Live Template 快捷方式可以为pl private Logger logger = LoggerFactory.getLogger(this.getClass()); 二、Id 阅读全文
摘要:
一、全局异常处理之注解方式 主要用到的注解有2个 @ControllerAdvice 用在Controller类级别上,可看做是一个增强的Controller @ExceptionHandler 用到Controller中具体的方法上,表明这个方法处理的具体某个异常类型 我们一般在捕获到异常的时候, 阅读全文