mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
Compare commits
17 Commits
v3.7.3spri
...
v3.7.3spri
| Author | SHA1 | Date | |
|---|---|---|---|
| 197d7adaaf | |||
| e952518d71 | |||
| 2ba17648c4 | |||
| 36caab37e2 | |||
| 6e721e4120 | |||
| a17b403675 | |||
| 632fd72d79 | |||
| 15fc262675 | |||
| 6768d65e1e | |||
| 410ab7bcc3 | |||
| 174f1ae432 | |||
| eef2f7e269 | |||
| 6a0ec66d3d | |||
| 163b0b531f | |||
| d1af49a33f | |||
| 03265691e6 | |||
| de9cc2f30d |
@ -35,6 +35,12 @@ JeecgBoot 提供了一系列 `AI能力` `低代码模块`,实现在线开发`
|
||||
JeecgBoot AI低代码平台,可以应用在任何J2EE项目的开发中,支持信创国产化(默认适配达梦和人大金仓)。尤其适合SAAS项目、企业信息管理系统(MIS)、内部办公系统(OA)、企业资源计划系统(ERP)、客户关系管理系统(CRM)等,其半智能手工Merge的开发方式,可以显著提高开发效率70%以上,极大降低开发成本。
|
||||
|
||||
|
||||
|
||||
### 视频介绍
|
||||
|
||||
[](https://www.bilibili.com/video/BV1Nk4y1o7Qc)
|
||||
|
||||
|
||||
#### 项目说明
|
||||
|
||||
| 项目名 | 说明 |
|
||||
|
||||
@ -196,6 +196,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring-boot-starter</artifactId>
|
||||
<classifier>jakarta</classifier>
|
||||
<version>${shiro.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package org.jeecg.common.util.encryption;
|
||||
|
||||
import org.apache.shiro.codec.Base64;
|
||||
import org.apache.shiro.lang.codec.Base64;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
|
||||
@ -3,21 +3,45 @@ package org.jeecg.config;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.Paths;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||
import org.springdoc.core.filters.GlobalOpenApiMethodFilter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author eightmonth
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@PropertySource("classpath:config/default-spring-doc.properties")
|
||||
public class Swagger3Config implements WebMvcConfigurer {
|
||||
// 定义不需要注入安全要求的路径集合
|
||||
Set<String> excludedPaths = new HashSet<>(Arrays.asList(
|
||||
"/sys/randomImage/{key}",
|
||||
"/sys/login",
|
||||
"/sys/phoneLogin",
|
||||
"/sys/mLogin",
|
||||
"/sys/sms",
|
||||
"/sys/cas/client/validateLogin",
|
||||
"/test/jeecgDemo/demo3",
|
||||
"/sys/thirdLogin/**",
|
||||
"/sys/user/register"
|
||||
));
|
||||
|
||||
/**
|
||||
*
|
||||
* 显示swagger-ui.html文档展示页,还必须注入swagger资源:
|
||||
@ -32,15 +56,33 @@ public class Swagger3Config implements WebMvcConfigurer {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi swaggerOpenApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("default")
|
||||
.packagesToScan("org.jeecg")
|
||||
// 剔除以下几个包路径的接口生成文档
|
||||
.packagesToExclude("org.jeecg.modules.drag", "org.jeecg.modules.online", "org.jeecg.modules.jmreport")
|
||||
// 加了Operation注解的方法,才生成接口文档
|
||||
.addOpenApiMethodFilter(method -> method.isAnnotationPresent(Operation.class))
|
||||
.build();
|
||||
public GlobalOpenApiMethodFilter globalOpenApiMethodFilter() {
|
||||
return method -> method.isAnnotationPresent(Operation.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GlobalOpenApiCustomizer globalOpenApiCustomizer() {
|
||||
return openApi -> {
|
||||
// 全局添加鉴权参数
|
||||
if (openApi.getPaths() != null) {
|
||||
openApi.getPaths().forEach((path, pathItem) -> {
|
||||
log.info("path: {}", path);
|
||||
// 检查当前路径是否在排除列表中
|
||||
boolean isExcluded = excludedPaths.stream().anyMatch(excludedPath ->
|
||||
excludedPath.equals(path) ||
|
||||
(excludedPath.endsWith("**") && path.startsWith(excludedPath.substring(0, excludedPath.length() - 2)))
|
||||
);
|
||||
|
||||
if (!isExcluded) {
|
||||
// 接口添加鉴权参数
|
||||
pathItem.readOperations()
|
||||
.forEach(operation ->
|
||||
operation.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ -48,12 +90,13 @@ public class Swagger3Config implements WebMvcConfigurer {
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("JeecgBoot 后台服务API接口文档")
|
||||
.version("1.0")
|
||||
.version("3.7.4")
|
||||
.contact(new Contact().name("北京国炬信息技术有限公司").url("www.jeccg.com").email("jeecgos@163.com"))
|
||||
.description( "后台API接口")
|
||||
.termsOfService("NO terms of service")
|
||||
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html"))
|
||||
);
|
||||
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0.html")))
|
||||
.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
|
||||
.components(new Components().addSecuritySchemes(CommonConstant.X_ACCESS_TOKEN,
|
||||
new SecurityScheme().name(CommonConstant.X_ACCESS_TOKEN).type(SecurityScheme.Type.HTTP)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
springdoc.auto-tag-classes: false
|
||||
springdoc.packages-to-scan: org.jeecg
|
||||
@ -27,7 +27,7 @@
|
||||
<!-- 企业微信/钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>jeewx-api</artifactId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
<!-- 积木报表 -->
|
||||
<dependency>
|
||||
|
||||
@ -306,7 +306,6 @@ logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
#开启增强配置
|
||||
enable: true
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
<!-- Swagger API文档 -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-gateway-spring-boot-starter</artifactId>
|
||||
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
|
||||
<version>${knife4j-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@ -1,160 +1,160 @@
|
||||
//package org.jeecg.handler.swagger;
|
||||
//
|
||||
//import cn.hutool.core.util.ArrayUtil;
|
||||
//import cn.hutool.core.util.ObjectUtil;
|
||||
//import com.alibaba.nacos.api.naming.NamingFactory;
|
||||
//import com.alibaba.nacos.api.naming.NamingService;
|
||||
//import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
//import org.springframework.context.annotation.Primary;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import springfox.documentation.swagger.web.SwaggerResource;
|
||||
//import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
||||
//
|
||||
//import java.util.*;
|
||||
//
|
||||
///** 已使用knife4j-gateway支持该功能
|
||||
// * 聚合各个服务的swagger接口
|
||||
// * @author zyf
|
||||
// * @date: 2022/4/21 10:55
|
||||
// */
|
||||
//@Component
|
||||
//@Slf4j
|
||||
//@Primary
|
||||
//public class MySwaggerResourceProvider implements SwaggerResourcesProvider {
|
||||
// /**
|
||||
// * swagger2默认的url后缀
|
||||
// */
|
||||
// private static final String SWAGGER2URL = "/v2/api-docs";
|
||||
//
|
||||
// /**
|
||||
// * 网关路由
|
||||
// */
|
||||
// private final RouteLocator routeLocator;
|
||||
// /**
|
||||
// * Nacos名字服务
|
||||
// */
|
||||
// private NamingService naming;
|
||||
//
|
||||
// /**
|
||||
// * nacos服务地址
|
||||
// */
|
||||
// @Value("${spring.cloud.nacos.discovery.server-addr}")
|
||||
// private String serverAddr;
|
||||
// /**
|
||||
// * nacos namespace
|
||||
// */
|
||||
// @Value("${spring.cloud.nacos.discovery.namespace:#{null}}")
|
||||
// private String namespace;
|
||||
//
|
||||
// /**
|
||||
// * nacos groupName
|
||||
// */
|
||||
// @Value("${spring.cloud.nacos.config.group:DEFAULT_GROUP:#{null}}")
|
||||
// private String group;
|
||||
//
|
||||
// /**
|
||||
// * nacos username
|
||||
// */
|
||||
// @Value("${spring.cloud.nacos.discovery.username:#{null}}")
|
||||
// private String username;
|
||||
// /**
|
||||
// * nacos password
|
||||
// */
|
||||
// @Value("${spring.cloud.nacos.discovery.password:#{null}}")
|
||||
// private String password;
|
||||
//
|
||||
// /**
|
||||
// * Swagger中需要排除的服务
|
||||
// */
|
||||
// private String[] excludeServiceIds=new String[]{"jeecg-cloud-monitor"};
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 网关应用名称
|
||||
// */
|
||||
// @Value("${spring.application.name}")
|
||||
// private String self;
|
||||
//
|
||||
// @Autowired
|
||||
// public MySwaggerResourceProvider(RouteLocator routeLocator) {
|
||||
// this.routeLocator = routeLocator;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SwaggerResource> get() {
|
||||
// List<SwaggerResource> resources = new ArrayList<>();
|
||||
// List<String> routeHosts = new ArrayList<>();
|
||||
// // 获取所有可用的host:serviceId
|
||||
// routeLocator.getRoutes().filter(route -> route.getUri().getHost() != null)
|
||||
// .filter(route -> !self.equals(route.getUri().getHost()))
|
||||
// .subscribe(route ->{
|
||||
// //update-begin---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
// boolean hasRoute=checkRoute(route.getId());
|
||||
// if(hasRoute){
|
||||
// routeHosts.add(route.getUri().getHost());
|
||||
// }
|
||||
// //update-end---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
// });
|
||||
//
|
||||
// // 记录已经添加过的server,存在同一个应用注册了多个服务在nacos上
|
||||
// Set<String> dealed = new HashSet<>();
|
||||
// routeHosts.forEach(instance -> {
|
||||
// // 拼接url
|
||||
// String url = "/" + instance.toLowerCase() + SWAGGER2URL;
|
||||
// if (!dealed.contains(url)) {
|
||||
// dealed.add(url);
|
||||
// log.info(" Gateway add SwaggerResource: {}",url);
|
||||
// SwaggerResource swaggerResource = new SwaggerResource();
|
||||
// swaggerResource.setUrl(url);
|
||||
// swaggerResource.setSwaggerVersion("2.0");
|
||||
// swaggerResource.setName(instance);
|
||||
// //Swagger排除不展示的服务
|
||||
// if(!ArrayUtil.contains(excludeServiceIds,instance)){
|
||||
// resources.add(swaggerResource);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// return resources;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 检测nacos中是否有健康实例
|
||||
// * @param routeId
|
||||
// * @return
|
||||
// */
|
||||
// private Boolean checkRoute(String routeId) {
|
||||
// Boolean hasRoute = false;
|
||||
// try {
|
||||
// //修复使用带命名空间启动网关swagger看不到接口文档的问题
|
||||
// Properties properties=new Properties();
|
||||
// properties.setProperty("serverAddr",serverAddr);
|
||||
// if(namespace!=null && !"".equals(namespace)){
|
||||
// log.info("nacos.discovery.namespace = {}", namespace);
|
||||
// properties.setProperty("namespace",namespace);
|
||||
// }
|
||||
// if(username!=null && !"".equals(username)){
|
||||
// properties.setProperty("username",username);
|
||||
// }
|
||||
// if(password!=null && !"".equals(password)){
|
||||
// properties.setProperty("password",password);
|
||||
// }
|
||||
// //【issues/5115】因swagger文档导致gateway内存溢出
|
||||
// if (this.naming == null) {
|
||||
// this.naming = NamingFactory.createNamingService(properties);
|
||||
// }
|
||||
// log.info(" config.group : {}", group);
|
||||
// List<Instance> list = this.naming.selectInstances(routeId, group , true);
|
||||
// if (ObjectUtil.isNotEmpty(list)) {
|
||||
// hasRoute = true;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return hasRoute;
|
||||
// }
|
||||
//}
|
||||
package org.jeecg.handler.swagger;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.nacos.api.naming.NamingFactory;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import springfox.documentation.swagger.web.SwaggerResource;
|
||||
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/** 已使用knife4j-gateway支持该功能
|
||||
* 聚合各个服务的swagger接口
|
||||
* @author zyf
|
||||
* @date: 2022/4/21 10:55
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Primary
|
||||
public class MySwaggerResourceProvider implements SwaggerResourcesProvider {
|
||||
/**
|
||||
* swagger2默认的url后缀
|
||||
*/
|
||||
private static final String SWAGGER2URL = "/v3/api-docs";
|
||||
|
||||
/**
|
||||
* 网关路由
|
||||
*/
|
||||
private final RouteLocator routeLocator;
|
||||
/**
|
||||
* Nacos名字服务
|
||||
*/
|
||||
private NamingService naming;
|
||||
|
||||
/**
|
||||
* nacos服务地址
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.discovery.server-addr}")
|
||||
private String serverAddr;
|
||||
/**
|
||||
* nacos namespace
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.discovery.namespace:#{null}}")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
* nacos groupName
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.config.group:DEFAULT_GROUP:#{null}}")
|
||||
private String group;
|
||||
|
||||
/**
|
||||
* nacos username
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.discovery.username:#{null}}")
|
||||
private String username;
|
||||
/**
|
||||
* nacos password
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.discovery.password:#{null}}")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* Swagger中需要排除的服务
|
||||
*/
|
||||
private String[] excludeServiceIds=new String[]{"jeecg-cloud-monitor"};
|
||||
|
||||
|
||||
/**
|
||||
* 网关应用名称
|
||||
*/
|
||||
@Value("${spring.application.name}")
|
||||
private String self;
|
||||
|
||||
@Autowired
|
||||
public MySwaggerResourceProvider(RouteLocator routeLocator) {
|
||||
this.routeLocator = routeLocator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SwaggerResource> get() {
|
||||
List<SwaggerResource> resources = new ArrayList<>();
|
||||
List<String> routeHosts = new ArrayList<>();
|
||||
// 获取所有可用的host:serviceId
|
||||
routeLocator.getRoutes().filter(route -> route.getUri().getHost() != null)
|
||||
.filter(route -> !self.equals(route.getUri().getHost()))
|
||||
.subscribe(route ->{
|
||||
//update-begin---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
boolean hasRoute=checkRoute(route.getId());
|
||||
if(hasRoute){
|
||||
routeHosts.add(route.getUri().getHost());
|
||||
}
|
||||
//update-end---author:zyf ---date:20220413 for:过滤掉无效路由,避免接口文档报错无法打开
|
||||
});
|
||||
|
||||
// 记录已经添加过的server,存在同一个应用注册了多个服务在nacos上
|
||||
Set<String> dealed = new HashSet<>();
|
||||
routeHosts.forEach(instance -> {
|
||||
// 拼接url
|
||||
String url = "/" + instance.toLowerCase() + SWAGGER2URL;
|
||||
if (!dealed.contains(url)) {
|
||||
dealed.add(url);
|
||||
log.info(" Gateway add SwaggerResource: {}",url);
|
||||
SwaggerResource swaggerResource = new SwaggerResource();
|
||||
swaggerResource.setUrl(url);
|
||||
swaggerResource.setSwaggerVersion("2.0");
|
||||
swaggerResource.setName(instance);
|
||||
//Swagger排除不展示的服务
|
||||
if(!ArrayUtil.contains(excludeServiceIds,instance)){
|
||||
resources.add(swaggerResource);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测nacos中是否有健康实例
|
||||
* @param routeId
|
||||
* @return
|
||||
*/
|
||||
private Boolean checkRoute(String routeId) {
|
||||
Boolean hasRoute = false;
|
||||
try {
|
||||
//修复使用带命名空间启动网关swagger看不到接口文档的问题
|
||||
Properties properties=new Properties();
|
||||
properties.setProperty("serverAddr",serverAddr);
|
||||
if(namespace!=null && !"".equals(namespace)){
|
||||
log.info("nacos.discovery.namespace = {}", namespace);
|
||||
properties.setProperty("namespace",namespace);
|
||||
}
|
||||
if(username!=null && !"".equals(username)){
|
||||
properties.setProperty("username",username);
|
||||
}
|
||||
if(password!=null && !"".equals(password)){
|
||||
properties.setProperty("password",password);
|
||||
}
|
||||
//【issues/5115】因swagger文档导致gateway内存溢出
|
||||
if (this.naming == null) {
|
||||
this.naming = NamingFactory.createNamingService(properties);
|
||||
}
|
||||
log.info(" config.group : {}", group);
|
||||
List<Instance> list = this.naming.selectInstances(routeId, group , true);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
hasRoute = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return hasRoute;
|
||||
}
|
||||
}
|
||||
@ -1,41 +1,41 @@
|
||||
//package org.jeecg.handler.swagger;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.http.HttpStatus;
|
||||
//import org.springframework.http.ResponseEntity;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//import springfox.documentation.swagger.web.*;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///** 已使用knife4j-gateway支持该功能
|
||||
// * swagger聚合接口,三个接口都是 doc.html需要访问的接口
|
||||
// * @author zyf
|
||||
// * @date: 2022/4/21 10:55
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/swagger-resources")
|
||||
//public class SwaggerResourceController {
|
||||
// private MySwaggerResourceProvider swaggerResourceProvider;
|
||||
//
|
||||
// @Autowired
|
||||
// public SwaggerResourceController(MySwaggerResourceProvider swaggerResourceProvider) {
|
||||
// this.swaggerResourceProvider = swaggerResourceProvider;
|
||||
// }
|
||||
//
|
||||
// @RequestMapping(value = "/configuration/security")
|
||||
// public ResponseEntity<SecurityConfiguration> securityConfiguration() {
|
||||
// return new ResponseEntity<>(SecurityConfigurationBuilder.builder().build(), HttpStatus.OK);
|
||||
// }
|
||||
//
|
||||
// @RequestMapping(value = "/configuration/ui")
|
||||
// public ResponseEntity<UiConfiguration> uiConfiguration() {
|
||||
// return new ResponseEntity<>(UiConfigurationBuilder.builder().build(), HttpStatus.OK);
|
||||
// }
|
||||
//
|
||||
// @RequestMapping
|
||||
// public ResponseEntity<List<SwaggerResource>> swaggerResources() {
|
||||
// return new ResponseEntity<>(swaggerResourceProvider.get(), HttpStatus.OK);
|
||||
// }
|
||||
//}
|
||||
package org.jeecg.handler.swagger;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.swagger.web.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** 已使用knife4j-gateway支持该功能
|
||||
* swagger聚合接口,三个接口都是 doc.html需要访问的接口
|
||||
* @author zyf
|
||||
* @date: 2022/4/21 10:55
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/swagger-resources")
|
||||
public class SwaggerResourceController {
|
||||
private MySwaggerResourceProvider swaggerResourceProvider;
|
||||
|
||||
@Autowired
|
||||
public SwaggerResourceController(MySwaggerResourceProvider swaggerResourceProvider) {
|
||||
this.swaggerResourceProvider = swaggerResourceProvider;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/configuration/security")
|
||||
public ResponseEntity<SecurityConfiguration> securityConfiguration() {
|
||||
return new ResponseEntity<>(SecurityConfigurationBuilder.builder().build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/configuration/ui")
|
||||
public ResponseEntity<UiConfiguration> uiConfiguration() {
|
||||
return new ResponseEntity<>(UiConfigurationBuilder.builder().build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@RequestMapping
|
||||
public ResponseEntity<List<SwaggerResource>> swaggerResources() {
|
||||
return new ResponseEntity<>(swaggerResourceProvider.get(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@ -53,20 +53,19 @@
|
||||
<kingbase8.version>9.0.0</kingbase8.version>
|
||||
<dm8.version>8.1.1.49</dm8.version>
|
||||
|
||||
|
||||
<!-- 积木报表-->
|
||||
<jimureport-spring-boot-starter.version>1.9.4</jimureport-spring-boot-starter.version>
|
||||
<!-- 持久层 -->
|
||||
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
|
||||
<dynamic-datasource-spring-boot-starter.version>4.1.3</dynamic-datasource-spring-boot-starter.version>
|
||||
<druid.version>1.2.22</druid.version>
|
||||
<druid.version>1.2.24</druid.version>
|
||||
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons.version>2.6</commons.version>
|
||||
<aliyun-java-sdk-dysmsapi.version>2.1.0</aliyun-java-sdk-dysmsapi.version>
|
||||
<aliyun.oss.version>3.17.3</aliyun.oss.version>
|
||||
<!-- shiro -->
|
||||
<shiro.version>1.12.0</shiro.version>
|
||||
<shiro.version>2.0.4</shiro.version>
|
||||
<java-jwt.version>3.11.0</java-jwt.version>
|
||||
<shiro-redis.version>3.2.2</shiro-redis.version>
|
||||
<codegenerate.version>1.4.9</codegenerate.version>
|
||||
@ -79,8 +78,8 @@
|
||||
<baidu-java-sdk.version>4.16.19</baidu-java-sdk.version>
|
||||
<!-- Log4j2爆雷漏洞 -->
|
||||
<!-- spring boot 3 不支持下列两个版本-->
|
||||
<!--<log4j2.version>2.17.0</log4j2.version>
|
||||
<logback.version>1.2.9</logback.version>-->
|
||||
<!--<log4j2.version>2.17.0</log4j2.version>-->
|
||||
<logback.version>1.4.12</logback.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
@ -384,8 +383,8 @@
|
||||
<!-- 企业微信和钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>jeewx-api</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
@ -428,7 +427,13 @@
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.jimureport</groupId>
|
||||
<artifactId>jimureport-nosql-starter</artifactId>
|
||||
<version>${jimureport-spring-boot-starter.version}</version>
|
||||
<version>1.9.4.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.calcite</groupId>
|
||||
<artifactId>calcite-elasticsearch</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 积木BI大屏和仪表盘 -->
|
||||
<dependency>
|
||||
@ -442,7 +447,6 @@
|
||||
<artifactId>jeecg-boot-starter3-chatgpt</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--flyway 支持 mysql5.7+、MariaDB10.3.16-->
|
||||
<!--mysql5.6,需要把版本号改成5.2.1-->
|
||||
<dependency>
|
||||
|
||||
Reference in New Issue
Block a user