找回密码
 立即注册
查看: 3|回复: 0

33,@RequestParam(required = false)参数不是必须,不是必填写法

[复制链接]

231

主题

6

精华

235

金币

技术维护QQ:515138

积分
500
发表于 昨天 19:49 | 显示全部楼层 |阅读模式
  1. @GetMapping
  2.     public Result<PageBean<Article>> list(
  3.             Integer pageNum,
  4.             Integer pageSize,
  5.             // 不是必须参数
  6.             @RequestParam(required = false) Integer categoryId,
  7.             @RequestParam(required = false) String state
  8.     ) {
  9.         PageBean<Article> pb =  articleService.list(pageNum,pageSize,categoryId,state);
  10.         return Result.success(pb);
  11.     }
复制代码




上一篇:32,自定义校验
下一篇:34,文章列表(条件分页)pagehelper
网站建设,公众号小程序开发,系统定制,软件App开发,技术维护【联系我们】手机/微信:17817817816 QQ:515138

QQ|Archiver|自丢网 ( 粤ICP备2024252464号-1 )

GMT+8, 2026-3-3 06:49

专注于网站建设,公众号小程序制作,商城小程序,系统定制,软件App开发

【联系我们】手机/微信:17817817816 QQ:515138

快速回复 返回顶部 返回列表