BuyController.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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. /**
  228. * @SWG\Get(
  229. * path="/buy/transfer/goods",
  230. * tags={"电商导购"},
  231. * summary="淘宝分享商品详情页接口",
  232. * description="淘宝分享商品详情页接口",
  233. * produces={"application/json"},
  234. * @SWG\Parameter(
  235. * name="user_id",
  236. * in="query",
  237. * description="分享者用户ID",
  238. * type="string"
  239. * ),
  240. * @SWG\Parameter(
  241. * name="goods_id",
  242. * in="query",
  243. * description="商品ID",
  244. * type="string"
  245. * ),
  246. * @SWG\Response(
  247. * response="200",
  248. * description="success",
  249. * @SWG\Schema(
  250. * @SWG\Property(
  251. * property="goods_name",
  252. * type="string",
  253. * description="商品名称"
  254. * ),
  255. * @SWG\Property(
  256. * property="price",
  257. * type="string",
  258. * description="优惠价"
  259. * ),
  260. * @SWG\Property(
  261. * property="market_price",
  262. * type="string",
  263. * description="市场价格"
  264. * ),
  265. * @SWG\Property(
  266. * property="discount",
  267. * type="string",
  268. * description="优惠金额"
  269. * ),
  270. * @SWG\Property(
  271. * property="commission",
  272. * type="string",
  273. * description="佣金"
  274. * ),
  275. * @SWG\Property(
  276. * property="url",
  277. * type="string",
  278. * description="购买链接"
  279. * ),
  280. * @SWG\Property(
  281. * property="goods_carousel_pictures",
  282. * type="string",
  283. * description="商品轮播图(数组)"
  284. * ),
  285. * @SWG\Property(
  286. * property="goods_detail_pictures",
  287. * type="string",
  288. * description="商品详情图片(数组)"
  289. * ),
  290. * )
  291. * ),
  292. * @SWG\Response(
  293. * response="403",
  294. * description="fail",
  295. * @SWG\Schema(ref="#/definitions/ErrorBean")
  296. * )
  297. * )
  298. */
  299. public function transferGoods()
  300. {
  301. $data = BuyLogic::transferGoodsLogic();
  302. return $this->success($data);
  303. }
  304. }