有一个统一的包装的pojo作为回报,例如
Class ApiResult{
boolean success;
String msg;
Object data;
}
在NewsController中
@ApiOperation(value="news paging query", response = NewsVO.class)
public ApiResult list(...){
// ...
List<NewsVO> voList = ...
ApiResult result = new ApiResult()
result.setSuccess(true);
result.setData(voList);
return result;
}
但是我想在swagger-ui模型中用NewsVO显示ApiResult,如何实现?例如
@ApiOperation(value="news paging query", response = NewsVO.class, responseContainer = ApiResult.class)
但是responseContainer
仅支持“列表”,“设置”或“地图”。