addRel.md
2.59 KB
增加品牌关注
接口名: /guang/relationship/addRel
方法
POST JSONRAW
入参
属性名称 | 类型 | 例子 | 说明 | 是否必填 | 范围 |
---|---|---|---|---|---|
brandId | Integer | 232 | 品牌ID | 是 | 1-11 |
brandType | Byte | 5 | 品牌类型 | 是 | 1-1 |
activityImg | String | http://img11.static.yhbimg.com/yhb-img01/2015/05/21/11/01b1f048e00c9af01cb25bbf6f622258c5.jpg?imageView/{mode}/w/{width}/h/{height} | 活动图片 | 否 | 0-255 |
对应SQL的操作库表
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yohobuy.platform.dal.guang.model.BrandRelationship" >
insert into brand_relationship
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="brandId != null" >
brand_id,
</if>
<if test="brandType != null" >
brand_type,
</if>
<if test="activityName != null" >
activity_name,
</if>
<if test="discount != null" >
discount,
</if>
<if test="createTime != null" >
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="brandId != null" >
#{brandId,jdbcType=INTEGER},
</if>
<if test="brandType != null" >
#{brandType,jdbcType=TINYINT},
</if>
<if test="activityName != null" >
#{activityName,jdbcType=VARCHAR},
</if>
<if test="discount != null" >
#{discount,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert id="insertBatch" parameterType="java.util.List" >
insert into relationship_image (ship_id, activity_img,
create_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.shipId,jdbcType=INTEGER}, #{item.activityImg,jdbcType=VARCHAR},#{item.createTime,jdbcType=INTEGER})
</foreach>
</insert>
错误编码
错误码code | 消息 | 说明 |
---|---|---|
200 | 添加成功 | |
400 | 添加失败 |
返回
{
"code": "200",
"message":"增加成功"
}