Skip to content
New issue

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

返回ModelAndView 类型的接口 无法被扫描到接口文档 #6697

Open
zk020106 opened this issue Jul 4, 2024 · 2 comments
Open

返回ModelAndView 类型的接口 无法被扫描到接口文档 #6697

zk020106 opened this issue Jul 4, 2024 · 2 comments

Comments

@zk020106
Copy link

zk020106 commented Jul 4, 2024

版本号:3.7.0 springboot3
问题描述:

如果接口没有用result返回对象的话 接口文档不会扫描到这个接口的,项目也是放在org.jeecg下面,请问要怎么样才可以返回文件流切让接口文档识别出来
05567cf0614fec23a3fb16c41f39f70a

错误截图:

image

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@EightMonth
Copy link
Contributor

ModelAndView在spring web的定义是跳转页面使用的,如集成了themeleaf\freemarker时可以使用。swagger是用于生成纯数据接口的文档,不生成是正常的。如果需要使用使用两个方法,一个方法用于跳转页面,一个方法用于数据返回,在数据返回的方法中正常使用swagger注解并且使用@responsebody注解进行修饰。

@zk020106
Copy link
Author

ModelAndView在spring web的定义是跳转页面使用的,如集成了themeleaf\freemarker时可以使用。swagger是用于生成纯数据接口的文档,不生成是正常的。如果需要使用使用两个方法,一个方法用于跳转页面,一个方法用于数据返回,在数据返回的方法中正常使用swagger注解并且使用@responsebody注解进行修饰。

但是在上面已经使用了@RestController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants