github.com/unionj-cloud/go-doudou@v1.3.8-0.20221011095552-0088008e5b31/cmd/internal/openapi/v3/codegen/testdata/api-docs.json (about)

     1  {
     2    "openapi": "3.0.1",
     3    "info": {
     4      "title": "报告生成 API",
     5      "description": "报告生成api服务",
     6      "version": "1.4.8"
     7    },
     8    "servers": [
     9      {
    10        "url": "http://report.xicheng.c92358f369e164c2bbbdee14238b6e9a6.cn-beijing.alicontainer.com",
    11        "description": "Generated server url"
    12      }
    13    ],
    14    "paths": {
    15      "/text/extractFromUrl": {
    16        "get": {
    17          "tags": [
    18            "text-controller"
    19          ],
    20          "description": "提取文本",
    21          "operationId": "download",
    22          "parameters": [
    23            {
    24              "name": "url",
    25              "in": "query",
    26              "description": "文件地址",
    27              "required": true,
    28              "schema": {
    29                "type": "string"
    30              }
    31            },
    32            {
    33              "name": "clearFormat",
    34              "in": "query",
    35              "description": "是否清除格式,即替换连续空白字符为单一空格",
    36              "required": false,
    37              "schema": {
    38                "type": "boolean",
    39                "default": false
    40              }
    41            }
    42          ],
    43          "responses": {
    44            "500": {
    45              "description": "Internal Server Error",
    46              "content": {
    47                "*/*": {
    48                  "schema": {
    49                    "type": "string"
    50                  }
    51                }
    52              }
    53            },
    54            "403": {
    55              "description": "Forbidden",
    56              "content": {
    57                "*/*": {
    58                  "schema": {
    59                    "type": "string"
    60                  }
    61                }
    62              }
    63            },
    64            "200": {
    65              "description": "OK",
    66              "content": {
    67                "*/*": {
    68                  "schema": {
    69                    "$ref": "#/components/schemas/ResultString"
    70                  }
    71                }
    72              }
    73            }
    74          }
    75        }
    76      },
    77      "/text/extractFromFile": {
    78        "post": {
    79          "tags": [
    80            "text-controller"
    81          ],
    82          "description": "提取文本",
    83          "operationId": "download_1",
    84          "parameters": [
    85            {
    86              "name": "clearFormat",
    87              "in": "query",
    88              "description": "是否清除格式,即替换连续空白字符为单一空格",
    89              "required": false,
    90              "schema": {
    91                "type": "boolean",
    92                "default": false
    93              }
    94            }
    95          ],
    96          "requestBody": {
    97            "content": {
    98              "multipart/form-data": {
    99                "schema": {
   100                  "type": "object",
   101                  "properties": {
   102                    "file": {
   103                      "type": "string",
   104                      "format": "binary"
   105                    }
   106                  }
   107                }
   108              }
   109            }
   110          },
   111          "responses": {
   112            "500": {
   113              "description": "Internal Server Error",
   114              "content": {
   115                "*/*": {
   116                  "schema": {
   117                    "type": "string"
   118                  }
   119                }
   120              }
   121            },
   122            "403": {
   123              "description": "Forbidden",
   124              "content": {
   125                "*/*": {
   126                  "schema": {
   127                    "type": "string"
   128                  }
   129                }
   130              }
   131            },
   132            "200": {
   133              "description": "OK",
   134              "content": {
   135                "*/*": {
   136                  "schema": {
   137                    "$ref": "#/components/schemas/ResultString"
   138                  }
   139                }
   140              }
   141            }
   142          }
   143        }
   144      }
   145    },
   146    "components": {
   147      "schemas": {
   148        "Word2HtmlRequestPayload": {
   149          "type": "object",
   150          "properties": {
   151            "downloadUrl": {
   152              "type": "string"
   153            }
   154          }
   155        },
   156        "ResultString": {
   157          "type": "object",
   158          "properties": {
   159            "code": {
   160              "type": "integer",
   161              "description": "返回标记:成功标记=0,失败标记=1",
   162              "format": "int32"
   163            },
   164            "msg": {
   165              "type": "string",
   166              "description": "返回信息"
   167            },
   168            "data": {
   169              "type": "string",
   170              "description": "数据"
   171            }
   172          }
   173        },
   174        "ResultListWordTemplateSubstitution": {
   175          "type": "object",
   176          "properties": {
   177            "code": {
   178              "type": "integer",
   179              "description": "返回标记:成功标记=0,失败标记=1",
   180              "format": "int32"
   181            },
   182            "msg": {
   183              "type": "string",
   184              "description": "返回信息"
   185            },
   186            "data": {
   187              "type": "array",
   188              "description": "数据",
   189              "items": {
   190                "$ref": "#/components/schemas/WordTemplateSubstitution"
   191              }
   192            }
   193          }
   194        },
   195        "WordTemplateSubstitution": {
   196          "type": "object",
   197          "properties": {
   198            "name": {
   199              "type": "string",
   200              "description": "变量名",
   201              "example": "var1"
   202            },
   203            "display": {
   204              "type": "string",
   205              "description": "完整变量字符串,用于前端展示",
   206              "example": "{var1}"
   207            },
   208            "type": {
   209              "type": "string",
   210              "description": "类型",
   211              "example": "MERGEFIELD",
   212              "enum": [
   213                "MERGEFIELD",
   214                "IMAGE",
   215                "CHART",
   216                "TABLE",
   217                "UNKNOWN"
   218              ]
   219            }
   220          },
   221          "description": "模板变量"
   222        },
   223        "ChartReportParagraph": {
   224          "type": "object",
   225          "description": "图表类型段落",
   226          "allOf": [
   227            {
   228              "$ref": "#/components/schemas/ReportParagraph"
   229            },
   230            {
   231              "type": "object",
   232              "properties": {
   233                "chartXlsxTemplateUrl": {
   234                  "type": "string"
   235                },
   236                "reportChartType": {
   237                  "type": "string",
   238                  "enum": [
   239                    "ZHUXINGTU",
   240                    "ZHEXIANTU",
   241                    "DUIJIZHEXIANTU",
   242                    "BINGTU",
   243                    "TIAOXINGTU",
   244                    "SANDIANTU",
   245                    "ZHEXIANZHUXINGTU",
   246                    "DUIJIZHUXINGTU",
   247                    "YUANHUANTU",
   248                    "UNKNOWN"
   249                  ]
   250                },
   251                "data": {
   252                  "type": "array",
   253                  "items": {
   254                    "type": "array",
   255                    "items": {
   256                      "type": "object"
   257                    }
   258                  }
   259                },
   260                "style": {
   261                  "$ref": "#/components/schemas/ChartReportParagraphStyle"
   262                }
   263              }
   264            }
   265          ]
   266        },
   267        "ChartReportParagraphStyle": {
   268          "type": "object",
   269          "properties": {
   270            "alignment": {
   271              "type": "string",
   272              "description": "居左,居中,居右",
   273              "enum": [
   274                "LEFT",
   275                "CENTER",
   276                "RIGHT"
   277              ]
   278            },
   279            "width": {
   280              "type": "number",
   281              "description": "word里面的图表的宽,单位厘米",
   282              "format": "double"
   283            },
   284            "height": {
   285              "type": "number",
   286              "description": "word里面的图表的高,单位厘米",
   287              "format": "double"
   288            },
   289            "foreColor": {
   290              "type": "object",
   291              "additionalProperties": {
   292                "type": "string",
   293                "description": "每个系列的前景色,图例的颜色,柱子的颜色,线条的颜色等"
   294              },
   295              "description": "每个系列的前景色,图例的颜色,柱子的颜色,线条的颜色等"
   296            }
   297          }
   298        },
   299        "ImageReportParagraph": {
   300          "type": "object",
   301          "description": "图片类型段落",
   302          "allOf": [
   303            {
   304              "$ref": "#/components/schemas/ReportParagraph"
   305            },
   306            {
   307              "type": "object",
   308              "properties": {
   309                "urls": {
   310                  "type": "array",
   311                  "items": {
   312                    "type": "string"
   313                  }
   314                },
   315                "style": {
   316                  "$ref": "#/components/schemas/ImageReportParagraphStyle"
   317                }
   318              }
   319            }
   320          ]
   321        },
   322        "ImageReportParagraphStyle": {
   323          "type": "object",
   324          "properties": {
   325            "alignment": {
   326              "type": "string",
   327              "description": "居左,居中,居右",
   328              "enum": [
   329                "LEFT",
   330                "CENTER",
   331                "RIGHT"
   332              ]
   333            },
   334            "width": {
   335              "type": "number",
   336              "format": "double"
   337            },
   338            "height": {
   339              "type": "number",
   340              "format": "double"
   341            },
   342            "separator": {
   343              "type": "string"
   344            }
   345          }
   346        },
   347        "MergeFieldData": {
   348          "type": "object",
   349          "properties": {
   350            "fields": {
   351              "type": "array",
   352              "items": {
   353                "type": "string"
   354              }
   355            },
   356            "values": {
   357              "type": "array",
   358              "items": {
   359                "type": "object"
   360              }
   361            }
   362          }
   363        },
   364        "ParagraphWrapper": {
   365          "required": [
   366            "type"
   367          ],
   368          "type": "object",
   369          "properties": {
   370            "type": {
   371              "type": "string",
   372              "description": "报告段落类型",
   373              "example": "TEXT",
   374              "enum": [
   375                "TEXT",
   376                "CHART",
   377                "CHART2",
   378                "IMAGE",
   379                "TABLE",
   380                "TABLE2"
   381              ]
   382            },
   383            "value": {
   384              "oneOf": [
   385                {
   386                  "$ref": "#/components/schemas/ChartReportParagraph"
   387                },
   388                {
   389                  "$ref": "#/components/schemas/ImageReportParagraph"
   390                },
   391                {
   392                  "$ref": "#/components/schemas/TableReportParagraph"
   393                },
   394                {
   395                  "$ref": "#/components/schemas/TextReportParagraph"
   396                }
   397              ]
   398            }
   399          },
   400          "description": "报告段落包装类"
   401        },
   402        "ReportParagraph": {
   403          "type": "object",
   404          "properties": {
   405            "bookmark": {
   406              "type": "string"
   407            }
   408          },
   409          "description": "报告段落内容"
   410        },
   411        "TableReportParagraph": {
   412          "type": "object",
   413          "description": "表格类型段落",
   414          "allOf": [
   415            {
   416              "$ref": "#/components/schemas/ReportParagraph"
   417            },
   418            {
   419              "type": "object",
   420              "properties": {
   421                "hasHeader": {
   422                  "type": "boolean"
   423                },
   424                "data": {
   425                  "type": "array",
   426                  "items": {
   427                    "type": "array",
   428                    "items": {
   429                      "type": "object"
   430                    }
   431                  }
   432                }
   433              }
   434            }
   435          ]
   436        },
   437        "TextReportParagraph": {
   438          "type": "object",
   439          "description": "文本类型段落",
   440          "allOf": [
   441            {
   442              "$ref": "#/components/schemas/ReportParagraph"
   443            },
   444            {
   445              "type": "object",
   446              "properties": {
   447                "style": {
   448                  "$ref": "#/components/schemas/TextReportParagraphStyle"
   449                },
   450                "content": {
   451                  "type": "string"
   452                },
   453                "fieldData": {
   454                  "$ref": "#/components/schemas/MergeFieldData"
   455                },
   456                "sentences": {
   457                  "type": "array",
   458                  "items": {
   459                    "$ref": "#/components/schemas/TextReportParagraphSentence"
   460                  }
   461                }
   462              }
   463            }
   464          ]
   465        },
   466        "TextReportParagraphFont": {
   467          "type": "object",
   468          "properties": {
   469            "fontFamily": {
   470              "type": "string",
   471              "description": "字体"
   472            },
   473            "fontSize": {
   474              "type": "number",
   475              "description": "字号,默认16磅,即三号字体",
   476              "format": "double"
   477            },
   478            "chineseFontSize": {
   479              "type": "string",
   480              "description": "中文字号,优先级高于fontSize",
   481              "enum": [
   482                "初号",
   483                "小初",
   484                "一号",
   485                "小一",
   486                "二号",
   487                "小二",
   488                "三号",
   489                "小三",
   490                "四号",
   491                "小四",
   492                "五号",
   493                "小五",
   494                "六号",
   495                "小六",
   496                "七号",
   497                "八号"
   498              ]
   499            },
   500            "fontColor": {
   501              "type": "string",
   502              "description": "字体颜色,只支持黑色,红色和黄色",
   503              "enum": [
   504                "BLACK",
   505                "RED",
   506                "YELLOW"
   507              ]
   508            },
   509            "isBold": {
   510              "type": "boolean",
   511              "description": "是否加粗,默认false"
   512            }
   513          },
   514          "description": "设置字体样式"
   515        },
   516        "TextReportParagraphSentence": {
   517          "type": "object",
   518          "properties": {
   519            "font": {
   520              "$ref": "#/components/schemas/TextReportParagraphFont"
   521            },
   522            "inline": {
   523              "type": "boolean",
   524              "description": "inline默认值为true,表示不换行"
   525            },
   526            "content": {
   527              "type": "string",
   528              "description": "文本"
   529            }
   530          },
   531          "description": "文本类型句子短语"
   532        },
   533        "TextReportParagraphStyle": {
   534          "type": "object",
   535          "properties": {
   536            "alignment": {
   537              "type": "string",
   538              "description": "居左,居中,居右",
   539              "enum": [
   540                "LEFT",
   541                "CENTER",
   542                "RIGHT"
   543              ]
   544            },
   545            "font": {
   546              "$ref": "#/components/schemas/TextReportParagraphFont"
   547            },
   548            "lineSpacing": {
   549              "type": "number",
   550              "description": "设置行距,单位磅,默认单倍行距,即12磅",
   551              "format": "double"
   552            },
   553            "indent": {
   554              "type": "number",
   555              "description": "设置首行缩进,单位磅",
   556              "format": "double"
   557            },
   558            "inline": {
   559              "type": "boolean",
   560              "description": "如果inline为true,表示不换行"
   561            },
   562            "clearOldStyle": {
   563              "type": "boolean",
   564              "description": "是否清除原有段落格式"
   565            }
   566          }
   567        },
   568        "ResultInteger": {
   569          "type": "object",
   570          "properties": {
   571            "code": {
   572              "type": "integer",
   573              "description": "返回标记:成功标记=0,失败标记=1",
   574              "format": "int32"
   575            },
   576            "msg": {
   577              "type": "string",
   578              "description": "返回信息"
   579            },
   580            "data": {
   581              "type": "integer",
   582              "description": "数据",
   583              "format": "int32"
   584            }
   585          }
   586        },
   587        "ReportPage": {
   588          "type": "object",
   589          "properties": {
   590            "orientationType": {
   591              "type": "string",
   592              "description": "页面是横向还是纵向",
   593              "enum": [
   594                "HORIZONTAL",
   595                "VERTICAL"
   596              ]
   597            },
   598            "paperSizeType": {
   599              "type": "string",
   600              "description": "页面纸张大小",
   601              "enum": [
   602                "A3",
   603                "A4",
   604                "A5",
   605                "B4",
   606                "B5"
   607              ]
   608            },
   609            "topMargin": {
   610              "type": "number",
   611              "description": "页面上边距,单位厘米",
   612              "format": "double"
   613            },
   614            "bottomMargin": {
   615              "type": "number",
   616              "description": "页面下边距,单位厘米",
   617              "format": "double"
   618            },
   619            "leftMargin": {
   620              "type": "number",
   621              "description": "页面左边距,单位厘米",
   622              "format": "double"
   623            },
   624            "rightMargin": {
   625              "type": "number",
   626              "description": "页面右边距,单位厘米",
   627              "format": "double"
   628            }
   629          }
   630        },
   631        "RequestPayload": {
   632          "type": "object",
   633          "properties": {
   634            "templateUrl": {
   635              "type": "string"
   636            },
   637            "reportFileName": {
   638              "type": "string"
   639            },
   640            "paragraphList": {
   641              "type": "array",
   642              "items": {
   643                "$ref": "#/components/schemas/ParagraphWrapper"
   644              }
   645            },
   646            "reportPage": {
   647              "$ref": "#/components/schemas/ReportPage"
   648            },
   649            "storageMode": {
   650              "type": "string"
   651            }
   652          }
   653        }
   654      }
   655    }
   656  }