Authored by wei

资源位相关

# 添加内容
> 接口名: `/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": "添加成功."
}
```
... ...
# 新增资源分类
> 接口名: `/resources/addResSort
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|---|----|--------|
|sortName|string|ipad|分类名称|是|50
|platformId|int|1|平台编号|否|11
|status|int|1|是否启用|是|1
### 对应SQL的操作库表
```xml
<insert id="insertResourcesSort" parameterType="com.yohobuy.platform.dal.cms.model.ResourcesSort" >
insert into resources_sort
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="sortName != null" >
sort_name,
</if>
<if test="platformId != null" >
platform_id,
</if>
create_time,
<if test="status != null" >
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="sortName != null" >
#{sortName,jdbcType=VARCHAR},
</if>
<if test="platformId != null" >
#{platformId,jdbcType=INTEGER},
</if>
UNIX_TIMESTAMP(),
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
</trim>
</insert>
```
### 错误编码
-------------------------
|错误码code|消息|说明|
|--------|----|----|
|200|添加成功| |
|400|分类名称不能为空!| |
|404|平台id不能为空!| |
|500|新增资源分类失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "添加成功."
}
```
... ...
# 删除内容
> 接口名: `/resources/delResContent
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|---|----|--------|
|Id|int|4|内容id|是|11
### 对应SQL的操作库表
```xml
<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>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from resources_content
where id = #{id,jdbcType=INTEGER}
</delete>
```
### 错误编码
-------------------------
|错误码code|消息|说明|
|--------|----|----|
|200|操作成功| |
|400|资源内容数据id不存在!| |
|400|资源内容数据id有误| |
|500|资源内容数据删除失败!| |
### 返回
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "删除成功."
}
```
... ...
# 修改资源分类
> 接口名: `/resources/updateResSort
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|---|----|--------|
|sortId|int|2|分类编号|是|11
|sortName|string|资源分类名称|ipad|是|50
|platformId|int|平台id|5|是|11
|status|byte|状态|是|1
### 对应SQL的操作库表
```xml
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.cms.model.ResourcesSort" >
update resources_sort
<set >
<if test="sortName != null" >
sort_name = #{sortName,jdbcType=VARCHAR},
</if>
<if test="platformId != null" >
platform_id = #{platformId,jdbcType=INTEGER},
</if>
<if test="status != null" >
status = #{status,jdbcType=TINYINT},
</if>
</set>
where sort_id = #{sortId,jdbcType=INTEGER}
</update>
```
### 错误编码
-------------------------
|错误码code|消息|说明|
|--------|----|----|
|200|操作成功| |
|500|更新资源分类失败| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "修改成功."
}
```
... ...