伙伴匹配系统踩坑日记8 controller传参
后端
参数映射
在swagger里传空值,发现有问题
在方法中加入@requestparam注解
@GetMapping("search/tags")
public BaseResponse<List<User>> searchusersByTags(@RequestParam List<String> tagNameList){
if(CollectionUtils.isEmpty(tagNameList)){
throw new BusinessException(ErrorCode.PARAMS_ERROR);
}
List<User> userList=userService.searchUsersByTags(tagNameList);
return ResultUtils.success(userList);
}
关于RequestParam注解,见https://blog.csdn.net/qq_61668277/article/details/140857451
标签:传参,RequestParam,tagNameList,userList,controller,日记 From: https://www.cnblogs.com/vastjoy/p/18378774