--- title: API Reference language_tabs: - bash - javascript includes: search: true toc_footers: - Documentation Powered by Documentarian --- # Info Welcome to the generated API reference. [Get Postman Collection](http://base.dev.com/docs/collection.json) #general ## api/goods > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/goods" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/goods" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": true, "data": { "current_page": 1, "data": [ { "id": 1006002, "goods_sn": "1006002", "name": "轻奢纯棉刺绣水洗四件套", "category_id": 1008009, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/4eb09e08ac9de543d2291d27a6be0b54.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/0c9eb81c7594dbe42802ff1ebbece51a.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/8cfc7b6bfd28687ab3399da08e5ba61b.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/b98cfd7f197b62abd1679321eae253a6.jpg\"]", "keywords": "", "brief": "设计师原款,精致绣花", "is_on_sale": 1, "sort_order": 23, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/8ab2d3287af0cefa2cc539e40600621d.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "919.00", "retail_price": "899.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1006007, "goods_sn": "1006007", "name": "秋冬保暖加厚澳洲羊毛被", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/b7e3438c473a296a7e9feecbd4139af5.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/70422011e5a9855a0723c9c08d0cbbb0.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/f65dbb00aff8b43be02f2c8104208877.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/85e8575c8e473a2f71054e9e36b1211c.jpg\"]", "keywords": "", "brief": "臻品级澳洲进口羊毛", "is_on_sale": 1, "sort_order": 17, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/66425d1ed50b3968fed27c822fdd32e0.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "479.00", "retail_price": "459.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1006010, "goods_sn": "1006010", "name": "秋冬保暖加厚细羊毛被", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/9b40ba300851af1b84ca0749bae70718.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/fd7465ba32e23fd107161306d6b580cc.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/288dc3fe3238962519f3abd5201e411e.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/06cb7ac0991cb4ea236c826e8e6f0a9c.jpg\"]", "keywords": "ddd", "brief": "细腻绵羊毛,保暖性增加一倍", "is_on_sale": 0, "sort_order": 16, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/8fe022126a2789d970f82853be13a5e6.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "679.00", "retail_price": "659.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1006013, "goods_sn": "1006013", "name": "双宫茧桑蚕丝被 空调被", "category_id": 1036000, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/d83cbd9ec177276ba2582ee393eff3db.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/b73852cf22939c4995a5bc8996a4afdd.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/d2fe16d259e0187d6b53eef028e843d1.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/4e8f5c09ae9dd03b5ae5b1287b598cc5.jpg\"]", "keywords": "", "brief": "一级桑蚕丝,吸湿透气柔软", "is_on_sale": 1, "sort_order": 7, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/583812520c68ca7995b6fac4c67ae2c7.png", "share_url": "", "is_new": 0, "is_hot": 1, "unit": "件", "counter_price": "719.00", "retail_price": "699.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1006014, "goods_sn": "1006014", "name": "双宫茧桑蚕丝被 子母被", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/22535d179b6796fbd45a83d6ecea3b50.jpg\",\"http:\/\/yanxuan.nosdn.127.net\/6e93d7d868d918bef0138748ffbd9458.jpg\",\"http:\/\/yanxuan.nosdn.127.net\/ccc21b29557929ec99067a445fc74ea3.jpg\",\"http:\/\/yanxuan.nosdn.127.net\/1479bec93b57855889d93a9f4eef0b72.jpg\"]", "keywords": "", "brief": "双层子母被,四季皆可使用", "is_on_sale": 1, "sort_order": 15, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/2b537159f0f789034bf8c4b339c43750.png", "share_url": "", "is_new": 0, "is_hot": 1, "unit": "件", "counter_price": "14199.00", "retail_price": "1399.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1006051, "goods_sn": "1006051", "name": "皇室御用超柔毛巾", "category_id": 1008001, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/de30c41b94ce203985a228dc787fdcfa.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/de30c41b94ce203985a228dc787fdcfa.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/de30c41b94ce203985a228dc787fdcfa.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/de30c41b94ce203985a228dc787fdcfa.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/de30c41b94ce203985a228dc787fdcfa.jpg\"]", "keywords": "", "brief": "至柔至软,热销50万条", "is_on_sale": 1, "sort_order": 1, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/ad5a317216f9da495b144070ecf1f957.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "条", "counter_price": "79.00", "retail_price": "59.00", "detail": "", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1009009, "goods_sn": "1009009", "name": "白鹅绒秋冬加厚羽绒被", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/33a04714bc15a43d0ce87d71d1d9694a.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/e0999e26962b6e88b05fdfe9ba8ff644.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/dd2aff7f4edb26f5e0f691e94a51c66a.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/78059fd78b649d395f8e5740ba8eb99e.jpg\"]", "keywords": "", "brief": "热销5万条,一条被子过冬", "is_on_sale": 1, "sort_order": 19, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/9791006f25e26b2d7c81f41f87ce8619.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "2019.00", "retail_price": "1999.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1009012, "goods_sn": "1009012", "name": "可水洗舒柔丝羽绒枕", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/c2f88baff6d3d9c954bf437649d26954.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/36176eb5337c5048cf4403b145f43bc4.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/13aae0f61d87198867c088aa50c00043.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/40e881087eae3ef541aa13f6b4e9d356.jpg\"]", "keywords": "", "brief": "超细纤维,蓬松轻盈回弹", "is_on_sale": 1, "sort_order": 2, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/a196b367f23ccfd8205b6da647c62b84.png", "share_url": "", "is_new": 0, "is_hot": 1, "unit": "件", "counter_price": "79.00", "retail_price": "59.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1009013, "goods_sn": "1009013", "name": "可水洗抗菌防螨丝羽绒枕", "category_id": 1008008, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/34bb2ff0358432c3f15e6afa0d5d2104.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/5114eb391397033eca305055e21d9cb3.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/73a866b532183dec74232b0cc1b36428.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/331a2954f81d0cfe764cbdf2e5b6b328.jpg\"]", "keywords": "", "brief": "进口防螨布,热销50万件", "is_on_sale": 1, "sort_order": 3, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/da56fda947d0f430d5f4cf4aba14e679.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "119.00", "retail_price": "99.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1009024, "goods_sn": "1009024", "name": "日式和风懒人沙发", "category_id": 1008002, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/9460f6b30661548c4a864607bfcdf4ca.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/acbdb480bcad193fad77ef6c4f52192e.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/e6feb5f4a0989d212bce068d4907657d.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/6059ab6e106d97c29d5723c1d6f1a11f.jpg\"]", "keywords": "", "brief": "优质莱卡纯棉,和风家居新体验", "is_on_sale": 1, "sort_order": 1, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/149dfa87a7324e184c5526ead81de9ad.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "619.00", "retail_price": "599.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1009027, "goods_sn": "1009027", "name": "皇室御用超柔毛巾80s", "category_id": 1008001, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/35ad21679dbd30a23a8308287ffd4673.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/35ad21679dbd30a23a8308287ffd4673.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/35ad21679dbd30a23a8308287ffd4673.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/35ad21679dbd30a23a8308287ffd4673.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/35ad21679dbd30a23a8308287ffd4673.jpg\"]", "keywords": "", "brief": "轻柔舒适不掉毛", "is_on_sale": 1, "sort_order": 2, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/71cfd849335c498dee3c54d1eb823c17.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "条", "counter_price": "99.00", "retail_price": "79.00", "detail": "", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1010000, "goods_sn": "1010000", "name": "澳洲纯羊毛盖毯 加厚款", "category_id": 1008009, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/57779dbcd9cbb95241123d798f4693c2.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/64c52113e0c5ca42cd363d5854280119.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/b578539da6f0e39eb74991e9a0b74a90.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/b544dee2401c02e95c0a7bc70960eadf.jpg\"]", "keywords": "", "brief": "温暖加厚设计", "is_on_sale": 1, "sort_order": 36, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/3bec70b85337c3eec182e54380ef7370.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "419.00", "retail_price": "399.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1010001, "goods_sn": "1010001", "name": "澳洲纯羊毛盖毯 舒适款", "category_id": 1008009, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/5abc565d5b01e8de15fa16acf58ed40e.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/36cb5783a102c30b818adb7bf5dfde5b.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/057bee2ec4c883077f4dc710c4076369.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/01a2844b480d2456d2e764c0ea2f8201.jpg\"]", "keywords": "", "brief": "100%澳洲美利奴羊毛", "is_on_sale": 1, "sort_order": 33, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/a8b0a5def7d64e411dd98bdfb1fc989b.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "319.00", "retail_price": "299.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1011004, "goods_sn": "1011004", "name": "色织精梳AB纱格纹空调被", "category_id": 1036000, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/f7e77331229098060bbacf2fc6c1708b.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/2720383ea168872acc8d492de9573cc6.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/45e4c14029626178419c82f2837f51ca.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/bb6c28d502704d5c1645d066f79bf61d.jpg\"]", "keywords": "", "brief": "加大加厚,双色精彩", "is_on_sale": 1, "sort_order": 2, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/0984c9388a2c3fd2335779da904be393.png", "share_url": "", "is_new": 0, "is_hot": 1, "unit": "件", "counter_price": "219.00", "retail_price": "199.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null }, { "id": 1015007, "goods_sn": "1015007", "name": "典雅美式全棉刺绣抱枕", "category_id": 1008002, "gallery": "[\"http:\/\/yanxuan.nosdn.127.net\/013657a5a5faf8a9a7e3f39b5bba4eac.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/d46ba997e163430e43735e4ad1caeff0.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/a90e545295d22de031b10aee631e48fe.jpg\", \"http:\/\/yanxuan.nosdn.127.net\/f7188ec871d1f721f64cbe04860a4fe2.jpg\"]", "keywords": "", "brief": "典雅毛线绣,精致工艺", "is_on_sale": 1, "sort_order": 4, "pic_url": "http:\/\/yanxuan.nosdn.127.net\/a2045004de8a6225289376ad54317fc8.png", "share_url": "", "is_new": 0, "is_hot": 0, "unit": "件", "counter_price": "79.00", "retail_price": "59.00", "detail": "

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>

