swagger.json 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "paths": {
  7. "/product/create": {
  8. "post": {
  9. "description": "企业创建商品,添加到商品库",
  10. "consumes": [
  11. "application/json"
  12. ],
  13. "produces": [
  14. "application/json"
  15. ],
  16. "summary": "CreateProduct 创建商品",
  17. "parameters": [
  18. {
  19. "type": "string",
  20. "description": "登录TOKEN信息",
  21. "name": "Authorization",
  22. "in": "header",
  23. "required": true
  24. },
  25. {
  26. "description": "创建商品请求结构体",
  27. "name": "req",
  28. "in": "body",
  29. "required": true,
  30. "schema": {
  31. "$ref": "#/definitions/http_model.CreateProductRequest"
  32. }
  33. }
  34. ],
  35. "responses": {
  36. "200": {
  37. "description": "创建商品相应结构体",
  38. "schema": {
  39. "allOf": [
  40. {
  41. "$ref": "#/definitions/http_model.CommonResponse"
  42. },
  43. {
  44. "type": "object",
  45. "properties": {
  46. "data": {
  47. "$ref": "#/definitions/http_model.CreateProductData"
  48. }
  49. }
  50. }
  51. ]
  52. }
  53. }
  54. }
  55. }
  56. },
  57. "/sendCode": {
  58. "post": {
  59. "description": "发送验证码,每次发送到邮箱",
  60. "consumes": [
  61. "application/json"
  62. ],
  63. "produces": [
  64. "application/json"
  65. ],
  66. "summary": "sendCode 发送验证码",
  67. "parameters": [
  68. {
  69. "description": "发送验证码请求参数结构体",
  70. "name": "req",
  71. "in": "body",
  72. "required": true,
  73. "schema": {
  74. "$ref": "#/definitions/http_model.SendCodeRequest"
  75. }
  76. }
  77. ],
  78. "responses": {
  79. "200": {
  80. "description": "发送验证码请求相应结构体",
  81. "schema": {
  82. "allOf": [
  83. {
  84. "$ref": "#/definitions/http_model.CommonResponse"
  85. },
  86. {
  87. "type": "object",
  88. "properties": {
  89. "data": {
  90. "$ref": "#/definitions/http_model.SendCodeData"
  91. }
  92. }
  93. }
  94. ]
  95. }
  96. }
  97. }
  98. }
  99. }
  100. },
  101. "definitions": {
  102. "http_model.CommonResponse": {
  103. "type": "object",
  104. "properties": {
  105. "data": {},
  106. "message": {
  107. "type": "string"
  108. },
  109. "status": {
  110. "type": "integer"
  111. }
  112. }
  113. },
  114. "http_model.CreateProductData": {
  115. "type": "object",
  116. "properties": {
  117. "product_id": {
  118. "description": "商品id",
  119. "type": "integer"
  120. }
  121. }
  122. },
  123. "http_model.CreateProductPhoto": {
  124. "type": "object",
  125. "properties": {
  126. "photo_uid": {
  127. "type": "string"
  128. },
  129. "photo_url": {
  130. "description": "图片或视频url",
  131. "type": "string"
  132. },
  133. "symbol": {
  134. "description": "图片为主图或详情图标志位,1为主图,2为详情图,3为视频",
  135. "type": "integer"
  136. }
  137. }
  138. },
  139. "http_model.CreateProductRequest": {
  140. "type": "object",
  141. "properties": {
  142. "brand_name": {
  143. "type": "string"
  144. },
  145. "product_detail": {
  146. "type": "string"
  147. },
  148. "product_id": {
  149. "type": "integer"
  150. },
  151. "product_name": {
  152. "description": "商品名称",
  153. "type": "string"
  154. },
  155. "product_photos": {
  156. "description": "商品图片列表",
  157. "type": "array",
  158. "items": {
  159. "$ref": "#/definitions/http_model.CreateProductPhoto"
  160. }
  161. },
  162. "product_price": {
  163. "description": "商品价值",
  164. "type": "integer"
  165. },
  166. "product_type": {
  167. "description": "商品类型",
  168. "type": "integer"
  169. },
  170. "product_url": {
  171. "description": "商品链接,可为电商网址、公司官网、大众点评的店铺地址等可以说明商品信息或者品牌信息的线上地址;",
  172. "type": "string"
  173. },
  174. "shop_address": {
  175. "description": "店铺地址,商品类型为线下品牌时需填写",
  176. "type": "string"
  177. }
  178. }
  179. },
  180. "http_model.SendCodeData": {
  181. "type": "object"
  182. },
  183. "http_model.SendCodeRequest": {
  184. "type": "object",
  185. "properties": {
  186. "phone": {
  187. "type": "string"
  188. }
  189. }
  190. }
  191. }
  192. }