From 1d3ca3805243e83a7cc72462fee0155cb9215a1e Mon Sep 17 00:00:00 2001 From: huangge1199 Date: Thu, 13 Mar 2025 15:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E7=89=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 158 ++++++++++++++++++ src/main/java/com/huangge1199/App.java | 11 ++ src/main/java/com/huangge1199/base/R.java | 116 +++++++++++++ .../huangge1199/config/DataSourceConfig.java | 42 +++++ .../com/huangge1199/config/SwaggerConfig.java | 50 ++++++ .../com/huangge1199/config/SysConfig.java | 111 ++++++++++++ .../com/huangge1199/contant/HttpStatus.java | 94 +++++++++++ .../controller/DatabaseController.java | 66 ++++++++ .../huangge1199/dao/UserTabCommentsDao.java | 28 ++++ .../huangge1199/domain/UserTabComments.java | 27 +++ .../huangge1199/service/IDatabaseService.java | 22 +++ .../service/impl/DatabaseServiceImpl.java | 85 ++++++++++ src/main/resources/application-druid.yml | 61 +++++++ src/main/resources/application.yml | 70 ++++++++ 14 files changed, 941 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/huangge1199/App.java create mode 100644 src/main/java/com/huangge1199/base/R.java create mode 100644 src/main/java/com/huangge1199/config/DataSourceConfig.java create mode 100644 src/main/java/com/huangge1199/config/SwaggerConfig.java create mode 100644 src/main/java/com/huangge1199/config/SysConfig.java create mode 100644 src/main/java/com/huangge1199/contant/HttpStatus.java create mode 100644 src/main/java/com/huangge1199/controller/DatabaseController.java create mode 100644 src/main/java/com/huangge1199/dao/UserTabCommentsDao.java create mode 100644 src/main/java/com/huangge1199/domain/UserTabComments.java create mode 100644 src/main/java/com/huangge1199/service/IDatabaseService.java create mode 100644 src/main/java/com/huangge1199/service/impl/DatabaseServiceImpl.java create mode 100644 src/main/resources/application-druid.yml create mode 100644 src/main/resources/application.yml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d7412c5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,158 @@ + + + 4.0.0 + + com.huangge1199 + bi + 1.0-SNAPSHOT + jar + + bi + + + org.springframework.boot + spring-boot-starter-parent + 2.5.15 + + + + + UTF-8 + UTF-8 + 1.8 + 3.1.1 + 2.0.53 + 1.2.23 + 3.0.0 + 19.3.0.0 + + + + + + + + org.springframework.boot + spring-boot-starter + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + com.oracle.ojdbc + ojdbc8 + ${oracle.version} + + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + + com.alibaba.fastjson2 + fastjson2 + ${fastjson.version} + + + + + io.springfox + springfox-boot-starter + ${swagger.version} + + + io.swagger + swagger-models + + + + + + + io.swagger + swagger-models + 1.6.2 + + + + + com.github.xiaoymin + knife4j-spring-boot-starter + + 3.0.3 + + + + + org.projectlombok + lombok + provided + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public + + true + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public + + true + + + false + + + + + diff --git a/src/main/java/com/huangge1199/App.java b/src/main/java/com/huangge1199/App.java new file mode 100644 index 0000000..20dc213 --- /dev/null +++ b/src/main/java/com/huangge1199/App.java @@ -0,0 +1,11 @@ +package com.huangge1199; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class App { + public static void main(String[] args) { + SpringApplication.run(App.class, args); + } +} diff --git a/src/main/java/com/huangge1199/base/R.java b/src/main/java/com/huangge1199/base/R.java new file mode 100644 index 0000000..252ed39 --- /dev/null +++ b/src/main/java/com/huangge1199/base/R.java @@ -0,0 +1,116 @@ +package com.huangge1199.base; + +import com.huangge1199.contant.HttpStatus; + +import java.io.Serializable; + +/** + * 响应信息主体 + * + * @author ruoyi + */ +public class R implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 成功 */ + public static final int SUCCESS = HttpStatus.SUCCESS; + + /** 失败 */ + public static final int FAIL = HttpStatus.ERROR; + + private int code; + + private String msg; + + private T data; + + public static R ok() + { + return restResult(null, SUCCESS, "操作成功"); + } + + public static R ok(T data) + { + return restResult(data, SUCCESS, "操作成功"); + } + + public static R ok(T data, String msg) + { + return restResult(data, SUCCESS, msg); + } + + public static R fail() + { + return restResult(null, FAIL, "操作失败"); + } + + public static R fail(String msg) + { + return restResult(null, FAIL, msg); + } + + public static R fail(T data) + { + return restResult(data, FAIL, "操作失败"); + } + + public static R fail(T data, String msg) + { + return restResult(data, FAIL, msg); + } + + public static R fail(int code, String msg) + { + return restResult(null, code, msg); + } + + private static R restResult(T data, int code, String msg) + { + R apiResult = new R<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMsg(msg); + return apiResult; + } + + public int getCode() + { + return code; + } + + public void setCode(int code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public T getData() + { + return data; + } + + public void setData(T data) + { + this.data = data; + } + + public static Boolean isError(R ret) + { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) + { + return R.SUCCESS == ret.getCode(); + } +} diff --git a/src/main/java/com/huangge1199/config/DataSourceConfig.java b/src/main/java/com/huangge1199/config/DataSourceConfig.java new file mode 100644 index 0000000..d8db3c9 --- /dev/null +++ b/src/main/java/com/huangge1199/config/DataSourceConfig.java @@ -0,0 +1,42 @@ +package com.huangge1199.config; + +import com.alibaba.druid.pool.DruidDataSource; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +import javax.sql.DataSource; + +/** + * DataSourceConfig + * + * @author huangge1199 + * @since 2025/3/12 14:56:10 + */ +@Configuration +public class DataSourceConfig { + + @Primary // 指定主数据源 + @Bean(name = "masterDataSource") + public DataSource masterDataSource() { + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setUrl("jdbc:oracle:thin:@192.168.188.2:1521/xe"); + dataSource.setUsername("ruoyi"); + dataSource.setPassword("ruoyi"); + dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver"); + return dataSource; + } + + // 仅当 enabled = true 时才启用从库数据源 + @Bean(name = "slaveDataSource") + @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true") + public DataSource slaveDataSource() { + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setUrl("jdbc:oracle:thin:@192.168.188.2:1521/xe"); // 修改为实际的从库地址 + dataSource.setUsername("slave_user"); + dataSource.setPassword("slave_password"); + dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver"); + return dataSource; + } +} diff --git a/src/main/java/com/huangge1199/config/SwaggerConfig.java b/src/main/java/com/huangge1199/config/SwaggerConfig.java new file mode 100644 index 0000000..7ec2014 --- /dev/null +++ b/src/main/java/com/huangge1199/config/SwaggerConfig.java @@ -0,0 +1,50 @@ +package com.huangge1199.config; + +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.*; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.contexts.SecurityContext; +import springfox.documentation.spring.web.plugins.Docket; + +import java.util.ArrayList; +import java.util.List; + +/** + * Swagger2的接口配置 + * + * @author ruoyi + */ +@Configuration +public class SwaggerConfig +{ + + @Bean + public Docket api() { + return new Docket(DocumentationType.OAS_30) // OAS_30 代表 OpenAPI 3.0 + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage("com.huangge1199.controller")) // 修改为你的 Controller 包路径 + .paths(PathSelectors.any()) + .build(); + } + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() + { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + .title("Spring Boot API 文档") + .description("基于 Swagger3 + Knife4j 的 API 文档") + .version("1.0.0") + .build(); + } +} diff --git a/src/main/java/com/huangge1199/config/SysConfig.java b/src/main/java/com/huangge1199/config/SysConfig.java new file mode 100644 index 0000000..797f45b --- /dev/null +++ b/src/main/java/com/huangge1199/config/SysConfig.java @@ -0,0 +1,111 @@ +package com.huangge1199.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取项目相关配置 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "sys") +public class SysConfig +{ + /** 项目名称 */ + private String name; + + /** 版本 */ + private String version; + + /** 版权年份 */ + private String copyrightYear; + + /** 上传路径 */ + private static String profile; + + /** 获取地址开关 */ + private static boolean addressEnabled; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getCopyrightYear() + { + return copyrightYear; + } + + public void setCopyrightYear(String copyrightYear) + { + this.copyrightYear = copyrightYear; + } + + public static String getProfile() + { + return profile; + } + + public void setProfile(String profile) + { + SysConfig.profile = profile; + } + + public static boolean isAddressEnabled() + { + return addressEnabled; + } + + public void setAddressEnabled(boolean addressEnabled) + { + SysConfig.addressEnabled = addressEnabled; + } + + /** + * 获取导入上传路径 + */ + public static String getImportPath() + { + return getProfile() + "/import"; + } + + /** + * 获取头像上传路径 + */ + public static String getAvatarPath() + { + return getProfile() + "/avatar"; + } + + /** + * 获取下载路径 + */ + public static String getDownloadPath() + { + return getProfile() + "/download/"; + } + + /** + * 获取上传路径 + */ + public static String getUploadPath() + { + return getProfile() + "/upload"; + } +} \ No newline at end of file diff --git a/src/main/java/com/huangge1199/contant/HttpStatus.java b/src/main/java/com/huangge1199/contant/HttpStatus.java new file mode 100644 index 0000000..a1c9a1a --- /dev/null +++ b/src/main/java/com/huangge1199/contant/HttpStatus.java @@ -0,0 +1,94 @@ +package com.huangge1199.contant; + +/** + * 返回状态码 + * + * @author ruoyi + */ +public class HttpStatus +{ + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + public static final int WARN = 601; +} diff --git a/src/main/java/com/huangge1199/controller/DatabaseController.java b/src/main/java/com/huangge1199/controller/DatabaseController.java new file mode 100644 index 0000000..03e8da9 --- /dev/null +++ b/src/main/java/com/huangge1199/controller/DatabaseController.java @@ -0,0 +1,66 @@ +package com.huangge1199.controller; +import com.huangge1199.base.R; +import com.huangge1199.domain.UserTabComments; +import com.huangge1199.service.IDatabaseService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * DatabaseController + * + * @author huangge1199 + * @since 2025/3/12 10:16:42 + */ +@Api("数据库可视化") +@RestController +@RequestMapping("/database") +public class DatabaseController{ + + @Resource + private IDatabaseService databaseService; + + @ApiOperation("获取数据库所有表名称") + @GetMapping("/listAllTable") + public + R> listAllTable() + { + List tableList = databaseService.listAllTable(); + return R.ok(tableList); + } + + @ApiOperation("根据表名获取表中所有字段") + @GetMapping("/listColByTable") + public + R> listColByTable(String tableName) + { + List tableList = databaseService.listColByTable(tableName); + return R.ok(tableList); + } + + @ApiOperation("根据SQL进行查询") + @GetMapping("/executeQuery") + public + R>> getQuery(String sql) + { + List> resultList = databaseService.executeQuery(sql); + return R.ok(resultList); + } + + @ApiOperation("根据表达式计算结果") + @PostMapping("/evaluate") + public R evaluate(@RequestBody String expression) + { + double result = 0; + try { + result = databaseService.evaluate(expression); + } catch (Exception e) { + return R.fail(e.getMessage()); + } + return R.ok(result); + } +} diff --git a/src/main/java/com/huangge1199/dao/UserTabCommentsDao.java b/src/main/java/com/huangge1199/dao/UserTabCommentsDao.java new file mode 100644 index 0000000..112852c --- /dev/null +++ b/src/main/java/com/huangge1199/dao/UserTabCommentsDao.java @@ -0,0 +1,28 @@ +package com.huangge1199.dao; + +import com.huangge1199.domain.UserTabComments; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + +/** + * DatabaseDao + * + * @author huangge1199 + * @since 2025/3/12 10:40:31 + */ +public interface UserTabCommentsDao extends JpaRepository { + + @Query(value = "SELECT TABLE_NAME, COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME NOT LIKE 'BIN$%'" ,nativeQuery = true) + List listAllTable(); + + @Query(value = "SELECT col.column_name AS \"TABLE_NAME\",\n" + + " comm.comments AS \"COMMENTS\"\n" + + "FROM all_tab_columns col\n" + + " LEFT JOIN all_col_comments comm\n" + + " ON col.table_name = comm.table_name\n" + + " AND col.column_name = comm.column_name\n" + + "WHERE col.table_name = ?1",nativeQuery = true) + List listColByTable(String tableName); +} diff --git a/src/main/java/com/huangge1199/domain/UserTabComments.java b/src/main/java/com/huangge1199/domain/UserTabComments.java new file mode 100644 index 0000000..504247a --- /dev/null +++ b/src/main/java/com/huangge1199/domain/UserTabComments.java @@ -0,0 +1,27 @@ +package com.huangge1199.domain; + +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * UserTable + * + * @author huangge1199 + * @since 2025/3/12 11:05:20 + */ +@Data +@Entity +@Table(name = "USER_TAB_COMMENTS") +public class UserTabComments { + + @Id + @Column(name = "TABLE_NAME") + private String name; + + @Column(name = "COMMENTS") + private String comments; +} diff --git a/src/main/java/com/huangge1199/service/IDatabaseService.java b/src/main/java/com/huangge1199/service/IDatabaseService.java new file mode 100644 index 0000000..31d15b5 --- /dev/null +++ b/src/main/java/com/huangge1199/service/IDatabaseService.java @@ -0,0 +1,22 @@ +package com.huangge1199.service; + +import com.huangge1199.domain.UserTabComments; + +import java.util.List; +import java.util.Map; + +/** + * IDatabaseService + * + * @author huangge1199 + * @since 2025/3/12 10:19:54 + */ +public interface IDatabaseService { + List listAllTable(); + + List listColByTable(String tableName); + + List> executeQuery(String sql); + + double evaluate(String expression) throws Exception; +} diff --git a/src/main/java/com/huangge1199/service/impl/DatabaseServiceImpl.java b/src/main/java/com/huangge1199/service/impl/DatabaseServiceImpl.java new file mode 100644 index 0000000..3503c64 --- /dev/null +++ b/src/main/java/com/huangge1199/service/impl/DatabaseServiceImpl.java @@ -0,0 +1,85 @@ +package com.huangge1199.service.impl; + +import com.huangge1199.dao.UserTabCommentsDao; +import com.huangge1199.domain.UserTabComments; +import com.huangge1199.service.IDatabaseService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import java.util.*; + +/** + * DatabaseServiceImpl + * + * @author huangge1199 + * @since 2025/3/12 10:20:33 + */ +@Service +public class DatabaseServiceImpl implements IDatabaseService { + + @Resource + private UserTabCommentsDao databaseDao; + + @PersistenceContext + private EntityManager entityManager; + + @Override + public List listAllTable() { + return databaseDao.listAllTable(); + } + + @Override + public List listColByTable(String tableName) { + return databaseDao.listColByTable(tableName); + } + + @Override + public List> executeQuery(String sql) { + String cols = sql.substring(sql.toLowerCase().indexOf("select") + 6, sql.toLowerCase().lastIndexOf("from")); + String[] colArr = cols.split(","); + for (int i = 0; i < colArr.length; i++) { + String col = colArr[i]; + if (col.toLowerCase().contains("as")) { + if (col.contains("\"")) { + col = col.substring(col.indexOf("\"") + 1, col.lastIndexOf("\"")); + } else if (col.contains("'")) { + col = col.substring(col.indexOf("'") + 1, col.lastIndexOf("'")); + } + } + colArr[i] = col; + } + Query query = entityManager.createNativeQuery(sql); + List resultList = query.getResultList(); + List> result = new ArrayList<>(); + for (Object[] row : resultList) { + Map map = new HashMap<>(colArr.length); + for (int i = 0; i < colArr.length; i++) { + map.put(colArr[i], row[i].toString()); + } + result.add(map); + } + return result; + } + + @Override + public double evaluate(String expression) throws Exception { + expression = expression.replaceAll(" ",""); + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine engine = manager.getEngineByName("JavaScript"); + double result = 0; + try { + result = Double.parseDouble(engine.eval(expression).toString()); + System.out.println("计算结果: " + result); + } catch (ScriptException e) { + System.out.println(e.getMessage()); + throw new Exception("表达式错误"); + } + return result; + } +} diff --git a/src/main/resources/application-druid.yml b/src/main/resources/application-druid.yml new file mode 100644 index 0000000..2fedafe --- /dev/null +++ b/src/main/resources/application-druid.yml @@ -0,0 +1,61 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: oracle.jdbc.driver.OracleDriver + druid: + # 主库数据源 + master: + url: jdbc:oracle:thin:@192.168.188.2:1521/ruoyi + username: ruoyi + password: ruoyi + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..6c2b9f1 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,70 @@ +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 8081 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid + jpa: + database-platform: org.hibernate.dialect.Oracle12cDialect + hibernate: + ddl-auto: none + show-sql: true + properties: + hibernate: + format_sql: true + use_sql_comments: true + mvc: + pathmatch: + matching-strategy: ant_path_matcher + +springdoc: + api-docs: + enabled: true + swagger-ui: + enabled: true + path: /swagger-ui.html # 访问路径 + operationsSorter: method # 按方法排序 + tagsSorter: alpha # 按字母排序 + disable-swagger-default-url: true # 关闭默认的 Petstore API + doc-expansion: none # 关闭默认展开 + +knife4j: + enable: true # 开启 Knife4j 增强功能 + setting: + language: zh_cn # 设置语言为中文(可选) + +# 项目相关配置 +sys: + # 名称 + name: huangge1199 + # 版本 + version: 1.0.0 + # 版权年份 + copyrightYear: 2025 + # 文件路径 示例( Windows配置D:/huangge1199/uploadPath,Linux配置 /home/huangge1199/uploadPath) + profile: D:/huangge1199/uploadPath + # 获取ip地址开关 + addressEnabled: false + # 验证码类型 math 数字计算 char 字符验证 + captchaType: math +