|
|
# 添加内容
|
|
|
|
|
|
> 接口名: `/resources/addResContent
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|---|----|--------|
|
|
|
|rId|int|4|资源id|是|11
|
|
|
|content|string|{0: "{\"template_name\":\"text\",\"data\":{\"text\":\"a1\"}}"}| |
|
|
|
|data_id|string|{0: "id_5743",1: "id_5744"}
|
|
|
|
|
|
|
|
|
### 对应SQL的操作库表
|
|
|
|
|
|
```xml
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from resources
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
,
|
|
|
<include refid="Blob_Column_List" />
|
|
|
from resources_content_data
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.cms.model.ResourcesContent" >
|
|
|
update resources_content
|
|
|
<set >
|
|
|
<if test="platformId != null" >
|
|
|
platform_id = #{platformId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="sortId != null" >
|
|
|
sort_id = #{sortId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="resourcesId != null" >
|
|
|
resources_id = #{resourcesId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="name != null" >
|
|
|
name = #{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="orderBy != null" >
|
|
|
order_by = #{orderBy,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time = #{createTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
```
|
|
|
|
|
|
### 错误编码
|
|
|
|
|
|
-------------------------
|
|
|
|错误码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|200|操作成功| |
|
|
|
|400|所管理资源不存在!| |
|
|
|
|500|更新排序出错!| |
|
|
|
|500|通过id修改内容出错!| |
|
|
|
|
|
|
### 返回
|
|
|
{
|
|
|
"code": 200,
|
|
|
"data": [],
|
|
|
"md5": "d751713988987e9331980363e24189ce",
|
|
|
"message": "添加成功."
|
|
|
}
|
|
|
|
|
|
``` |
...
|
...
|
|