内嵌swagger改为城knife4j
This commit is contained in:
parent
2e3eb80b2e
commit
f607e2b9fa
21
pom.xml
21
pom.xml
|
|
@ -31,11 +31,32 @@
|
|||
<commons.io.version>2.13.0</commons.io.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<hutool.version>5.8.22</hutool.version>
|
||||
<knife4j.version>3.0.3</knife4j.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot的依赖配置-->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@
|
|||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>登陆相关接口</p>
|
||||
* @author clunt
|
||||
*/
|
||||
@Api(value = "App*登陆接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/app/login")
|
||||
public class LoginController {
|
||||
|
||||
//密码登陆
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/loginByPhone")
|
||||
@ApiOperation(value = "手机号登陆")
|
||||
public AjaxResult loginByPhone(){
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
// 手机号验证码登陆
|
||||
|
||||
}
|
||||
|
|
@ -15,10 +15,9 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||
@RequestMapping("/tool/swagger")
|
||||
public class SwaggerController extends BaseController
|
||||
{
|
||||
@RequiresPermissions("tool:swagger:view")
|
||||
@GetMapping()
|
||||
public String index()
|
||||
{
|
||||
return redirect("/swagger-ui/index.html");
|
||||
return redirect("/doc.html");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ public class SwaggerConfig
|
|||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:若依管理系统_接口文档")
|
||||
.title("标题:全民脱单_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
.description("描述:全民脱单接口对接...")
|
||||
// 作者信息
|
||||
.contact(new Contact(RuoYiConfig.getName(), null, null))
|
||||
// 版本
|
||||
.version("版本号:" + RuoYiConfig.getVersion())
|
||||
.version("版本号:v1.0.0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,17 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring框架基本的核心工具 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
|
|
|||
|
|
@ -294,6 +294,11 @@ public class ShiroConfig
|
|||
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
|
||||
// 注册相关
|
||||
filterChainDefinitionMap.put("/register", "anon,captchaValidate");
|
||||
// 接口文档
|
||||
filterChainDefinitionMap.put("/tool/swagger", "anon");
|
||||
filterChainDefinitionMap.put("/tool/swagger/**", "anon");
|
||||
// app登陆接口
|
||||
filterChainDefinitionMap.put("/app/login/**", "anon");
|
||||
// 系统权限列表
|
||||
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue