package com.lihua.project.tool.swagger;
import com.lihua.framework.web.controller.BaseController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* swagger 接口
*
* @author ruoyi
*/
@Controller
@RequestMapping("/tool/swagger")
public class SwaggerController extends BaseController
{
@RequiresPermissions("tool:swagger:view")
@GetMapping()
public String index()
{
return redirect("/swagger-ui/index.html");
}
}
重定向改为:/swagger-ui/index.html


该博客内容涉及一个Swagger接口控制器的实现。SwaggerController是Spring MVC的Controller,继承了BaseController。它包含一个需要权限检查的方法`index()`,该方法使用`@RequiresPermissions`注解,并通过重定向到`/swagger-ui/index.html`来展示Swagger UI。

1366

被折叠的 条评论
为什么被折叠?



