Authored by wei

资源位

  1 +# 复制资源位预发布
  2 +
  3 +> 接口名: `/resources/copyResContent
  4 +
  5 +### 方法
  6 +
  7 +> POST JSONRAW
  8 +
  9 +### 入参
  10 +
  11 +-------------------------
  12 +|属性名称|类型|例子|说明|是否必填|长度限制|
  13 +|--------|----|----|---|----|--------|
  14 +|rId|int|8|资源位id|是|11
  15 +
  16 +
  17 +### 对应SQL的操作库表
  18 +
  19 +```xml
  20 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  21 + select
  22 + <include refid="Base_Column_List" />
  23 + from resources
  24 + where id = #{id,jdbcType=INTEGER}
  25 + </select>
  26 +
  27 + <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yohobuy.platform.dal.cms.model.Resources" >
  28 + insert into resources
  29 + <trim prefix="(" suffix=")" suffixOverrides="," >
  30 +
  31 + <if test="name != null" >
  32 + name,
  33 + </if>
  34 + <if test="sortId != null" >
  35 + sort_id,
  36 + </if>
  37 + <if test="platformId != null" >
  38 + platform_id,
  39 + </if>
  40 + <if test="code != null" >
  41 + code,
  42 + </if>
  43 + <if test="matchCode != null" >
  44 + match_code,
  45 + </if>
  46 + <if test="createTime != null" >
  47 + create_time,
  48 + </if>
  49 + <if test="publishTime !=null">
  50 + publish_time,
  51 + </if>
  52 + </trim>
  53 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  54 + <if test="name != null" >
  55 + #{name,jdbcType=VARCHAR},
  56 + </if>
  57 + <if test="sortId != null" >
  58 + #{sortId,jdbcType=INTEGER},
  59 + </if>
  60 + <if test="platformId != null" >
  61 + #{platformId,jdbcType=INTEGER},
  62 + </if>
  63 + <if test="code != null" >
  64 + #{code,jdbcType=VARCHAR},
  65 + </if>
  66 + <if test="matchCode != null" >
  67 + #{matchCode,jdbcType=VARCHAR},
  68 + </if>
  69 + <if test="createTime !=null">
  70 + #{createTime,jdbcType=INTEGER},
  71 + </if>
  72 + <if test="publishTime !=null">
  73 + #{publishTime,jdbcType=INTEGER},
  74 + </if>
  75 + </trim>
  76 + </insert>
  77 +
  78 + <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yohobuy.platform.dal.cms.model.ResourcesContent" >
  79 + insert into resources_content
  80 + <trim prefix="(" suffix=")" suffixOverrides="," >
  81 + <if test="platformId != null" >
  82 + platform_id,
  83 + </if>
  84 + <if test="sortId != null" >
  85 + sort_id,
  86 + </if>
  87 + <if test="resourcesId != null" >
  88 + resources_id,
  89 + </if>
  90 + <if test="name != null" >
  91 + name,
  92 + </if>
  93 + <if test="orderBy != null" >
  94 + order_by,
  95 + </if>
  96 + create_time,
  97 + </trim>
  98 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  99 + <if test="platformId != null" >
  100 + #{platformId,jdbcType=INTEGER},
  101 + </if>
  102 + <if test="sortId != null" >
  103 + #{sortId,jdbcType=INTEGER},
  104 + </if>
  105 + <if test="resourcesId != null" >
  106 + #{resourcesId,jdbcType=INTEGER},
  107 + </if>
  108 + <if test="name != null" >
  109 + #{name,jdbcType=VARCHAR},
  110 + </if>
  111 + <if test="orderBy != null" >
  112 + #{orderBy,jdbcType=TINYINT},
  113 + </if>
  114 + UNIX_TIMESTAMP(),
  115 + </trim>
  116 + </insert>
  117 +
  118 + <select id="getByContentId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  119 + SELECT
  120 + <include refid="Base_Column_List"/>
  121 + ,
  122 + <include refid="Blob_Column_List" />
  123 + from resources_content_data where resource_content_id= #{resourceContentId,jdbcType=INTEGER}
  124 + </select>
  125 +
  126 + <insert id="insertSelective" parameterType="com.yohobuy.platform.dal.cms.model.ResourcesContentData" >
  127 + insert into resources_content_data
  128 + <trim prefix="(" suffix=")" suffixOverrides="," >
  129 + <if test="id != null" >
  130 + id,
  131 + </if>
  132 + <if test="platformId != null" >
  133 + platform_id,
  134 + </if>
  135 + <if test="sortId != null" >
  136 + sort_id,
  137 + </if>
  138 + <if test="resourceContentId != null" >
  139 + resource_content_id,
  140 + </if>
  141 + <if test="templateKey != null" >
  142 + template_key,
  143 + </if>
  144 + <if test="createTime != null" >
  145 + create_time,
  146 + </if>
  147 + <if test="contentData != null" >
  148 + content_data,
  149 + </if>
  150 + <if test="preContentId != null" >
  151 + pre_content_id,
  152 + </if>
  153 + </trim>
  154 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  155 + <if test="id != null" >
  156 + #{id,jdbcType=INTEGER},
  157 + </if>
  158 + <if test="platformId != null" >
  159 + #{platformId,jdbcType=INTEGER},
  160 + </if>
  161 + <if test="sortId != null" >
  162 + #{sortId,jdbcType=INTEGER},
  163 + </if>
  164 + <if test="resourceContentId != null" >
  165 + #{resourceContentId,jdbcType=INTEGER},
  166 + </if>
  167 + <if test="templateKey != null" >
  168 + #{templateKey,jdbcType=VARCHAR},
  169 + </if>
  170 + <if test="createTime != null" >
  171 + #{createTime,jdbcType=VARCHAR},
  172 + </if>
  173 + <if test="contentData != null" >
  174 + #{contentData,jdbcType=LONGVARCHAR},
  175 + </if>
  176 + <if test="preContentId != null" >
  177 + #{preContentId,jdbcType=LONGVARCHAR},
  178 + </if>
  179 + </trim>
  180 + </insert>
  181 +```
  182 +
  183 +### 错误编码
  184 +
  185 +-------------------------
  186 +|错误码code|消息|说明|
  187 +|--------|----|----|
  188 +|200|操作成功| |
  189 +|400|资源id不能为空!| |
  190 +|500|资源位无法复制!| |
  191 +
  192 +### 返回
  193 +
  194 +``` json
  195 +{
  196 + "code": 200,
  197 + "data": [
  198 + {
  199 + "contentData": [
  200 + {
  201 + "contentData": "{\"template_name\":\"singleImage\",\"template_intro\":\"一张图片\",\"data\":{\"0\":{\"url\":{},\"alt\":\"\",\"src\":\"http://img10.static.yhbimg.com/yhb-img01/2015/05/22/15/01b90a9c7e541bb4467b30c9a9f3ff0436.jpg?imageView/{mode}/w/{width}/h/{height}\",\"imgId\":\"0\"}}}",
  202 + "createTime": 1461896882,
  203 + "id": 6754,
  204 + "platformId": 1,
  205 + "preContentId": 119,
  206 + "publishTime": 0,
  207 + "resourceContentId": 6760,
  208 + "sortId": 6,
  209 + "templateKey": "123",
  210 + "updateTime": 0
  211 + },
  212 + {
  213 + "contentData": "{\"data\":{\"title\":{\"title\":\"自定义品牌\"},\"list\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/26/19/016f21d6a39d5071e1864943253dcdefde.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"1\",\"name\":\"004\"},\"1\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/13/10/01ecc0da4a2c0ce298b70eae8ef880adc8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"3\",\"name\":\"3SUMMER\"},\"2\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/24/11/0258db45c21576719cbd40f744369a43e7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"4\",\"name\":\"5CM\"},\"3\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/20/20/02b099b0a1fad5f18681dcccbabdbbc0f7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"6\",\"name\":\"ACROSS!\"}}},\"template_name\":\"customBrands\",\"template_intro\":\"自定义品牌\"}",
  214 + "createTime": 1461896882,
  215 + "id": 6756,
  216 + "platformId": 1,
  217 + "preContentId": 127,
  218 + "publishTime": 0,
  219 + "resourceContentId": 6762,
  220 + "sortId": 6,
  221 + "templateKey": "123",
  222 + "updateTime": 0
  223 + },
  224 + {
  225 + "contentData": "{\"template_name\":\"goods\",\"template_intro\":\"添加商品\",\"data\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0128dee5ee03762b49994acba26b33ad4f.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110541\"},\"1\":{\"src\":\"http://img13.static.yhbimg.com/goodsimg/2015/05/19/07/02bb341824c649e449bb75172838cc2137.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110539\"},\"2\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0187370daa7c39034032f23dd13d95a978.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51109824\"}}}",
  226 + "createTime": 1461896882,
  227 + "id": 6758,
  228 + "platformId": 1,
  229 + "preContentId": 123,
  230 + "publishTime": 0,
  231 + "resourceContentId": 6764,
  232 + "sortId": 6,
  233 + "templateKey": "123",
  234 + "updateTime": 0
  235 + },
  236 + {
  237 + "contentData": "{\"template_name\":\"promotion\",\"template_intro\":\"促销专区\",\"data\":{\"promotionId\":\"101\"}}",
  238 + "createTime": 1461896882,
  239 + "id": 6760,
  240 + "platformId": 1,
  241 + "preContentId": 125,
  242 + "publishTime": 0,
  243 + "resourceContentId": 6766,
  244 + "sortId": 6,
  245 + "templateKey": "123",
  246 + "updateTime": 0
  247 + }
  248 + ],
  249 + "resource": {
  250 + "code": "fbae3d10de7d1573b96e4dac6c05b918",
  251 + "createTime": 1461896882,
  252 + "id": 776,
  253 + "matchCode": "",
  254 + "name": "tee manj",
  255 + "platformId": 1,
  256 + "publishTime": 1461983282,
  257 + "sortId": 6
  258 + },
  259 + "status": 2
  260 + },
  261 + {
  262 + "contentData": [
  263 + {
  264 + "contentData": "{\"template_name\":\"singleImage\",\"template_intro\":\"一张图片\",\"data\":{\"0\":{\"url\":{},\"alt\":\"\",\"src\":\"http://img10.static.yhbimg.com/yhb-img01/2015/05/22/15/01b90a9c7e541bb4467b30c9a9f3ff0436.jpg?imageView/{mode}/w/{width}/h/{height}\",\"imgId\":\"0\"}}}",
  265 + "createTime": 1461895996,
  266 + "id": 6746,
  267 + "platformId": 1,
  268 + "preContentId": 119,
  269 + "publishTime": 0,
  270 + "resourceContentId": 6752,
  271 + "sortId": 6,
  272 + "templateKey": "123",
  273 + "updateTime": 0
  274 + },
  275 + {
  276 + "contentData": "{\"data\":{\"title\":{\"title\":\"自定义品牌\"},\"list\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/26/19/016f21d6a39d5071e1864943253dcdefde.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"1\",\"name\":\"004\"},\"1\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/13/10/01ecc0da4a2c0ce298b70eae8ef880adc8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"3\",\"name\":\"3SUMMER\"},\"2\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/24/11/0258db45c21576719cbd40f744369a43e7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"4\",\"name\":\"5CM\"},\"3\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/20/20/02b099b0a1fad5f18681dcccbabdbbc0f7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"6\",\"name\":\"ACROSS!\"}}},\"template_name\":\"customBrands\",\"template_intro\":\"自定义品牌\"}",
  277 + "createTime": 1461895996,
  278 + "id": 6748,
  279 + "platformId": 1,
  280 + "preContentId": 127,
  281 + "publishTime": 0,
  282 + "resourceContentId": 6754,
  283 + "sortId": 6,
  284 + "templateKey": "123",
  285 + "updateTime": 0
  286 + },
  287 + {
  288 + "contentData": "{\"template_name\":\"goods\",\"template_intro\":\"添加商品\",\"data\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0128dee5ee03762b49994acba26b33ad4f.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110541\"},\"1\":{\"src\":\"http://img13.static.yhbimg.com/goodsimg/2015/05/19/07/02bb341824c649e449bb75172838cc2137.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110539\"},\"2\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0187370daa7c39034032f23dd13d95a978.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51109824\"}}}",
  289 + "createTime": 1461895996,
  290 + "id": 6750,
  291 + "platformId": 1,
  292 + "preContentId": 123,
  293 + "publishTime": 0,
  294 + "resourceContentId": 6756,
  295 + "sortId": 6,
  296 + "templateKey": "123",
  297 + "updateTime": 0
  298 + },
  299 + {
  300 + "contentData": "{\"template_name\":\"promotion\",\"template_intro\":\"促销专区\",\"data\":{\"promotionId\":\"101\"}}",
  301 + "createTime": 1461895996,
  302 + "id": 6752,
  303 + "platformId": 1,
  304 + "preContentId": 125,
  305 + "publishTime": 0,
  306 + "resourceContentId": 6758,
  307 + "sortId": 6,
  308 + "templateKey": "123",
  309 + "updateTime": 0
  310 + }
  311 + ],
  312 + "resource": {
  313 + "code": "fbae3d10de7d1573b96e4dac6c05b918",
  314 + "createTime": 1461895996,
  315 + "id": 774,
  316 + "matchCode": "",
  317 + "name": "tee manj",
  318 + "platformId": 1,
  319 + "publishTime": 1461982396,
  320 + "sortId": 6
  321 + },
  322 + "status": 2
  323 + },
  324 + {
  325 + "contentData": [
  326 + {
  327 + "contentData": "{\"template_name\":\"singleImage\",\"template_intro\":\"一张图片\",\"data\":{\"0\":{\"url\":{},\"alt\":\"\",\"src\":\"http://img10.static.yhbimg.com/yhb-img01/2015/05/22/15/01b90a9c7e541bb4467b30c9a9f3ff0436.jpg?imageView/{mode}/w/{width}/h/{height}\",\"imgId\":\"0\"}}}",
  328 + "createTime": 1432278954,
  329 + "id": 119,
  330 + "platformId": 1,
  331 + "preContentId": 119,
  332 + "publishTime": 0,
  333 + "resourceContentId": 119,
  334 + "sortId": 6,
  335 + "templateKey": "123",
  336 + "updateTime": 0
  337 + },
  338 + {
  339 + "contentData": "{\"data\":{\"title\":{\"title\":\"自定义品牌\"},\"list\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/26/19/016f21d6a39d5071e1864943253dcdefde.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"1\",\"name\":\"004\"},\"1\":{\"src\":\"http://img10.static.yhbimg.com/brandLogo/2011/06/13/10/01ecc0da4a2c0ce298b70eae8ef880adc8.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"3\",\"name\":\"3SUMMER\"},\"2\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/24/11/0258db45c21576719cbd40f744369a43e7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"4\",\"name\":\"5CM\"},\"3\":{\"src\":\"http://img12.static.yhbimg.com/brandLogo/2011/06/20/20/02b099b0a1fad5f18681dcccbabdbbc0f7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center\",\"id\":\"6\",\"name\":\"ACROSS!\"}}},\"template_name\":\"customBrands\",\"template_intro\":\"自定义品牌\"}",
  340 + "createTime": 1432279642,
  341 + "id": 127,
  342 + "platformId": 1,
  343 + "preContentId": 127,
  344 + "publishTime": 0,
  345 + "resourceContentId": 127,
  346 + "sortId": 6,
  347 + "templateKey": "123",
  348 + "updateTime": 0
  349 + },
  350 + {
  351 + "contentData": "{\"template_name\":\"goods\",\"template_intro\":\"添加商品\",\"data\":{\"0\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0128dee5ee03762b49994acba26b33ad4f.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110541\"},\"1\":{\"src\":\"http://img13.static.yhbimg.com/goodsimg/2015/05/19/07/02bb341824c649e449bb75172838cc2137.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51110539\"},\"2\":{\"src\":\"http://img10.static.yhbimg.com/goodsimg/2015/05/19/07/0187370daa7c39034032f23dd13d95a978.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90\",\"id\":\"51109824\"}}}",
  352 + "createTime": 1432278954,
  353 + "id": 123,
  354 + "platformId": 1,
  355 + "preContentId": 123,
  356 + "publishTime": 0,
  357 + "resourceContentId": 123,
  358 + "sortId": 6,
  359 + "templateKey": "123",
  360 + "updateTime": 0
  361 + },
  362 + {
  363 + "contentData": "{\"template_name\":\"promotion\",\"template_intro\":\"促销专区\",\"data\":{\"promotionId\":\"101\"}}",
  364 + "createTime": 1432278954,
  365 + "id": 125,
  366 + "platformId": 1,
  367 + "preContentId": 125,
  368 + "publishTime": 0,
  369 + "resourceContentId": 125,
  370 + "sortId": 6,
  371 + "templateKey": "123",
  372 + "updateTime": 0
  373 + }
  374 + ],
  375 + "resource": {
  376 + "code": "fbae3d10de7d1573b96e4dac6c05b918",
  377 + "createTime": 1431399961,
  378 + "id": 31,
  379 + "matchCode": "",
  380 + "name": "tee manj",
  381 + "platformId": 1,
  382 + "publishTime": 0,
  383 + "sortId": 6
  384 + }
  385 + }
  386 + ],
  387 + "md5": "aac38906e4ed136bb5b4f1291d7eef51",
  388 + "message": "操作成功"
  389 +}
  390 +
  391 +```
  1 +# 通过code删除所有资源位
  2 +
  3 +> 接口名: `/resources/deleteAllResourceByCode
  4 +
  5 +### 方法
  6 +
  7 +> POST JSONRAW
  8 +
  9 +### 入参
  10 +
  11 +-------------------------
  12 +|属性名称|类型|例子|说明|是否必填|长度限制|
  13 +|--------|----|----|---|----|--------|
  14 +|code|string|8c48745a39373d621bf5fd80edf59b5e|code码|是|255
  15 +
  16 +
  17 +### 对应SQL的操作库表
  18 +
  19 +```xml
  20 + <delete id="deleteAllResourceByCode">
  21 + delete from resources
  22 + where code = #{code}
  23 + </delete>
  24 +```
  25 +
  26 +### 错误编码
  27 +
  28 +-------------------------
  29 +|错误码code|消息|说明|
  30 +|--------|----|----|
  31 +|200|删除成功| |
  32 +|400|code is null| |
  33 +|500|deleteAllResourceByCode wrong.| |
  34 +
  35 +### 返回
  36 +
  37 +``` json
  38 +{
  39 + "code": 200,
  40 + "data": [],
  41 + "md5": "d751713988987e9331980363e24189ce",
  42 + "message": "删除成功."
  43 +}
  44 +
  45 +```
  1 +# 更新预发布时间
  2 +
  3 +> 接口名: `/resources/updateResPublishTime
  4 +
  5 +### 方法
  6 +
  7 +> POST JSONRAW
  8 +
  9 +### 入参
  10 +
  11 +-------------------------
  12 +|属性名称|类型|例子|说明|是否必填|长度限制|
  13 +|--------|----|----|---|----|--------|
  14 +|id|int|8|资源位id|是|11
  15 +|time|string|2016-04-27 10:50:00|预发布时间|是|225
  16 +
  17 +### 对应SQL的操作库表
  18 +
  19 +```xml
  20 + <update id="updateResPublishTime">
  21 + update resources set publish_time=#{publishTime} where id=#{id}
  22 + </update>
  23 +```
  24 +
  25 +### 错误编码
  26 +
  27 +-------------------------
  28 +|错误码code|消息|说明|
  29 +|--------|----|----|
  30 +|200|操作成功| |
  31 +|400|id can not null| |
  32 +|500|updateResPublishTime wrong| |
  33 +
  34 +### 返回
  35 +
  36 +``` json
  37 +{
  38 + "code": 200,
  39 + "data": [],
  40 + "md5": "d751713988987e9331980363e24189ce",
  41 + "message": "删除成功."
  42 +}
  43 +
  44 +```