base.api 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. syntax = "v1"
  2. // The basic response with data | 基础带数据信息
  3. type BaseDataInfo {
  4. // Error code | 错误代码
  5. Code int `json:"code"`
  6. // Message | 提示信息
  7. Msg string `json:"msg"`
  8. // Data | 数据
  9. Data string `json:"data,omitempty"`
  10. }
  11. // The basic response with data | 基础带数据信息
  12. type BaseListInfo {
  13. // The total number of data | 数据总数
  14. Total uint64 `json:"total"`
  15. // Data | 数据
  16. Data string `json:"data,omitempty"`
  17. }
  18. // The basic response without data | 基础不带数据信息
  19. type BaseMsgResp {
  20. // Error code | 错误代码
  21. Code int `json:"code"`
  22. // Message | 提示信息
  23. Msg string `json:"msg"`
  24. }
  25. // The page request parameters | 列表请求参数
  26. type PageInfo {
  27. // Page number | 第几页
  28. Page uint64 `json:"page" validate:"required,number,gt=0"`
  29. // Page size | 单页数据行数
  30. PageSize uint64 `json:"pageSize" validate:"required,number,lt=100000"`
  31. }
  32. // Basic ID request | 基础ID参数请求
  33. type IDReq {
  34. // ID
  35. // Required: true
  36. Id uint64 `json:"id" validate:"number"`
  37. }
  38. // Basic IDs request | 基础ID数组参数请求
  39. type IDsReq {
  40. // IDs
  41. // Required: true
  42. Ids []uint64 `json:"ids"`
  43. }
  44. // Basic ID request | 基础ID地址参数请求
  45. type IDPathReq {
  46. // ID
  47. // Required: true
  48. Id uint64 `path:"id"`
  49. }
  50. // Basic ID request (int32) | 基础ID参数请求 (int32)
  51. type IDInt32Req {
  52. // ID
  53. // Required: true
  54. Id int32 `json:"id" validate:"number"`
  55. }
  56. // Basic IDs request (int32) | 基础ID数组参数请求 (int32)
  57. type IDsInt32Req {
  58. // IDs
  59. // Required: true
  60. Ids []int32 `json:"ids"`
  61. }
  62. // Basic ID request (int32) | 基础ID地址参数请求 (int32)
  63. type IDInt32PathReq {
  64. // ID
  65. // Required: true
  66. Id int32 `path:"id"`
  67. }
  68. // Basic ID request (uint32) | 基础ID参数请求 (uint32)
  69. type IDUint32Req {
  70. // ID
  71. // Required: true
  72. Id uint32 `json:"id" validate:"number"`
  73. }
  74. // Basic IDs request (uint32) | 基础ID数组参数请求 (uint32)
  75. type IDsUint32Req {
  76. // IDs
  77. // Required: true
  78. Ids []uint32 `json:"ids"`
  79. }
  80. // Basic ID request (uint32) | 基础ID地址参数请求 (uint32)
  81. type IDUint32PathReq {
  82. // ID
  83. // Required: true
  84. Id uint32 `path:"id"`
  85. }
  86. // Basic ID request (int64) | 基础ID参数请求 (int64)
  87. type IDInt64Req {
  88. // ID
  89. // Required: true
  90. Id int64 `json:"id" validate:"number"`
  91. }
  92. // Basic IDs request (int64) | 基础ID数组参数请求 (int64)
  93. type IDsInt64Req {
  94. // IDs
  95. // Required: true
  96. Ids []int64 `json:"ids"`
  97. }
  98. // Basic ID request (int64) | 基础ID地址参数请求 (int64)
  99. type IDInt64PathReq {
  100. // ID
  101. // Required: true
  102. Id int64 `path:"id"`
  103. }
  104. // Basic UUID request in path | 基础UUID地址参数请求
  105. type UUIDPathReq {
  106. // ID
  107. // Required: true
  108. Id string `path:"id"`
  109. }
  110. // Basic UUID request | 基础UUID参数请求
  111. type UUIDReq {
  112. // ID
  113. Id string `json:"id" validate:"required,len=36"`
  114. }
  115. // Basic UUID array request | 基础UUID数组参数请求
  116. type UUIDsReq {
  117. // Ids
  118. // Required: true
  119. Ids []string `json:"ids"`
  120. }
  121. // The base ID response data | 基础ID信息
  122. type BaseIDInfo {
  123. // ID
  124. Id *uint64 `json:"id,optional"`
  125. // Create date | 创建日期
  126. CreatedAt *int64 `json:"createdAt,optional"`
  127. // Update date | 更新日期
  128. UpdatedAt *int64 `json:"updatedAt,optional"`
  129. }
  130. // The base ID response data (int64) | 基础ID信息 (int64)
  131. type BaseIDInt64Info {
  132. // ID
  133. Id *int64 `json:"id,optional"`
  134. // Create date | 创建日期
  135. CreatedAt *int64 `json:"createdAt,optional"`
  136. // Update date | 更新日期
  137. UpdatedAt *int64 `json:"updatedAt,optional"`
  138. }
  139. // The base ID response data (int32) | 基础ID信息 (int32)
  140. type BaseIDInt32Info {
  141. // ID
  142. Id *int32 `json:"id,optional"`
  143. // Create date | 创建日期
  144. CreatedAt *int64 `json:"createdAt,optional"`
  145. // Update date | 更新日期
  146. UpdatedAt *int64 `json:"updatedAt,optional"`
  147. }
  148. // The base ID response data (uint32) | 基础ID信息 (uint32)
  149. type BaseIDUint32Info {
  150. // ID
  151. Id *uint32 `json:"id,optional"`
  152. // Create date | 创建日期
  153. CreatedAt *int64 `json:"createdAt,optional"`
  154. // Update date | 更新日期
  155. UpdatedAt *int64 `json:"updatedAt,optional"`
  156. }
  157. // The base UUID response data | 基础UUID信息
  158. type BaseUUIDInfo {
  159. // ID
  160. Id *string `json:"id,optional"`
  161. // Create date | 创建日期
  162. CreatedAt *int64 `json:"createdAt,optional"`
  163. // Update date | 更新日期
  164. UpdatedAt *int64 `json:"updatedAt,optional"`
  165. }
  166. type Condition struct {
  167. Equal int `json:"equal"`
  168. LabelIdList []uint64 `json:"labelIdList"`
  169. }
  170. type Action struct {
  171. Type int `json:"type"`
  172. Content string `json:"content"`
  173. Meta Meta `json:"meta,optional"`
  174. }
  175. type Meta struct {
  176. Filename string `json:"filename,optional"`
  177. }
  178. type ActionForward struct {
  179. Wxid string `json:"wxid"`
  180. Action []Action `json:"action"`
  181. }
  182. @server(
  183. group: base
  184. )
  185. service Wechat {
  186. // Initialize database | 初始化数据库
  187. @handler initDatabase
  188. get /init/database returns (BaseMsgResp)
  189. }