|
|
# 添加尺码接口
|
|
|
|
|
|
> 接口名: `/product/addSize`
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|---|----|--------|
|
|
|
|sizeName|string|L|名称|是|10
|
|
|
|
|
|
|
|
|
|
|
|
### 对应SQL的操作库表
|
|
|
|
|
|
```xml
|
|
|
<insert id="insert" parameterType="com.yohobuy.platform.dal.product.model.Size" >
|
|
|
insert into size (id, size_name, sort_id,
|
|
|
attribute_id, order_by, create_time,
|
|
|
update_time)
|
|
|
values (#{id,jdbcType=SMALLINT}, #{sizeName,jdbcType=VARCHAR}, #{sortId,jdbcType=SMALLINT},
|
|
|
#{attributeId,jdbcType=VARCHAR}, #{orderBy,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
|
|
|
#{updateTime,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
```
|
|
|
|
|
|
### 错误编码
|
|
|
|
|
|
-------------------------
|
|
|
|错误码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|200| 添加成功!| |
|
|
|
|400| 操作失败!| |
|
|
|
|
|
|
### 返回
|
|
|
|
|
|
``` json
|
|
|
{
|
|
|
"code":200,
|
|
|
"message":"添加成功!"
|
|
|
}
|
|
|
|
|
|
# 单独排序信息
|
|
|
|
|
|
> 接口名: `/product/saveSearchSort`
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|---|----|--------|
|
|
|
|searchSortList|json字符串||productSkn必填 id 当此为修改的封面则必填否则认为为新增 modelId 品牌排序填“1”,奥莱排序填“2,”,搜索排序填“3”) projectId 填写1 |必填|100|
|
|
|
|
|
|
|
|
|
|
|
|
### 对应SQL的操作库表
|
|
|
|
|
|
```xml
|
|
|
<insert id="insertBatch" parameterType="java.util.List">
|
|
|
insert into product_search (product_skn, model_id,
|
|
|
project_id, int_value, string_value, create_time, product_id)
|
|
|
values
|
|
|
<foreach collection="productSearchList" item="item" index="index" separator="," >
|
|
|
(#{item.productSkn},#{item.modelId},#{item.projectId},#{item.intValue},#{item.stringValue},#{item.createTime}, #{item.productId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateBatch" parameterType="java.util.List">
|
|
|
update product_search
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
<trim prefix="int_value =case" suffix="end,">
|
|
|
<foreach collection="productSearchList" item="item" index="index">
|
|
|
<if test="item.intValue!=null">
|
|
|
when id=#{item.id,jdbcType=INTEGER} then #{item.intValue,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
</foreach>
|
|
|
</trim>
|
|
|
<trim prefix="string_value =case" suffix="end,">
|
|
|
<foreach collection="productSearchList" item="item" index="index">
|
|
|
<if test="item.stringValue!=null">
|
|
|
when id=#{item.id,jdbcType=INTEGER} then #{item.stringValue,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</foreach>
|
|
|
</trim>
|
|
|
</trim>
|
|
|
where
|
|
|
<foreach collection="productSearchList" separator="or" item="item" index="index" >
|
|
|
id= #{item.id,jdbcType=INTEGER}
|
|
|
</foreach>
|
|
|
|
|
|
</update>
|
|
|
```
|
|
|
|
|
|
### 错误编码
|
|
|
|
|
|
-------------------------
|
|
|
|错误码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|200| 添加成功!| |
|
|
|
|400| 操作失败!| |
|
|
|
|
|
|
### 返回
|
|
|
|
|
|
``` json
|
|
|
{
|
|
|
"code": 200,
|
|
|
"data": [],
|
|
|
"md5": "d751713988987e9331980363e24189ce",
|
|
|
"message": "保存排序信息成功"
|
|
|
}
|
|
|
|
|
|
``` |
|
|
\ No newline at end of file |
...
|
...
|
|