1.使用mybatis分页插件时,要注意PageHelper.startPage(pageNum,PAGE_SIZE)的位置
//紧跟在这个方法后的第一个MyBatis 查询方法会被进行分页
PageHelper.startPage(pageNum,PAGE_SIZE);
//所有图书信息返回
List<BookCustom> bookList=libraryService.queryBook(book);
这样查询出来的结果才会被真正分页
2.当使用thymleaf模板时,要注意日期格式的转换,如:
<label>出版日期</label>
<input type="date" name="publishTime" th:value="${#dates.format(bookCustom.publishTime,'yyyy-MM-dd')}">
3.当没有网关时,微服务中除了eureka的其他client的service-url都只能是:defaultZone: http://localhost:8761/eureka/,而不能没有defaultZone修饰
如下图:
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
4.当数据库表中有longtext格式的字段时,逆向工程的xml中的jdbcType必须转为VARCHAR,例如:
5.当数据库字段有和关键字一样时,在增删改查中会报错,必须改成不一样的字段名
查看字段是否重复关键字,匹配官方文档:https://dev.mysql.com/doc/refman/5.7/en/keywords.html#keywords-in-current-series