doc.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "<<ym:serviceTitle>>",
  5. "description": "<<ym:serviceTitle>>的API文档",
  6. "version": "1.0.0"
  7. },
  8. "tags": [
  9. <<ym-loop:apiGroup removeEnd=",">>
  10. {
  11. "name": "<<groupName>>"
  12. },<</ym-loop:apiGroup>>
  13. ],
  14. "paths": {
  15. <<ym-loop:apiInfo removeEnd=",">>
  16. "/v<<version>>/<<ym:serviceName>>/<<groupName>>/<<methodName>>": {
  17. "<<ym-if:<<apiKind>><3>>get<</ym-if>><<ym-if:<<apiKind>>=3>>post<</ym-if>><<ym-if:<<apiKind>>=4>>put<</ym-if>><<ym-if:<<apiKind>>=5>>delete<</ym-if>>": {
  18. "summary": "<<apiName>>",
  19. "x-apifox-folder": "<<groupName>>",
  20. "x-apifox-status": "released",
  21. "deprecated": false,
  22. "description": "<div><div class=\"tips\"><strong>注意事项</strong><br><p><<apiDetail>></p><br></div><div class=\"apicontent apicontent2\"><strong>返回报文示例:</strong><br><pre>{<br> status: \"1\",<br>msg: \"\",<br> data: [{<br> }]<br>}<br></pre></div><div class=\"apicontent apicontent2\"><strong>axios调用示例</strong><br><pre>const params = {\n};\nRequest({\n url: this.UrlList.<<ym:serviceName>>.<<groupName>><<methodName>>.url,\n method: this.UrlList.<<ym:serviceName>>.<<groupName>><<methodName>>.method,\n params,\n})\n.then((res) => {\n if (res.status == 1) {\n // 返回参数正确逻辑\n } else {\n PublicFn.tips(res.msg);\n }\n})\n.catch((e) => {\n console.log(e);\n});\n<br></pre></div></div></div>",
  23. "tags": [
  24. "<<groupName>>"
  25. ],
  26. "parameters": [
  27. <<ym-loop:apiParam removeEnd=",">>
  28. {
  29. "name": "<<fieldName>>",
  30. "in": "query",
  31. "description": "<<fieldTitle>>",
  32. "required": false,
  33. "example": "",
  34. "schema": {
  35. "type": "<<fieldType>>"
  36. }
  37. },<</ym-loop:apiParam>>
  38. ],
  39. "requestBody": {
  40. "content": {
  41. "application/json": {
  42. "schema": {
  43. "type": "object",
  44. "properties": {
  45. <<ym-loop:apiParam removeEnd=",">>
  46. <<ym-if:<<reqParam>>==true>>"<<fieldName>>": {
  47. "type": "<<fieldType>>",
  48. "title": "<<fieldTitle>>"
  49. },<</ym-if>><</ym-loop:apiParam>>
  50. },
  51. "x-apifox-orders": [
  52. <<ym-loop:apiParam removeEnd=",">>
  53. <<ym-if:<<reqParam>>==true>>"<<fieldName>>",<</ym-if>><</ym-loop:apiParam>>
  54. ],
  55. "required": [
  56. <<ym-loop:apiParam removeEnd=",">>
  57. <<ym-if:<<checkAttribute>>.Contains("required") and <<reqParam>>==true>>"<<fieldName>>",<</ym-if>><</ym-loop:apiParam>>
  58. ],
  59. "x-apifox-ignore-properties": []
  60. },
  61. "example": ""
  62. }
  63. }
  64. },
  65. "responses": {
  66. "200": {
  67. "description": "请求成功返回的数据",
  68. "content": {
  69. "application/json": {
  70. "schema": {
  71. "type": "object",
  72. "title": "返回报文",
  73. "required": [
  74. "status",
  75. "msg",
  76. "data"
  77. ],
  78. "properties": {
  79. "status": {
  80. "type": "integer",
  81. "description": "状态(1成功,否则失败)"
  82. },
  83. "msg": {
  84. "type": "string",
  85. "description": "描述(status为1不显示描述信息,status不为1显示错误信息)"
  86. },
  87. "data": {
  88. "type": "array",
  89. "items": {
  90. "type": "object",
  91. "properties": {
  92. <<ym-loop:apiParam removeEnd=",">>
  93. <<ym-if:<<resParam>>==true>>"<<fieldName>>": {
  94. "type": "<<fieldType>>",
  95. "description": "<<fieldTitle>>"
  96. },<</ym-if>><</ym-loop:apiParam>>
  97. },
  98. "x-apifox-orders": [
  99. <<ym-loop:apiParam removeEnd=",">>
  100. <<ym-if:<<resParam>>==true>>"<<fieldName>>",<</ym-if>><</ym-loop:apiParam>>
  101. ],
  102. "x-apifox-ignore-properties": []
  103. }
  104. }
  105. },
  106. "x-apifox-orders": [
  107. "status",
  108. "msg",
  109. "data"
  110. ],
  111. "x-apifox-ignore-properties": []
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. },<</ym-loop:apiInfo>>
  119. }
  120. }