addSC.md
3.16 KB
添加销售类目接口
接口名:
/salesCategory/addSC
方法
POST JSONRAW
入参
属性名称 | 类型 | 例子 | 说明 | 是否必填 | 长度限制 |
---|---|---|---|---|---|
categoryName | String | 创意家居 | 销售类目名称 | 是 | 50 |
relationParameter | String | 285,113 | 关联的物理类目id | 否 | 500 |
relationUrl | string | 关联url | 否 | 500 | |
parentId | string | 1 | 父销售类目id | 否 | 5 |
orderBy | string | 0 | 排序 | 否 | 5 |
icon | string | 销售类目图标 | 否 | 255 |
对应SQL的操作库表
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="categoryId" parameterType="com.yohobuy.platform.dal.product.model.SalesCategory">
insert into sales_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="categoryId != null">
category_id,
</if>
<if test="categoryName != null">
category_name,
</if>
<if test="relationParameter != null">
relation_parameter,
</if>
<if test="relationUrl != null">
relation_url,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="orderBy != null">
order_by,
</if>
<if test="icon != null">
icon,
</if>
<if test="categoryCode != null">
category_code,
</if>
<if test="state != null">
state,
</if>
<if test="levelNumber != null">
level_number,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="categoryId != null">
#{categoryId,jdbcType=INTEGER},
</if>
<if test="categoryName != null">
#{categoryName,jdbcType=VARCHAR},
</if>
<if test="relationParameter != null">
#{relationParameter,jdbcType=VARCHAR},
</if>
<if test="relationUrl != null">
#{relationUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="orderBy != null">
#{orderBy,jdbcType=INTEGER},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="categoryCode != null">
#{categoryCode,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="levelNumber != null">
#{levelNumber,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
响应码
响应码code | 消息 | 说明 |
---|---|---|
200 | addSC success |
返回
{
"code": 200,
"data": {
"categoryCode": "372,398,0,0",
"categoryId": "398",
"categoryName": "增加一个子类目",
"createTime": "1460972216",
"icon": "http://img12.static.yhbimg.com/taobaocms/2016/04/18/17/025aff13f10ada5b8933ce89f2e89dd259.jpg",
"levelNumber": "2",
"orderBy": "0",
"parentId": "372",
"relationParameter": "321",
"relationUrl": "",
"state": "1"
},
"md5": "3cb01b294fb33a46f6e01c78b7840055",
"message": "addSC success"
}