新版若依微服务增强swagger增强集成knife4j

一、pom文件处理

1.父pom增加统一的版本控制

cpp 复制代码
<knife4j.version>4.5.0</knife4j.version>

2.swagger服务的pom中删除 springdoc-openapi-ui 依赖,增加 knife4j-openapi3-ui依赖

cpp 复制代码
        <!-- knife4j -->
        <dependency>
            <groupId>io.springboot</groupId>
            <artifactId>knife4j-openapi3-ui</artifactId>
            <version>${knife4j.version}</version>
        </dependency>

3.gateway服务的pom中删除 springdoc-openapi-webflux-ui 依赖,增加 springdoc-openapi-webflux-core依赖 和 knife4j-gateway-spring-boot-starter

cpp 复制代码
        <!-- Springdoc -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-webflux-core</artifactId>
            <version>${springdoc.version}</version>
        </dependency>

        <!--引入Knife4j的gateway包-->
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-gateway-spring-boot-starter</artifactId>
            <version>${knife4j.version}</version>
        </dependency>

pom处理完成后开始删除配置文件

配置文件删除

1.swagger服务中的配置文件如下图所示都删除掉

2.gateway服务中的 SpringDocConfig文件删除掉

gateway的nacos配置文件增加knife4j配置

cpp 复制代码
knife4j:
  gateway:
    enabled: true
    tags-sorter: order
    operations-sorter: order
    strategy: manual
    routes:
      - name: 系统模块
        url: /ruoyi-system/v3/api-docs?group=default
        service-name: ruoyi-system
        context-path: /ruoyi-system
        order: 1
      - name: 代码生成
        url: /ruoyi-gen/v3/api-docs?group=default
        service-name: ruoyi-gen
        context-path: /ruoyi-gen
        order: 2
      - name: 定时任务
        url: /ruoyi-job/v3/api-docs?group=default
        service-name: ruoyi-job
        context-path: /ruoyi-job
        order: 3
相关推荐
XR1234567883 小时前
企业全光网络架构选型技术白皮书:从物理层到运维层的全链路分析
运维·网络·架构
智慧物业老杨3 小时前
物业如何做好预算管理?落地架构逻辑
人工智能·架构
微学AI3 小时前
一根针指向所有方向:挂谷猜想对 LLM Agent 技能-记忆架构的启示
开发语言·人工智能·架构·挂谷猜想
张忠琳5 小时前
【NPU】Ascend Docker Runtime v26.0.1 之二 runtime/process/process.go — 超深度逐行分析
云原生·容器·架构·kubernetes·npu·docker-runtime
联众合科技6 小时前
超融合如何助力数据中心现代化转型?从架构重构到落地避坑的完整指南
重构·架构
香菜TTT9 小时前
Kafka_深度解析_从架构原理到生产实践
分布式·架构·kafka·linq
陳陈陳9 小时前
🚀 前端流式输出革命:SSE + BFF 架构从零到一实战指南
vue.js·架构·node.js
张永伟营销11 小时前
从SEO到GEO:技术人视角下的生成式引擎优化架构与实践
搜索引擎·ai·架构
小柒儿33611 小时前
AI原生架构:企业IT从“业务数字化”到“AI原生重构”
重构·架构·ai-native
雨辰AI12 小时前
K8s人大金仓主从高可用搭建|容器化集群自动同步+故障切换(生产完整版)
云原生·容器·kubernetes