Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-doc into develop
Showing
1 changed file
with
136 additions
and
44 deletions
1 | -# 商家端店铺接口 | ||
2 | - | ||
3 | -## 查询店铺下关联品牌 | ||
4 | - | ||
5 | -> /MerchantShopsRest/queryMerchantBrandByShopsId | ||
6 | - | ||
7 | -### 返回 | ||
8 | - | ||
9 | -```json | ||
10 | -{ | ||
11 | - "code": 200, | ||
12 | - "data": [ | ||
13 | - { | ||
14 | - // 品牌 ID | ||
15 | - "id": 928, | ||
16 | - // 品牌名称 | ||
17 | - "text": "得宝" | ||
18 | - } | ||
19 | - ], | ||
20 | - "message": "店铺下关联品牌" | ||
21 | -} | ||
22 | -``` | ||
23 | - | ||
24 | -## 查询店铺下关联供应商 | ||
25 | - | ||
26 | -> /MerchantShopsRest/queryMerchantSupplierByShopsId | ||
27 | - | ||
28 | -### 返回 | ||
29 | - | ||
30 | -```json | ||
31 | -{ | ||
32 | - "code": 200, | ||
33 | - "data": [ | ||
34 | - { | ||
35 | - // 供应商 | ||
36 | - "id": 950, | ||
37 | - // 供应商名称 | ||
38 | - "text": "德宝纸巾有限公司" | ||
39 | - } | ||
40 | - ], | ||
41 | - "md5": "44001c519d1dd9d395521c46606534e9", | ||
42 | - "message": "操作成功" | ||
43 | -} | ||
44 | -``` | 1 | +# 商家端店铺接口 |
2 | + | ||
3 | +## 查询店铺下关联品牌 | ||
4 | + | ||
5 | +> 接口名:/MerchantShopsRest/queryMerchantBrandByShopsId | ||
6 | + | ||
7 | +### 公共参数 | ||
8 | +``` json | ||
9 | +{ | ||
10 | + "x-shop-id":"145" | ||
11 | +} | ||
12 | +``` | ||
13 | +------------------------- | ||
14 | +|属性名称|类型|例子|说明|是否必填|长度限制| | ||
15 | +|--------|----|----|----|-----|----| | ||
16 | +|x-shop-id|String|"145"|店铺ID,站点类型为2(商家平台)|是|无| | ||
17 | +--------------------- | ||
18 | + | ||
19 | +### 1. 对应SQL的操作库表(数据库 erp_supplier,表 shops_brands) | ||
20 | +```xml | ||
21 | + <select id="selectMerchantBrandByShopsId" resultMap="BaseResultMap"> | ||
22 | + select | ||
23 | + <include refid="Base_Column_List" /> | ||
24 | + from shops_brands | ||
25 | + where shops_id = #{shopsId,jdbcType=INTEGER} and status=1 | ||
26 | + </select> | ||
27 | +``` | ||
28 | +### 2. 对应SQL的操作库表(数据库 erp_product,表 brand) | ||
29 | +```xml | ||
30 | + <select id="selectBrandsByBrandIds" resultMap="BaseResultMap"> | ||
31 | + <bind name="size" value="@com.yohobuy.platform.common.util.SqlUtils@getSize(brandIds)" /> | ||
32 | + select | ||
33 | + <include refid="Base_Column_List" /> | ||
34 | + , | ||
35 | + <include refid="Blob_Column_List" /> | ||
36 | + from brand | ||
37 | + <where> | ||
38 | + <if test="brandIds !=null and size!=0"> | ||
39 | + id in | ||
40 | + <foreach collection="brandIds" item="brandId" open="(" separator="," close=")"> | ||
41 | + #{brandId} | ||
42 | + </foreach> | ||
43 | + </if> | ||
44 | + </where> | ||
45 | + </select> | ||
46 | +``` | ||
47 | +### 错误编码 | ||
48 | +------------------------- | ||
49 | +|错误码code|消息|说明| | ||
50 | +|----------|----|----| | ||
51 | +|400|店铺下没有关联品牌|| | ||
52 | +|400|店铺下没有关联品牌|| | ||
53 | +|200|店铺下关联品牌|| | ||
54 | + | ||
55 | +### 返回 | ||
56 | + | ||
57 | +```json | ||
58 | +{ | ||
59 | + "code": 200, | ||
60 | + "data": [ | ||
61 | + { | ||
62 | + // 品牌 ID | ||
63 | + "id": 928, | ||
64 | + // 品牌名称 | ||
65 | + "text": "得宝" | ||
66 | + } | ||
67 | + ], | ||
68 | + "message": "店铺下关联品牌" | ||
69 | +} | ||
70 | +``` | ||
71 | + | ||
72 | +## 查询店铺下关联供应商 | ||
73 | + | ||
74 | +> 接口名: /MerchantShopsRest/queryMerchantSupplierByShopsId | ||
75 | + | ||
76 | +### 公共参数 | ||
77 | +``` json | ||
78 | +{ | ||
79 | + "x-shop-id":"145" | ||
80 | +} | ||
81 | +``` | ||
82 | +------------------------- | ||
83 | +|属性名称|类型|例子|说明|是否必填|长度限制| | ||
84 | +|--------|----|----|----|-----|----| | ||
85 | +|x-shop-id|String|"145"|店铺ID,站点类型为2(商家平台)|是|无| | ||
86 | +--------------------- | ||
87 | + | ||
88 | +### 1. 对应SQL的操作库表(数据库 erp_supplier,表 shops_brands) | ||
89 | +```xml | ||
90 | + <select id="selectMerchantSupplierByShopsId" resultMap="BaseResultMap"> | ||
91 | + select | ||
92 | + <include refid="Base_Column_List" /> | ||
93 | + from shops_brands | ||
94 | + where shops_id = #{shopsId,jdbcType=INTEGER} and status=1 | ||
95 | + </select> | ||
96 | +``` | ||
97 | +### 2. 对应SQL的操作库表(数据库 erp_supplier,表 supplier) | ||
98 | +```xml | ||
99 | + <select id="selectBySupplierIds" resultMap="BaseResultMap"> | ||
100 | + <bind name="size" value="@com.yohobuy.platform.common.util.SqlUtils@getSize(supplierIds)" /> | ||
101 | + select | ||
102 | + <include refid="Base_Column_List" /> | ||
103 | + from supplier | ||
104 | + where is_freeze = 'N' | ||
105 | + <if test="supplierIds !=null and size!=0"> | ||
106 | + and id in | ||
107 | + <foreach collection="supplierIds" item="supplierId" open="(" close=")" separator=","> | ||
108 | + #{supplierId,jdbcType=INTEGER} | ||
109 | + </foreach> | ||
110 | + </if> | ||
111 | + </select> | ||
112 | +``` | ||
113 | +### 错误编码 | ||
114 | +------------------------- | ||
115 | +|错误码code|消息|说明| | ||
116 | +|----------|----|----| | ||
117 | +|无|无|无| | ||
118 | + | ||
119 | + | ||
120 | +### 返回 | ||
121 | + | ||
122 | +```json | ||
123 | +{ | ||
124 | + "code": 200, | ||
125 | + "data": [ | ||
126 | + { | ||
127 | + // 供应商 | ||
128 | + "id": 950, | ||
129 | + // 供应商名称 | ||
130 | + "text": "德宝纸巾有限公司" | ||
131 | + } | ||
132 | + ], | ||
133 | + "md5": "44001c519d1dd9d395521c46606534e9", | ||
134 | + "message": "操作成功" | ||
135 | +} | ||
136 | +``` |
-
Please register or login to post a comment