BuyController.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?php
  2. namespace App\Http\Controllers\Buy;
  3. use App\Http\Controllers\BaseController;
  4. use App\Http\Logic\Buy\BuyLogic;
  5. class BuyController extends BaseController
  6. {
  7. /**
  8. * @SWG\Get(
  9. * path="/buy/cate/list",
  10. * tags={"电商导购"},
  11. * summary="获取电商平台分类",
  12. * description="获取电商平台分类",
  13. * produces={"application/json"},
  14. * @SWG\Parameter(
  15. * name="source",
  16. * in="query",
  17. * description="来源 jd-京东,vip-唯品会,pdd-拼多多,kaola-考拉,taobao-淘宝",
  18. * type="string"
  19. * ),
  20. * @SWG\Response(
  21. * response="200",
  22. * description="success",
  23. * @SWG\Schema(
  24. * @SWG\Property(
  25. * property="id",
  26. * type="string",
  27. * description="分类ID"
  28. * ),
  29. * @SWG\Property(
  30. * property="name",
  31. * type="string",
  32. * description="分类名称"
  33. * )
  34. * )
  35. * ),
  36. * @SWG\Response(
  37. * response="403",
  38. * description="fail",
  39. * @SWG\Schema(ref="#/definitions/ErrorBean")
  40. * )
  41. * )
  42. */
  43. public function getCateList()
  44. {
  45. $data = BuyLogic::getCateListLogic();
  46. return $this->success($data);
  47. }
  48. /**
  49. * @SWG\Post(
  50. * path="/buy/goods/list",
  51. * tags={"电商导购"},
  52. * summary="商品列表接口",
  53. * description="商品列表接口",
  54. * produces={"application/json"},
  55. * @SWG\Parameter(
  56. * name="page",
  57. * in="query",
  58. * description="第几页",
  59. * type="string"
  60. * ),
  61. * @SWG\Parameter(
  62. * name="page_size",
  63. * in="query",
  64. * description="每页数量",
  65. * type="string"
  66. * ),
  67. * @SWG\Parameter(
  68. * name="source",
  69. * in="query",
  70. * description="来源 jd-京东,vip-唯品会,pdd-拼多多,kaola-考拉,taobao-淘宝",
  71. * type="string"
  72. * ),
  73. * @SWG\Parameter(
  74. * name="cat_id",
  75. * in="query",
  76. * description="分类ID",
  77. * type="string"
  78. * ),
  79. * @SWG\Response(
  80. * response="200",
  81. * description="success",
  82. * @SWG\Schema(ref="#/definitions/GetGoodsListResultBean")
  83. * ),
  84. * @SWG\Response(
  85. * response="403",
  86. * description="fail",
  87. * @SWG\Schema(ref="#/definitions/ErrorBean")
  88. * )
  89. * )
  90. */
  91. public function getGoodsList()
  92. {
  93. $data = BuyLogic::getGoodsListLogic();
  94. return $this->success($data);
  95. }
  96. /**
  97. * @SWG\Get(
  98. * path="/buy/goods/detail",
  99. * tags={"电商导购"},
  100. * summary="商品详情页",
  101. * description="商品详情页",
  102. * produces={"application/json"},
  103. * @SWG\Parameter(
  104. * name="source",
  105. * in="query",
  106. * description="来源 jd-京东,vip-唯品会,pdd-拼多多,kaola-考拉,taobao-淘宝",
  107. * type="string"
  108. * ),
  109. * @SWG\Parameter(
  110. * name="goods_id",
  111. * in="query",
  112. * description="商品ID",
  113. * type="string"
  114. * ),
  115. * @SWG\Response(
  116. * response="200",
  117. * description="success",
  118. * @SWG\Schema(
  119. * @SWG\Property(
  120. * property="goods_name",
  121. * type="string",
  122. * description="商品名称"
  123. * ),
  124. * @SWG\Property(
  125. * property="price",
  126. * type="string",
  127. * description="优惠价"
  128. * ),
  129. * @SWG\Property(
  130. * property="market_price",
  131. * type="string",
  132. * description="市场价格"
  133. * ),
  134. * @SWG\Property(
  135. * property="discount",
  136. * type="string",
  137. * description="优惠金额"
  138. * ),
  139. * @SWG\Property(
  140. * property="commission",
  141. * type="string",
  142. * description="佣金"
  143. * ),
  144. * @SWG\Property(
  145. * property="url",
  146. * type="string",
  147. * description="购买链接"
  148. * ),
  149. * @SWG\Property(
  150. * property="goods_carousel_pictures",
  151. * type="string",
  152. * description="商品轮播图(数组)"
  153. * ),
  154. * @SWG\Property(
  155. * property="goods_detail_pictures",
  156. * type="string",
  157. * description="商品详情图片(数组)"
  158. * ),
  159. * )
  160. * ),
  161. * @SWG\Response(
  162. * response="403",
  163. * description="fail",
  164. * @SWG\Schema(ref="#/definitions/ErrorBean")
  165. * )
  166. * )
  167. */
  168. public function getGoodsDetail()
  169. {
  170. $data = BuyLogic::getGoodsDetailLogic();
  171. return $this->success($data);
  172. }
  173. /**
  174. * @SWG\Post(
  175. * path="/buy/goods/search",
  176. * tags={"电商导购"},
  177. * summary="商品搜索接口",
  178. * description="商品搜索接口",
  179. * produces={"application/json"},
  180. * @SWG\Parameter(
  181. * name="keyword",
  182. * in="query",
  183. * description="搜索关键词",
  184. * type="string"
  185. * ),
  186. * @SWG\Parameter(
  187. * name="page",
  188. * in="query",
  189. * description="第几页",
  190. * type="string"
  191. * ),
  192. * @SWG\Parameter(
  193. * name="page_size",
  194. * in="query",
  195. * description="每页数量",
  196. * type="string"
  197. * ),
  198. * @SWG\Parameter(
  199. * name="sort",
  200. * in="query",
  201. * description="1-综合排序,2-价格升序,3-销量降序 默认1",
  202. * type="string"
  203. * ),
  204. * @SWG\Parameter(
  205. * name="source",
  206. * in="query",
  207. * description="来源 jd-京东,vip-唯品会,pdd-拼多多,kaola-考拉,taobao-淘宝",
  208. * type="string"
  209. * ),
  210. * @SWG\Response(
  211. * response="200",
  212. * description="success",
  213. * @SWG\Schema(ref="#/definitions/GetGoodsListResultBean")
  214. * ),
  215. * @SWG\Response(
  216. * response="403",
  217. * description="fail",
  218. * @SWG\Schema(ref="#/definitions/ErrorBean")
  219. * )
  220. * )
  221. */
  222. public function getGoodsSearch()
  223. {
  224. $data = BuyLogic::getGoodsSearchLogic();
  225. return $this->success($data);
  226. }
  227. }