3. API清单

根据ID获取Banner

GET /v1/banner/id/{id}
1
Parameter Description
id Banner的id号
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
1
2
{
    "id":1,
    "name":"b-1",
    "description":"首页顶部主banner","img":null,"title":null,
    "items":[
        {
            "id":1,
            "img":"",
            "keyword":"12",
            "type":1,
            "name":null,
            "banner_id":1
        },
        {
            "id":2,
            "img":"",
            "keyword":"13",
            "type":1,
            "name":null,
            "banner_id":1
       },
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

根据name获取Banner

/v1/banner/name/{name}

Parameter Description
name Banner的name
  • 可选Banner的name

b-1,b-2 共两个

GET /v1/banner/name/b-1 HTTP/1.1
Host: localhost:8080
1
2
{
	"id": 1,
	"name": "b-1",
	"description": "首页顶部主banner",
	"img": null,
	"title": null,
	"items": [{
		"id": 1,
		"img": "",
		"keyword": "12",
		"type": 1,
		"name": null,
		"banner_id": 1
	}, {
		"id": 2,
		"img": "",
		"keyword": "13",
		"type": 1,
		"name": null,
		"banner_id": 1
	}]
}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Theme 专题

获取一组专题

GET /v1/theme/by/names?names=t-1,t-2 HTTP/1.1
Host: localhost:8080
1
2
Parameter Description
names 一组名称,以逗号分隔
  • 可选专题的name

t-1、t-2、t-3、t-4、t-5、t-6 共6

[{
	"id": 1,
	"title": "清凉一夏,折扣季",
	"description": "首页顶部入口",
	"name": "t-1",
	"entrance_img": "",
	"extend": null,
	"internal_top_img": null,
	"title_img": null,
	"tpl_name": null,
	"online": true
}, {
	"id": 4,
	"title": "每周上新",
	"description": "新品推荐",
	"name": "t-2",
	"entrance_img": null,
	"extend": null,
	"internal_top_img": null,
	"title_img": "",
	"tpl_name": null,
	"online": true
}]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

获取单个专题的详情(含Spu数据)

/v1/theme/name/{name}/with_spu

Parameter Description
name 专题名称
  • 可选专题的name

t-1、t-2、t-3、t-4、t-5、t-6 共6个

GET /v1/theme/name/t-4/with_spu HTTP/1.1
Host: localhost:8080
1
2
"id":6,
    "title":"时尚穿搭",
    "description":"帅点才有女朋友",
    "name":"t-4",
    "extend":null,
    "entrance_img":"",
    "internal_top_img":"",
    "online":true,
    "title_img":null,
    "tpl_name":"irelia",
    "spu_list":[
        {
            "id":2,
            "title":"Sleeve羊绒毛衣",
            "subtitle":"Sleeve风袖说当季经典款",
            "category_id":17,
            "root_category_id":3,
            "price":"77.00",
            "img":"",
            "for_theme_img":"",
            "description":null,
            "discount_price":"62.00",
            "tags":"包邮$热门",
            "is_test":true,
            "online":true,
        }
    ]
  }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Activity 优惠券活动

获取活动(不包含优惠券数据)

/v1/activity/name/{name}

Parameter Description
name 活动名称

当前可使用的活动name=a-2, a-2标识Home主页里的优惠活动

GET /v1/activity/name/a-2 HTTP/1.1
Host: localhost:8080
1
2
{
    "id":1,
    "title":"全场无门槛立减券",
    "entrance_img":"",
    "online":true,
    "remark":"全场无门槛立减",
    "start_time":null,
    "end_time":null
}
1
2
3
4
5
6
7
8
9

获取活动(携带优惠券数据)

/v1/activity/name/{name}/with_spu

Parameter Description
name 专题名称
GET /v1/theme/name/t-4/with_spu HTTP/1.1
Host: localhost:8080
1
2
    "id":2,
    "title":"夏日好礼送不停",
    "entrance_img":"",
    "online":true,
    "remark":"限服装、鞋、文具等商品",
    "start_time":null,
    "end_time":null,
    "coupons":[
        {
            "id":3,
            "title":"无门槛减0.1券",
            "start_time":1564956702000,
            "end_time":1943647908000,
            "description":null,
            "full_money":null,
            "minus":0.1,
            "rate":null,
            "type":3,
            "remark":"全场无门槛立减",
            "whole_store":true
        }
    ]
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Coupon 优惠券

获取某个二级分类的可用优惠券

/v1/coupon/by/category/{cid}

Parameter Description
cid 二级分类的id号
GET /v1/coupon/by/category/2 HTTP/1.1
Host: localhost:8080

1
2
3
[
    {
        "id":3,"title":"无门槛减0.1券","start_time":1564956702000,"end_time":1943647908000,"description":null,"full_money":null,"minus":0.10,"rate":null,"type":3,"remark":"全场无门槛立减","whole_store":true
    }
]
1
2
3
4
5

获取全场通用优惠券

/v1/coupon/whole_store

GET /v1/coupon/whole_store HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":3,
        "title":"无门槛减0.1券",
        "start_time":1564956702000,
        "end_time":1943647908000,
        "description":null,
        "full_money":null,
        "minus":0.1,
        "rate":null,
        "type":3,
        "remark":"全场无门槛立减",
        "whole_store":true
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

获取我的优惠券

  • 优惠券有三种状态,分别是:
    1. 可使用,值为1
    2. 已使用,值为2
    3. 已过期,值为3

/v1/coupon/myselft/by/status/{status}

Parameter Description
status 我的优惠券状态(1,2,3)
GET /v1/coupon/myself/by/status/3 HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":4,
        "title":"满500减100券",
        "start_time":1564956702000,
        "end_time":1564956708000,
        "description":null,
        "full_money":500,
        "minus":101,
        "rate":null,
        "type":1,
        "remark":"限服装、鞋、文具等商品",
        "whole_store":false
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

获取我可用的优惠券(带分类数据)

此接口用于下单时检验用户的优惠券是否可以使用,所以需要携带分类数据

/v1/coupon/myselft/available/with_category

GET /v1/coupon/myselft/available/with_category HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":4,
        "title":"满500减100券",
        "start_time":1564956702000,
        "end_time":1564956708000,
        "description":null,
        "full_money":500,
        "minus":101,
        "rate":null,
        "type":1,
        "remark":"限服装、鞋、文具等商品",
        "whole_store":false
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

领取优惠券

/v1/coupon/collect/{id}

Parameter Description
id 优惠券id
POST /v1/coupon/collect/3 HTTP/1.1
Host: localhost:8080
1
2
{
    error_code: 0
    msg: "ok"
    url: "/v1/coupon/collect/11"
}
1
2
3
4
5

Category 商品分类

获取全部分类数据(1级和2级)

/v1/category/all

GET /v1/category/all HTTP/1.1
Host: localhost:8080
1
2
{
    roots:[
           {
            "id":37,
            "name":"测试数据",
            "is_root":true,
            "img":null,
            "parent_id":null,
            "index":null
        },
        {
            "id":3,
            "name":"包包",
            "is_root":true,
            "img":null,
            "parent_id":null,
            "index":1
        }, 
    ],
     "subs":[
        {
            "id":6,
            "name":"平底鞋",
            "is_root":false,
            "img":"",
            "parent_id":1,
            "index":null
        },
        {
            "id":7,
            "name":"凉鞋",
            "is_root":false,
            "img":null,
            "parent_id":1,
            "index":null
        },
     ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

获取六宫格数据

/v1/category/grid/all

GET /v1/category/grid/all HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":1,
        "title":"服装",
        "img":"https://talelin.coding.net/p/sleeve/git/raw/master/grid/clothing.png",
        "name":null,
        "category_id":null,
        "root_category_id":2
    },
    {
        "id":2,
        "title":"包包",
        "img":"https://talelin.coding.net/p/sleeve/git/raw/master/grid/bag.png",
        "name":null,
        "category_id":null,
        "root_category_id":3
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

SaleExplain 商品补充说明

获取固定说明

/v1/sale_explain/fixed

GET /v1/sale_explain/fixed HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":1,
        "fixed":true,
        "text":"发货地:上海",
        "spu_id":null,
        "index":1,
        "replace_id":null
    },
    {
        "id":2,
        "fixed":true,
        "text":"物流:顺丰",
        "spu_id":null,
        "index":2,
        "replace_id":null
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Search 商品搜索

搜索商品的简要信息(不包含详情数据)

该接口支持分页参数

v1/search?q={keyword}

GET v1/search?q=林白 HTTP/1.1
Host: localhost:8080
1
2
{
    "total":1,
    "count":10,
    "page":0,
    "total_page":1,
    "items":[
        {
            "id":8,
            "title":"ins复古翠绿NoteBook",
            "subtitle":"林白默默的掏出小本本,将她说的话一次不漏的记了下来。",
            "img":"",
            "for_theme_img":"",
            "price":"29.99",
            "discount_price":"27.8",
            "description":null,
            "tags":"林白推荐",
            "sketch_spec_id":"1",
            "max_purchase_quantity":null,
            "min_purchase_quantity":null
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Tag 标签

获取Tag

v1/tag/type/{type}

  • 目前仅支持获取搜索Tag 搜索Tag类型值为 1
GET v1/tag/type/1 HTTP/1.1
Host: localhost:8080
1
2
[
    {
        "id":1,
        "title":"Sleeve",
        "highlight":1,
        "description":null,
        "type":1
    },
    {
        "id":3,
        "title":"林白",
        "highlight":0,
        "description":null,
        "type":1
    }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Spu 商品

获取商品详情

v1/spu/id/{id}/detail

GET v1/spu/id/{12}/detail HTTP/1.1
Host: localhost:8080
1
2
 {
    "id":2,
    "title":"林间有风自营针织衫",
    "subtitle":"瓜瓜设计,3件包邮",
    "category_id":12,
    "root_category_id":2,
    "price":"77.00",
    "img":"",
    "for_theme_img":"",
    "description":null,
    "discount_price":"62.00",
    "tags":"包邮$热门",
    "is_test":true,
    "online":true,
    "sku_list":[
        {
            "id":2,
            "price":77.76,
            "discount_price":null,
            "online":true,
            "img":"",
            "title":"金属灰·七龙珠",
            "spu_id":2,
            "category_id":17,
            "root_category_id":3,
            "specs":[
                {
                    "key_id":1,
                    "key":"颜色",
                    "value_id":45,
                    "value":"金属灰"
                },
                {
                    "key_id":3,
                    "key":"图案",
                    "value_id":9,
                    "value":"七龙珠"
                },
                {
                    "key_id":4,
                    "key":"尺码",
                    "value_id":14,
                    "value":"小号 S"
                }
            ],
            "code":"2$1-45#3-9#4-14",
            "stock":5
        },
        {
            "id":3,
            "price":66,
            "discount_price":59,
            "online":true,
            "img":"",
            "title":"青芒色·灌篮高手",
            "spu_id":2,
            "category_id":17,
            "root_category_id":3,
            "specs":[
                {
                    "key_id":1,
                    "key":"颜色",
                    "value_id":42,
                    "value":"青芒色"
                },
                {
                    "key_id":3,
                    "key":"图案",
                    "value_id":10,
                    "value":"灌篮高手"
                },
                {
                    "key_id":4,
                    "key":"尺码",
                    "value_id":15,
                    "value":"中号 M"
                }
            ],
            "code":"2$1-42#3-10#4-15",
            "stock":999
        },
        {
            "id":4,
            "price":88,
            "discount_price":null,
            "online":true,
            "img":"",
            "title":"青芒色·圣斗士",
            "spu_id":2,
            "category_id":17,
            "root_category_id":3,
            "specs":[
                {
                    "key_id":1,
                    "key":"颜色",
                    "value_id":42,
                    "value":"青芒色"
                },
                {
                    "key_id":3,
                    "key":"图案",
                    "value_id":11,
                    "value":"圣斗士"
                },
                {
                    "key_id":4,
                    "key":"尺码",
                    "value_id":16,
                    "value":"大号  L"
                }
            ],
            "code":"2$1-42#3-11#4-16",
            "stock":8
        },
        {
            "id":5,
            "price":77,
            "discount_price":59,
            "online":true,
            "img":"http://i1.sleeve.7yue.pro/assets/09f32ac8-1af4-4424-b221-44b10bd0986e.png",
            "title":"橘黄色·七龙珠",
            "spu_id":2,
            "category_id":17,
            "root_category_id":3,
            "specs":[
                {
                    "key_id":1,
                    "key":"颜色",
                    "value_id":44,
                    "value":"橘黄色"
                },
                {
                    "key_id":3,
                    "key":"图案",
                    "value_id":9,
                    "value":"七龙珠"
                },
                {
                    "key_id":4,
                    "key":"尺码",
                    "value_id":14,
                    "value":"小号 S"
                }
            ],
            "code":"2$1-44#3-9#4-14",
            "stock":7
        }
    ],
    "spu_img_list":[
        {
            "id":165,
            "img":"http://i1.sleeve.7yue.pro/assets/5605cd6c-f869-46db-afe6-755b61a0122a.png",
            "spu_id":2
        }
    ],
    "spu_detail_img_list":[
        {
            "id":24,
            "img":"http://i2.sleeve.7yue.pro/n4.png",
            "spu_id":2,
            "index":1
        }
    ],
    "sketch_spec_id":1,
    "default_sku_id":2
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166

获取商品列表(最新)

v1/spu/latest

GET v1/spu/latest HTTP/1.1
Host: localhost:8080
1
2
    {
    "total":17,
    "count":10,
    "page":0,
    "total_page":2,
    "items":[
        {
            "id":27,
            "title":"Mier双色靠椅",
            "subtitle":"安静的午后,一杯清茶,追忆似水年华。看清风浮动,看落日余晖",
            "img":"http://i2.sleeve.7yue.pro/h1.png",
            "for_theme_img":"http://i1.sleeve.7yue.pro/assets/f6c9fce8-626f-44c0-a709-3f6ef9f3fbef.png",
            "price":"1299",
            "discount_price":null,
            "description":null,
            "tags":"",
            "sketch_spec_id":"1",
            "max_purchase_quantity":null,
            "min_purchase_quantity":null
        }
    ]
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

按分类获取商品

v1/spu/by/category/{id}

GET v1/spu/by/category/32 HTTP/1.1
Host: localhost:8080
1
2
    "total":5,
    "count":10,
    "page":0,
    "total_page":1,
    "items":[
        {
            "id":10,
            "title":"英雄碳素墨水",
            "subtitle":"虽然我们早已不再使用钢笔书写,但钢笔在纸上划过的笔触永远是键盘无法替代的。一只钢笔+一瓶墨水在一个安静的午后,写写内心的故事。",
            "img":"http://i1.sleeve.7yue.pro/assets/0bb351c7-4dba-4403-8d4e-f98a2f440098.png",
            "for_theme_img":"",
            "price":"80.00",
            "discount_price":"69.00",
            "description":null,
            "tags":"",
            "sketch_spec_id":null,
            "max_purchase_quantity":null,
            "min_purchase_quantity":null
        }
    ]
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
最后更新: 11/8/2019, 4:57:37 PM
0/140
评论
0
暂无评论
  • 上一页
  • 首页
  • 1
  • 尾页
  • 下一页
  • 总共1页