word.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta http-equiv="Content-Type" content="application/msword"/>
  5. <title>toWord2</title>
  6. <style type="text/css">
  7. .bg {
  8. background-color: rgb(84, 127, 177);
  9. }
  10. table {
  11. table-layout: fixed;
  12. }
  13. tr {
  14. height: 20px;
  15. font-size: 12px;
  16. }
  17. td {
  18. overflow: hidden;
  19. word-break: break-all;
  20. word-wrap: break-word;
  21. }
  22. .specialHeight {
  23. height: 40px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <h1 style="text-align: center;" th:text="${title}"></h1>
  29. <div th:each="app:${apps}">
  30. <h3 style="width:800px; margin: 0 auto" th:text="${appStat.index+1}+'.'+${app.apiInfo.title}"></h3>
  31. <h6 style="width:600px; margin: 0 auto" th:text="'描述:'+${app.apiInfo.description}"></h6>
  32. <h5 style="width:800px; margin: 0 auto" th:text="'作者:'+${app.apiInfo.author}"></h5>
  33. <h5 style="width:800px; margin: 0 auto" th:text="'路径:'+${app.apiInfo.basePath}"></h5>
  34. <h5 style="width:800px; margin: 0 auto" th:text="'版本:'+${app.apiInfo.version}"></h5>
  35. <div style="width:800px; margin: 0 auto">
  36. <div th:each="tag:${app.tags}">
  37. <!--这个是类的说明-->
  38. <h4 th:text="${appStat.index+1}+'.'+${tagStat.index+1}+'.'+${tag.key}"></h4>
  39. <div th:each="table:${tag.value.listTable}">
  40. <!--这个是每个请求的说明,方便生成文档后进行整理-->
  41. <h5 th:text="${appStat.index+1}+'.'+${tagStat.index+1}+'.'+${tableStat.index+1}+'.'+${table.tag}"></h5>
  42. <table border="1" cellspacing="0" cellpadding="0" width="100%">
  43. <tr class="bg">
  44. <td colspan="5" th:text="${table.tag}"></td>
  45. </tr>
  46. <tr>
  47. <td>接口描述</td>
  48. <td colspan="4" th:text="${table.description}"></td>
  49. </tr>
  50. <tr>
  51. <td>URL</td>
  52. <td colspan="4" th:text="${table.url}"></td>
  53. </tr>
  54. <tr>
  55. <td>请求方式</td>
  56. <td colspan="4" th:text="${table.requestType}"></td>
  57. </tr>
  58. <tr>
  59. <td>请求类型</td>
  60. <td colspan="4" th:text="${table.requestForm}"></td>
  61. </tr>
  62. <tr>
  63. <td>返回类型</td>
  64. <td colspan="4" th:text="${table.responseForm}"></td>
  65. </tr>
  66. <tr class="bg" align="center">
  67. <td>参数名</td>
  68. <td>数据类型</td>
  69. <td>参数类型</td>
  70. <td>是否必填</td>
  71. <td>说明</td>
  72. </tr>
  73. <tr align="center" th:each="request:${table.requestList}">
  74. <td th:text="${request.name}"></td>
  75. <td th:text="${request.type}"></td>
  76. <td th:text="${request.paramType}"></td>
  77. <td th:if="${request.require}" th:text="Y"></td>
  78. <td th:if="${!request.require}" th:text="N"></td>
  79. <td th:text="${request.remark}"></td>
  80. </tr>
  81. <tr class="bg" align="center">
  82. <td>状态码</td>
  83. <td>描述</td>
  84. <td colspan="3">说明</td>
  85. </tr>
  86. <tr align="center" th:each="response:${table.responseList}">
  87. <td th:text="${response.name}"></td>
  88. <td th:text="${response.description}"></td>
  89. <td colspan="3" th:text="${response.remark}"></td>
  90. </tr>
  91. <tr class="bg">
  92. <td colspan="5">示例</td>
  93. </tr>
  94. <tr class="specialHeight">
  95. <td class="bg">请求参数</td>
  96. <td colspan="4" th:text="${table.requestParam}"></td>
  97. </tr>
  98. <tr class="specialHeight">
  99. <td class="bg">返回值</td>
  100. <td colspan="4" th:text="${table.responseParam}"></td>
  101. </tr>
  102. </table>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </body>
  108. </html>