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
本篇文章种有一部分讲述有关自定义响应消息的代码如下
.useDefaultResponseMessages(false) .globalResponseMessage(RequestMethod.GET, newArrayList( new ResponseMessageBuilder() .code(500) .message("服务器发生异常") .responseModel(new ModelRef("Error")) .build(), new ResponseMessageBuilder() .code(403) .message("资源不可用") .build() ));
如果直接复制,会报以下错误。 Cannot resolve constructor 'ArrayList(springfox.documentation.service.ResponseMessage, springfox.documentation.service.ResponseMessage)'
Cannot resolve constructor 'ArrayList(springfox.documentation.service.ResponseMessage, springfox.documentation.service.ResponseMessage)'
应该是ArrayList的初始化问题
我做了如下修改
.useDefaultResponseMessages(false) .globalResponseMessage(RequestMethod.GET, new ArrayList() {{ add(new ResponseMessageBuilder() .code(500) .message("服务器发生异常") .responseModel(new ModelRef("Error")) .build()); add(new ResponseMessageBuilder() .code(403) .message("资源不可用") .build()); }})
问题解决。不知道是不是代码有问题,如果有问题希望可以起到一些帮助作用,如果是我理解有误,希望可以得到指正。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
本篇文章种有一部分讲述有关自定义响应消息的代码如下
如果直接复制,会报以下错误。
Cannot resolve constructor 'ArrayList(springfox.documentation.service.ResponseMessage, springfox.documentation.service.ResponseMessage)'
应该是ArrayList的初始化问题
我做了如下修改
问题解决。不知道是不是代码有问题,如果有问题希望可以起到一些帮助作用,如果是我理解有误,希望可以得到指正。
The text was updated successfully, but these errors were encountered: