Authored by tanling

长度限制修改

1 -# 新增限购码接口  
2 -  
3 -> 接口名: `/limitCode/addLimitCode`  
4 -  
5 -### 方法  
6 -  
7 -> POST JSONRAW  
8 -  
9 -### 入参  
10 -  
11 --------------------------  
12 -|属性名称|类型|例子|说明|是否必填|长度限制|  
13 -|--------|----|----|----|--------|--------|  
14 -|name|String|新增限购码使用|限购码名称|是|255  
15 -|limitTimes|Integer|10|使用数量|是|11  
16 -|reqDepartment|String|零售运营部/平台运营|申请部门|是|255  
17 -|limitDateFrom|String|2016-02-16 00:00:00|使用期间:开始时间|是|255  
18 -|limitDateTo|String|2016-02-23 00:00:00|使用期间:结束时间|是|255  
19 -|describe|String|联调限购码批次1-未开售|限购码说明|是|255  
20 -|limitSkn|String|51134663|指定商品skn|是|11  
21 -|userTypeLimit|String|新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员|用户类型|否|255  
22 -|creatorName|String|测试账号|申请者名称|是|255  
23 -|creatorId|Integer|2794|申请者id|是|255  
24 -|skus|String|1001;1002;1003|指定sku|否|11  
25 -|skuTimes|String|2;3;5|指定sku的数量用分号分隔,数量是数字|否|11  
26 -|limitCodeType|String|1|生成限购码类型 N:SKN的场合,U:SKU的场合|是|  
27 ----------------------  
28 -  
29 -``` json  
30 -{  
31 - "creatorId": 2794,  
32 - "creatorName": "测试账号",  
33 - "describe": "测试用数据",  
34 - "limitDateFrom": "2016-04-20 05:25:00",  
35 - "limitDateTo": "2016-04-21 10:50:00",  
36 - "limitSkn": "50000613",  
37 - "limitTimes": 30,  
38 - "name": "测试增加限购码",  
39 - "reqDepartment": "零售部/营销策划",  
40 - "userTypeLimit": "新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",  
41 - "skus": "102055",  
42 - "skuTimes": "7",  
43 - "limitCodeType": "U"  
44 -}  
45 -```  
46 -### 对应SQL的操作库表  
47 -  
48 -```xml  
49 - <insert id="addLimitCode" parameterType="com.yohobuy.platform.dal.promotion.model.LimitCode">  
50 - <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">  
51 - SELECT LAST_INSERT_ID() AS id  
52 - </selectKey>  
53 - insert into limit_code  
54 - <trim prefix="(" suffix=")" suffixOverrides="," >  
55 - <if test="name != null" >  
56 - name,  
57 - </if>  
58 - <if test="limitTimes != null" >  
59 - limit_times,  
60 - </if>  
61 - <if test="reqDepartment != null" >  
62 - req_department,  
63 - </if>  
64 - <if test="limitDateFrom != null" >  
65 - limit_date_from,  
66 - </if>  
67 - <if test="limitDateTo != null" >  
68 - limit_date_to,  
69 - </if>  
70 - <if test="describe != null" >  
71 - `describe`,  
72 - </if>  
73 - <if test="limitInfo != null" >  
74 - limit_info,  
75 - </if>  
76 - <if test="userUseLimit != null" >  
77 - user_use_limit,  
78 - </if>  
79 - <if test="userTypeLimit != null" >  
80 - user_type_limit,  
81 - </if>  
82 - <if test="limitSkn != null" >  
83 - limit_skn,  
84 - </if>  
85 - <if test="creatorName != null" >  
86 - creator_name,  
87 - </if>  
88 - <if test="creatorId != null" >  
89 - creator_id,  
90 - </if>  
91 - <if test="createTime != null" >  
92 - create_time,  
93 - </if>  
94 - <if test="status != null" >  
95 - status,  
96 - </if>  
97 - <if test="reason != null" >  
98 - reason,  
99 - </if>  
100 - <if test="batchNo != null" >  
101 - batchNo,  
102 - </if>  
103 - <if test="auditTime != null" >  
104 - audit_time,  
105 - </if>  
106 - <if test="limitCodeType != null" >  
107 - limit_code_type  
108 - </if>  
109 - </trim>  
110 - <trim prefix="values (" suffix=")" suffixOverrides="," >  
111 - <if test="name != null" >  
112 - #{name,jdbcType=VARCHAR},  
113 - </if>  
114 - <if test="limitTimes != null" >  
115 - #{limitTimes,jdbcType=INTEGER},  
116 - </if>  
117 - <if test="reqDepartment != null" >  
118 - #{reqDepartment,jdbcType=VARCHAR},  
119 - </if>  
120 - <if test="limitDateFrom != null" >  
121 - #{limitDateFrom,jdbcType=VARCHAR},  
122 - </if>  
123 - <if test="limitDateTo != null" >  
124 - #{limitDateTo,jdbcType=VARCHAR},  
125 - </if>  
126 - <if test="describe != null" >  
127 - #{describe,jdbcType=VARCHAR},  
128 - </if>  
129 - <if test="limitInfo != null" >  
130 - #{limitInfo,jdbcType=VARCHAR},  
131 - </if>  
132 - <if test="userUseLimit != null" >  
133 - #{userUseLimit,jdbcType=INTEGER},  
134 - </if>  
135 - <if test="userTypeLimit != null" >  
136 - #{userTypeLimit,jdbcType=VARCHAR},  
137 - </if>  
138 - <if test="limitSkn != null" >  
139 - #{limitSkn,jdbcType=VARCHAR},  
140 - </if>  
141 - <if test="creatorName != null" >  
142 - #{creatorName,jdbcType=VARCHAR},  
143 - </if>  
144 - <if test="creatorId != null" >  
145 - #{creatorId,jdbcType=INTEGER},  
146 - </if>  
147 - <if test="createTime != null" >  
148 - #{createTime,jdbcType=VARCHAR},  
149 - </if>  
150 - <if test="status != null" >  
151 - #{status,jdbcType=INTEGER},  
152 - </if>  
153 - <if test="reason != null" >  
154 - #{reason,jdbcType=VARCHAR},  
155 - </if>  
156 - <if test="batchNo != null" >  
157 - #{batchNo,jdbcType=VARCHAR},  
158 - </if>  
159 - <if test="auditTime != null" >  
160 - #{auditTime,jdbcType=VARCHAR},  
161 - </if>  
162 - <if test="limitCodeType != null" >  
163 - #{limitCodeType,jdbcType=CHAR}  
164 - </if>  
165 - </trim>  
166 - </insert>  
167 -```  
168 -  
169 -```xml  
170 -<insert id="insertBatch" parameterType="java.util.List">  
171 - insert into limit_code_sku (id, batchNo, skn,  
172 - sku, sku_limit_times, create_time  
173 - )  
174 - values  
175 - <foreach collection="list" item="item" index="index" separator=",">  
176 - (#{item.id,jdbcType=INTEGER}, #{item.batchno,jdbcType=VARCHAR}, #{item.skn,jdbcType=VARCHAR},  
177 - #{item.sku,jdbcType=VARCHAR}, #{item.skuLimitTimes,jdbcType=INTEGER}, #{item.createTime,jdbcType=VARCHAR}  
178 - )  
179 - </foreach>  
180 - </insert>  
181 -```  
182 -  
183 -### 响应码  
184 -  
185 --------------------------  
186 -|响应码code|消息|说明|  
187 -|--------|----|----|  
188 -|200| 添加成功.| |  
189 -|400| 参数限购码类型不能为空./入口参数skn不能为空./参数sku和sku数量不整合./sku对应的skn和skn不一致./sku和sku数量情报不能为空.| |  
190 -|500| 添加失败.| |  
191 -  
192 -### 返回  
193 -  
194 -``` json  
195 -{  
196 - "code": 200,  
197 - "data": [],  
198 - "md5": "d751713988987e9331980363e24189ce",  
199 - "message": "添加成功."  
200 -}  
201 -  
202 -``` 1 +# 新增限购码接口
  2 +
  3 +> 接口名: `/limitCode/addLimitCode`
  4 +
  5 +### 方法
  6 +
  7 +> POST JSONRAW
  8 +
  9 +### 入参
  10 +
  11 +-------------------------
  12 +|属性名称|类型|例子|说明|是否必填|长度限制|
  13 +|--------|----|----|----|--------|--------|
  14 +|name|String|新增限购码使用|限购码名称|是|1~255
  15 +|limitTimes|Integer|10|使用数量|是|1~11
  16 +|reqDepartment|String|零售运营部/平台运营|申请部门|是|1~255
  17 +|limitDateFrom|String|2016-02-16 00:00:00|使用期间:开始时间|是|1~255
  18 +|limitDateTo|String|2016-02-23 00:00:00|使用期间:结束时间|是|1~255
  19 +|describe|String|联调限购码批次1-未开售|限购码说明|是|1~255
  20 +|limitSkn|String|51134663|指定商品skn|是|1~11
  21 +|userTypeLimit|String|新注册|否|0~255
  22 +|creatorName|String|测试账号|申请者名称|是|1~255
  23 +|creatorId|Integer|2794|申请者id|是|1~255
  24 +|skus|String|1001;1002;1003|指定sku|否|0~11
  25 +|skuTimes|String|2;3;5|指定sku的数量用分号分隔,数量是数字|否|0~11
  26 +|limitCodeType|String|1|生成限购码类型 N:SKN的场合,U:SKU的场合|是|1
  27 +---------------------
  28 +
  29 +``` json
  30 +{
  31 + "creatorId": 2794,
  32 + "creatorName": "测试账号",
  33 + "describe": "测试用数据",
  34 + "limitDateFrom": "2016-04-20 05:25:00",
  35 + "limitDateTo": "2016-04-21 10:50:00",
  36 + "limitSkn": "50000613",
  37 + "limitTimes": 30,
  38 + "name": "测试增加限购码",
  39 + "reqDepartment": "零售部/营销策划",
  40 + "userTypeLimit": "新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",
  41 + "skus": "102055",
  42 + "skuTimes": "7",
  43 + "limitCodeType": "U"
  44 +}
  45 +```
  46 +### 对应SQL的操作库表
  47 +
  48 +```xml
  49 + <insert id="addLimitCode" parameterType="com.yohobuy.platform.dal.promotion.model.LimitCode">
  50 + <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
  51 + SELECT LAST_INSERT_ID() AS id
  52 + </selectKey>
  53 + insert into limit_code
  54 + <trim prefix="(" suffix=")" suffixOverrides="," >
  55 + <if test="name != null" >
  56 + name,
  57 + </if>
  58 + <if test="limitTimes != null" >
  59 + limit_times,
  60 + </if>
  61 + <if test="reqDepartment != null" >
  62 + req_department,
  63 + </if>
  64 + <if test="limitDateFrom != null" >
  65 + limit_date_from,
  66 + </if>
  67 + <if test="limitDateTo != null" >
  68 + limit_date_to,
  69 + </if>
  70 + <if test="describe != null" >
  71 + `describe`,
  72 + </if>
  73 + <if test="limitInfo != null" >
  74 + limit_info,
  75 + </if>
  76 + <if test="userUseLimit != null" >
  77 + user_use_limit,
  78 + </if>
  79 + <if test="userTypeLimit != null" >
  80 + user_type_limit,
  81 + </if>
  82 + <if test="limitSkn != null" >
  83 + limit_skn,
  84 + </if>
  85 + <if test="creatorName != null" >
  86 + creator_name,
  87 + </if>
  88 + <if test="creatorId != null" >
  89 + creator_id,
  90 + </if>
  91 + <if test="createTime != null" >
  92 + create_time,
  93 + </if>
  94 + <if test="status != null" >
  95 + status,
  96 + </if>
  97 + <if test="reason != null" >
  98 + reason,
  99 + </if>
  100 + <if test="batchNo != null" >
  101 + batchNo,
  102 + </if>
  103 + <if test="auditTime != null" >
  104 + audit_time,
  105 + </if>
  106 + <if test="limitCodeType != null" >
  107 + limit_code_type
  108 + </if>
  109 + </trim>
  110 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  111 + <if test="name != null" >
  112 + #{name,jdbcType=VARCHAR},
  113 + </if>
  114 + <if test="limitTimes != null" >
  115 + #{limitTimes,jdbcType=INTEGER},
  116 + </if>
  117 + <if test="reqDepartment != null" >
  118 + #{reqDepartment,jdbcType=VARCHAR},
  119 + </if>
  120 + <if test="limitDateFrom != null" >
  121 + #{limitDateFrom,jdbcType=VARCHAR},
  122 + </if>
  123 + <if test="limitDateTo != null" >
  124 + #{limitDateTo,jdbcType=VARCHAR},
  125 + </if>
  126 + <if test="describe != null" >
  127 + #{describe,jdbcType=VARCHAR},
  128 + </if>
  129 + <if test="limitInfo != null" >
  130 + #{limitInfo,jdbcType=VARCHAR},
  131 + </if>
  132 + <if test="userUseLimit != null" >
  133 + #{userUseLimit,jdbcType=INTEGER},
  134 + </if>
  135 + <if test="userTypeLimit != null" >
  136 + #{userTypeLimit,jdbcType=VARCHAR},
  137 + </if>
  138 + <if test="limitSkn != null" >
  139 + #{limitSkn,jdbcType=VARCHAR},
  140 + </if>
  141 + <if test="creatorName != null" >
  142 + #{creatorName,jdbcType=VARCHAR},
  143 + </if>
  144 + <if test="creatorId != null" >
  145 + #{creatorId,jdbcType=INTEGER},
  146 + </if>
  147 + <if test="createTime != null" >
  148 + #{createTime,jdbcType=VARCHAR},
  149 + </if>
  150 + <if test="status != null" >
  151 + #{status,jdbcType=INTEGER},
  152 + </if>
  153 + <if test="reason != null" >
  154 + #{reason,jdbcType=VARCHAR},
  155 + </if>
  156 + <if test="batchNo != null" >
  157 + #{batchNo,jdbcType=VARCHAR},
  158 + </if>
  159 + <if test="auditTime != null" >
  160 + #{auditTime,jdbcType=VARCHAR},
  161 + </if>
  162 + <if test="limitCodeType != null" >
  163 + #{limitCodeType,jdbcType=CHAR}
  164 + </if>
  165 + </trim>
  166 + </insert>
  167 +```
  168 +
  169 +```xml
  170 +<insert id="insertBatch" parameterType="java.util.List">
  171 + insert into limit_code_sku (id, batchNo, skn,
  172 + sku, sku_limit_times, create_time
  173 + )
  174 + values
  175 + <foreach collection="list" item="item" index="index" separator=",">
  176 + (#{item.id,jdbcType=INTEGER}, #{item.batchno,jdbcType=VARCHAR}, #{item.skn,jdbcType=VARCHAR},
  177 + #{item.sku,jdbcType=VARCHAR}, #{item.skuLimitTimes,jdbcType=INTEGER}, #{item.createTime,jdbcType=VARCHAR}
  178 + )
  179 + </foreach>
  180 + </insert>
  181 +```
  182 +
  183 +### 响应码
  184 +
  185 +-------------------------
  186 +|响应码code|消息|说明|
  187 +|--------|----|----|
  188 +|200| 添加成功.| |
  189 +|400| 参数限购码类型不能为空./入口参数skn不能为空./参数sku和sku数量不整合./sku对应的skn和skn不一致./sku和sku数量情报不能为空.| |
  190 +|500| 添加失败.| |
  191 +
  192 +### 返回
  193 +
  194 +``` json
  195 +{
  196 + "code": 200,
  197 + "data": [],
  198 + "md5": "d751713988987e9331980363e24189ce",
  199 + "message": "添加成功."
  200 +}
  201 +
  202 +```