# SwaggerFormat **Repository Path**: DevSpeed/swagger-format ## Basic Information - **Project Name**: SwaggerFormat - **Description**: 根据 Swagger 文档库格式化生成 JSDoc 风格文件 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-24 - **Last Updated**: 2023-09-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Swagger C# 网页版 转 带 JSDoc 的文档文件 根目录创建配置文件 swagger.config.js ```js return { // 使用新版 EventName 格式化方法 NewNameRule: true, // 用于去掉重复的 Path 字段 IgnoreString: ["api"], // swagger 文档地址 DocumentPath: ["http://192.168.11.51:30099/swagger/dsms/index.html"], // 接口文件输出地址 FolderPath: "api", // 文档输出附加模块(头部模块) InsertBefore: `// 经过封装的请求方法地址 import request from '@/libs/request.js';`, }; ``` 转换后的文档文件 ```js // 经过封装的请求方法地址 import request from '@/libs/request.js'; // 频率划分 // 频率划分数字建模 // v1 export default { /** * 根据查询条件获取脚注集合 * * @param {Object} options Body参数 * @param {Blob} loading 是否显示loading * @return {Promise} 接口异步传输对象 * @example * * * // Body参数 -- 类型 : application/json * var bodyData = { // 脚注查询条件 => 脚注查询条件 (object) 必填 * Year: null, // 脚注年份 (int32) 必填 * Inuse: null, // 是否在用,true在用,false废止 ,null 查全部 (boolean) * PageSize: null, // 每页条数 (int32) * PageIndex: null, // 查询第几页(从1开始) (int32) * Code: null, // 脚注编码 (string) * Content: null, // 脚注内容 (string) * }, * // 返回值数据模型 * var responsesData = { // (object) 必填 * StatusCode: null, // (int32) 必填 * Reason: null, // (string) * Result: { // 分页查询结果 => 分页查询结果 (object) * Total: null, // 满足条件的装备总数 (int32) 必填 * Details: [ // 查询页数据 (array) * { // 频率脚注 (object) 必填 * Year: null, // 脚注年份 (int32) 必填 * Inuse: null, // 是否在用 (boolean) 必填 * Code: null, // 脚注编码 (string) * Content: null, // 脚注内容 (string) * }, * ], * }, * }, * */ 'FreqAllocation_GetFreqFootnotesByConditions': function (options, loading, header = {}) { return request.post('/api/dsms/FreqAllocation/GetFreqFootnotesByConditions', {}, options, '', loading, header) }, }; ``` 效果预览 ![效果预览](https://gitee.com/DevSpeed/swagger-format/raw/master/MD.png)