updateSC.md 2.45 KB

更新销售类目接口

接口名: /salesCategory/updateSC

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
categoryId String 4 销售类目id 5
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
status String 0 销售类目状态1:开启 0:关闭 5

对应SQL的操作库表

<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.SalesCategory">
        update sales_category
        <set>
            <if test="categoryName != null">
                category_name = #{categoryName,jdbcType=VARCHAR},
            </if>
            <if test="relationParameter != null">
                relation_parameter = #{relationParameter,jdbcType=VARCHAR},
            </if>
            <if test="relationUrl != null">
                relation_url = #{relationUrl,jdbcType=VARCHAR},
            </if>
            <if test="parentId != null">
                parent_id = #{parentId,jdbcType=INTEGER},
            </if>
            <if test="orderBy != null">
                order_by = #{orderBy,jdbcType=INTEGER},
            </if>
            <if test="icon != null">
                icon = #{icon,jdbcType=VARCHAR},
            </if>
            <if test="categoryCode != null">
                category_code = #{categoryCode,jdbcType=VARCHAR},
            </if>
            <if test="state != null">
                state = #{state,jdbcType=INTEGER},
            </if>
            <if test="levelNumber != null">
                level_number = #{levelNumber,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
        </set>
        where category_id = #{categoryId,jdbcType=INTEGER}
    </update>

响应码


响应码code 消息 说明
200 updateSC success
400 类目id丢失/类目名称不能为空

返回

{
    "code": 200,
    "data": {
        "categoryId": "372",
        "categoryName": "跟目录啊",
        "icon": "http://img11.static.yhbimg.com/taobaocms/2016/04/18/16/0121a93ecfadf4c8b47ad078c956dcfd9a.jpg",
        "orderBy": "0",
        "parentId": "0",
        "relationParameter": "110,311"
    },
    "md5": "64d442f3c006622ee872c4a6702c8f7e",
    "message": "updateSC success"
}