商品业务接口文档

商品业务接口文档

1 添加根类型

URLIP:8080/good/addroottype

参数列表:

参数

类型

说明

测试用例

name

String

名称(区分大小写)

熟食

typeimg

int

类型图片(数字编码表示)

2

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 401,

  "desc": "参数格式错误",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 801,

  "desc": "添加商品失败",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

2 添加商品类型

URLIP:8080/good/addgoodtype

参数列表

参数

类型

说明

测试用例

name

String

名称

xiaoxiao

parentid

int

父类编号

1

typeimg

int

类型图片(数字编码表示)

4

 

返回结果示例

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485889120

}

{

  "status": 401,

  "desc": "参数格式错误",

  "content": null,

  "timestamp": 1501485764802

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485764802

}

3 获得所有商品类型

URLIP:8080/good/getalltype

参数列表:

参数

类型

说明

测试用例

pageIndex

int

页码

0

pageSize

int

每页数据条数

10

 

返回结果示例

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485889120

}

{

  "status": 401,

  "desc": "参数格式错误",

  "content": null,

  "timestamp": 1501484057059

}

{

    "status": 0,

    "desc": "OK",

    "content": {

        "content": [

            {

                "img": "12",

                "name": "服饰",

                "id": "1"

            },

            {

                "img": "22",

                "name": "生鲜哈哈",

                "id": "2"

            },

            {

                "img": "1",

                "name": "paidaxing",

                "id": "4"

            },

            {

                "img": "5",

                "name": "xiaoxiao",

                "id": "5"

            },

            {

                "img": "3",

                "name": "xiaoxiao",

                "id": "6"

            },

            {

                "img": "3",

                "name": "xiaoxiao",

                "id": "7"

            }

        ]

    },

    "timestamp": 1503711006866

}

4 修改商品类型名称

URLIP:8080/good/changetypename

参数列表

参数

类型

说明

测试用例

typeid

String

类型编码

1

name

String

名称

水果

 

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485889120

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

5 删除商品类型

URLIP:8080/good/deletetype

参数列表:

参数

类型

说明

测试用例

typeid

int

类型编码(区分大小写)

4

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

6 添加商品

URLIP:8080/good/addgood

参数列表:

参数

类型

说明

测试用例

name

String

名称(区分大小写)

苹果

goodtype

int

商品类型

2

store

int

库存量

50

guige

String

规格

红富士

txm

String

条形码

123

viewPrice

int

展示价格

7

inPrice

int

进货价格

5

other

String

其他

火爆出售

userid

int

用户id

1

storeid

int

店铺id

5

content

String

商品介绍

很好吃

typeList

String

商品分类(颜色、材料等)

日本进口

cpbh

String

产品编号

3

pachage

String

包装

普通包装

color

String

颜色

红色

uptime

String

上市时间

2017-08-20 10:39:57

lrl

double

利润率

0.1

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

7 删除货物

URLIP:8080/good/deletegood

参数列表

参数

类型

说明

测试用例

userid

int

用户id

5

goodid

int

货物id

1

 

返回结果示例

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485764802

}

8 通过id查询商品

URLIP:8080/good/getgoodbyuserid

参数列表:

参数

类型

说明

测试用例

userid

int

用户编号

1

 

返回结果示例

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

 

 

9 查询所有有货物信息

URLIP:8080/good/getallgood

参数列表

(此接口不需要传入任何参数)。

{

    "status": 0,

    "desc": "OK",

    "content": {

        "content": [

            {

                "monthnumber": "6",

                "cpxlh": "2",

                "request": "6",

                "other": "",

                "commontnumber": "6",

                "bad": "3",

                "color": "",

                "inprice": "30",

                "totalnumber": "5",

                "outstore": "26",

                "storeid": "1",

                "good": "5",

                "content": "4",

                "aveprice": "55.0",

                "meddile": "2",

                "id": "1",

                "cpbh": "3",

                "typelist": "8",

                "package": "2",

                "lrl": "2.0",

                "txm": "6",

                "viewprice": "50",

                "store": "50",

                "uptime": "2017-08-23 16:42:54.0",

                "comprice": "53.0",

                "instore": "25",

                "xsdw": "1",

                "name": "3",

                "goodtype": "1",

                "guige": "3"

            }

}

10 通过id来更改货物的所有信息

URLIP:8080/good/modifyallgoodinfobyid

参数列表:

参数

类型

说明

测试用例

id

int

编号

1

name

String

名称(区分大小写)

康师傅牛肉面

goodtype

int

商品类型

1

store

int

库存量

30

guige

String

规格

普通大小

txm

String

条形码

2

viewPrice

int

展示价格

3

inPrice

int

进货价格

2

other

String

其他

userid

int

用户id

1

storeid

int

店铺id

1

content

String

商品介绍

很好吃

typeList

String

商品分类(颜色、材料等)

桶面包装

monthnumber

int

月销量

0

totalnumber

int

总销量

0

commentnumber

int

评论量

50

good

int

好评量

20

meddile

int

中评量

10

bad

int

差评量

20

cpbh

String

产品编号

15

cpxlh

String

产品系列号

5

xsdw

String

销售单位

青百超市

pachage

String

包装

箱装桶面

color

String

颜色

红色

uptime

Timestamp

上市时间

2017-08-20 10:39:57

lrl

double

利润率

0.1

aveprice

double

平均价格

3

comprice

double

统一价格

3.5

instore

Int

进货量

20

outstore

Int

出货量

15

request

Int

预期销量(月)

10

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

11 通过id来更改货物的各种库存信息

URLIP:8080/good/modifygoodstorebyid

参数列表:

参数

类型

说明

测试用例

id

int

编号

1

store

int

库存

50

storeid

int

店铺id

2

instore

int

进货量

40

outstore

int

出货量

30

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

12 通过id来更改货物的各种价格信息

URLIP:8080/good/modifygoodpricebyid

参数列表

参数

类型

说明

测试用例

id

int

商品id

1

viewprice

int

展示价格

23

inprice

int

进货价格

28

aveprice

int

平均价格

22

comprice

int

统一价格

22

 

返回结果示例

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485764802

}

{

  "status": 803,

  "desc": "出现异常,更改商品信息失败",

  "content": null,

  "timestamp": 1501485579384

}

 

13 通过id来修改除了价格和库存之外其他的货物信息

URLIP:8080/good/modifygoodotherinfobyid

参数列表:

参数

类型

说明

测试用例

id

String

编号

1

 

name

String

名称(区分大小写)

老坛酸菜牛肉面

goodtype

int

商品类型

桶面

guige

String

规格

箱装桶面

txm

String

条形码

123

other

String

其他

userid

int

用户id

1

content

String

商品介绍

2

typeList

String

商品分类(颜色、材料等)

2

monthnumber

int

月销量

50

totalnumber

int

总销量

80

commentnumber

int

评论量

30

good

int

好评量

30

meddile

int

中评量

50

bad

int

差评量

20

cpbh

String

产品编号

123

cpxlh

String

产品系列号

3

xsdw

String

销售单位

家润多超市

pachage

String

包装

桶面包装

color

String

颜色

紫色

uptime

Timestamp

上市时间

2017-08-20 10:39:57

lrl

double

利润率

0.2

request

Int

预期销量(月)

50

 

返回结果示例:

{

  "status": 400,

  "desc": "参数不完整",

  "content": null,

  "timestamp": 1501485579384

}

{

  "status": 0,

  "desc": "OK",

  "content": null,

  "timestamp": 1501485608994

}

 

 

猜你喜欢

转载自wljxcxt-zhuanyong.iteye.com/blog/2391173