<\/p>", "created_at": "2018-02-01 00:00:00", "updated_at": "2018-02-01 00:00:00", "deleted_at": null } ], "first_page_url": "http:\/\/localhost\/api\/goods?page=1", "from": 1, "last_page": 16, "last_page_url": "http:\/\/localhost\/api\/goods?page=16", "next_page_url": "http:\/\/localhost\/api\/goods?page=2", "path": "http:\/\/localhost\/api\/goods", "per_page": 15, "prev_page_url": null, "to": 15, "total": 239 }, "code": 200, "msg": "OK" } ``` ### HTTP Request `GET api/goods` ## api/goods/{id} > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/goods/1" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/goods/1" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": false, "code": 0, "msg": "No query results for model [App\\Repository\\Models\\Goods] 1" } ``` ### HTTP Request `GET api/goods/{id}` ## api/notify/ali > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/notify/ali" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/notify/ali" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": true, "data": "ali tt", "code": 200, "msg": "success" } ``` ### HTTP Request `GET api/notify/ali` `POST api/notify/ali` `PUT api/notify/ali` `PATCH api/notify/ali` `DELETE api/notify/ali` `OPTIONS api/notify/ali` ## api/notify/wx > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/notify/wx" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/notify/wx" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": false, "data": {}, "code": 0, "msg": "wx tt" } ``` ### HTTP Request `GET api/notify/wx` `POST api/notify/wx` `PUT api/notify/wx` `PATCH api/notify/wx` `DELETE api/notify/wx` `OPTIONS api/notify/wx` #测试 APIs for managing users ## 测试-tt 测试内容 > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/t1?location_id=dolorum&user_id=me&page=4" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d '{"user_id":9,"room_id":"neque","forever":false}' ``` ```javascript const url = new URL( "http://base.dev.com/api/t1" ); let params = { "location_id": "dolorum", "user_id": "me", "page": "4", }; Object.keys(params) .forEach(key => url.searchParams.append(key, params[key])); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; let body = { "user_id": 9, "room_id": "neque", "forever": false } fetch(url, { method: "GET", headers: headers, body: body }) .then(response => response.json()) .then(json => console.log(json)); ``` ### HTTP Request `GET api/t1` #### URL Parameters Parameter | Status | Description --------- | ------- | ------- | ------- `id` | required | The ID of the post. `lang` | optional | The language. #### Query Parameters Parameter | Status | Description --------- | ------- | ------- | ----------- `location_id` | required | The id of the location. `user_id` | required | The id of the user. `page` | required | The page number. #### Body Parameters Parameter | Type | Status | Description --------- | ------- | ------- | ------- | ----------- `user_id` | integer | required | The id of the user. `room_id` | string | optional | The id of the room. `forever` | boolean | optional | Whether to ban the user forever. ## api/t2 > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/t2" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/t2" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "id": 4, "name": "Jessica Jones", "roles": [ "admin" ] } ``` ### HTTP Request `GET api/t2` #用户Auth APIs for managing users ## 登陆 登陆 > Example request: ```bash curl -X POST \ "http://base.dev.com/api/login" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/login" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "POST", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` ### HTTP Request `POST api/login` ## 注册 @param App\Http\Requests\RegPost $request > Example request: ```bash curl -X POST \ "http://base.dev.com/api/reg" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d '{"name":"demo","password":"123456"}' ``` ```javascript const url = new URL( "http://base.dev.com/api/reg" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; let body = { "name": "demo", "password": "123456" } fetch(url, { method: "POST", headers: headers, body: body }) .then(response => response.json()) .then(json => console.log(json)); ``` ### HTTP Request `POST api/reg` #### Body Parameters Parameter | Type | Status | Description --------- | ------- | ------- | ------- | ----------- `name` | string | required | 用户名 `password` | string | required | 密码 ## 获取个人信息 获取个人信息 > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/profile" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/profile" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": false, "code": 0, "msg": "Target class [App\\Services\\User\\UserService] does not exist." } ``` ### HTTP Request `GET api/profile` ## 退出 退出 > Example request: ```bash curl -X GET \ -G "http://base.dev.com/api/logout" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" ``` ```javascript const url = new URL( "http://base.dev.com/api/logout" ); let headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}", }; fetch(url, { method: "GET", headers: headers, }) .then(response => response.json()) .then(json => console.log(json)); ``` > Example response (200): ```json { "success": false, "code": 0, "msg": "Target class [App\\Services\\User\\UserService] does not exist." } ``` ### HTTP Request `GET api/logout`