You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @title Sqle API Docs
// @version 1.0
// @description This is a sample server for dev.
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
// @BasePath /sqle
The text was updated successfully, but these errors were encountered:
现状
当前API接口仅在代码中提供了swag.json文件,没有在线swag server 服务
预期
部署服务后,同时提供在线swag server
实现方案
方案一
dms/sqle生成一个swagger文档
优点: 在线swagger服务配置简单,组件文档以一个文档形式展示
缺点: 需要使用脚本合并dms/sqle组件的文档,swagger无合并swagger文档特性且合并文档耦合高,难以维护
方案二
dms/sqle各自生成swagger文档
优点: 文档以下拉框形式选择查看不同组件的文档,dms/sqle组件生成文档的脚本保持不变
缺点: 需要修改swagger服务初始化参数,打包流程繁琐,开发debug调试阶段无法更新swagger文档,只有再次重新打包才能更新swagger文档
方案三
sqle新增获取swagger.yaml文件接口,dms调用该接口获取sqle的swagger.yaml文件
最终效果:
右上角选择dms/sqle:
![20240606111750_rec_](https://private-user-images.githubusercontent.com/63177450/337088095-df70656c-bcbe-4b2d-b0db-b061fabb4f3a.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzgyMjQsIm5iZiI6MTcyNjAzNzkyNCwicGF0aCI6Ii82MzE3NzQ1MC8zMzcwODgwOTUtZGY3MDY1NmMtYmNiZS00YjJkLWIwZGItYjA2MWZhYmI0ZjNhLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2NTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmN2E0NTJkOTNkNGI4Y2Q5MDhkMmFiNTA4YzE5YTYwMWQyY2EwOGYwNzMzMjUzNDQ2NzgxZWUwMjQ5NjkxMmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zOYl_7F--8TqYG_nbc_D6h-ocaZrjdLHsgi8RjXWvK4)
通过swgger server调用dms登录接口
![20240606112210_rec_](https://private-user-images.githubusercontent.com/63177450/337088859-746e4321-9b29-4db1-ae92-d83a75e96392.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzgyMjQsIm5iZiI6MTcyNjAzNzkyNCwicGF0aCI6Ii82MzE3NzQ1MC8zMzcwODg4NTktNzQ2ZTQzMjEtOWIyOS00ZGIxLWFlOTItZDgzYTc1ZTk2MzkyLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2NTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUwYmU5ZmFjYjhlMjYyYjdmNDBiYzBjZWMwMDI5OTg0MGQ1ZTY4YWQ1ODUzZTk2YmE2ZTdjOWM2NTMyODM0YjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kC_9owGItc5H6sVajB-CXesvjKPfbmKY6ZAxaCmTuws)
通过swgger server调用sqle白名单GET接口
![20240606111925_rec_](https://private-user-images.githubusercontent.com/63177450/337088388-cb18b4bf-1548-43b3-86f6-0224a43e40c1.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMzgyMjQsIm5iZiI6MTcyNjAzNzkyNCwicGF0aCI6Ii82MzE3NzQ1MC8zMzcwODgzODgtY2IxOGI0YmYtMTU0OC00M2IzLTg2ZjYtMDIyNGE0M2U0MGMxLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDA2NTg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVhMDlkNjAzMzRjNmUwMjBkOTUwNTBiNDhjNjdkMTY1ODg4YTA0OGI0NDliNGRiN2YzZWQ3YjBkYmFjZTQ2NjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ovwhUZH3x0EpA70pvopEq-TeGfvRri7Kq0ukqMBtO64)
使用方式
填入token后即可正常调用接口(dms/sqle使用方式相同)
总结
方案三最简单明了,实现成本低,方案一和方案二实现复杂且都存在各自的缺点,综上,最终选择方案三.
todo-list
影响面:
sqle新增 @basepath /sqle 基础api前缀,调用sqle接口时,需要新增 /sqle 前缀,只对swagger调用有影响,对系统集成无影响
The text was updated successfully, but these errors were encountered: