We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
例如如下代码:
lin-cms-spring-boot/src/main/java/io/github/talelin/latticy/controller/cms/AdminController.java
Lines 72 to 78 in 2ff4bf8
我们的项目中的示例代码,但凡碰到分页的相关的传参,都是采用这样的方式定义,将分页的查询参数,定义在了方法参数签名中的,这样虽然比较直观,但无疑增加了代码量。 我们可以封装一个基础分页DTO(例如BasePageDTO),在 DTO 中定义这些属性。如果有额外的参数,可以继承该 DTO。这样既减少了代码量,也提高了代码的封装性。
BasePageDTO
The text was updated successfully, but these errors were encountered:
Get请求参数使用bean接收时会有个问题,此时的参数绑定并不经过jackson,需要增加BindException的异常处理,并且不能自动从snake_case转camelCase,我后来是用一个自定义的ServletModelAttributeMethodProcessor和ServletRequestDataBinder解决的参数绑定。
Sorry, something went wrong.
欢迎提交pr来贡献你的代码!😸
No branches or pull requests
例如如下代码:
lin-cms-spring-boot/src/main/java/io/github/talelin/latticy/controller/cms/AdminController.java
Lines 72 to 78 in 2ff4bf8
我们的项目中的示例代码,但凡碰到分页的相关的传参,都是采用这样的方式定义,将分页的查询参数,定义在了方法参数签名中的,这样虽然比较直观,但无疑增加了代码量。
我们可以封装一个基础分页DTO(例如
BasePageDTO
),在 DTO 中定义这些属性。如果有额外的参数,可以继承该 DTO。这样既减少了代码量,也提高了代码的封装性。The text was updated successfully, but these errors were encountered: