Showing
1 changed file
with
65 additions
and
46 deletions
1 | # 查询资讯分类资源 | 1 | # 查询资讯分类资源 |
2 | 2 | ||
3 | -> 接口名: `/guang/article/sort/getList | 3 | +> 接口名: `/guang/article/sort/addSort |
4 | 4 | ||
5 | ### 方法 | 5 | ### 方法 |
6 | 6 | ||
7 | -> GET | ||
8 | - | ||
9 | -### 无参 | 7 | +> POST |
10 | 8 | ||
9 | +### 入参 | ||
10 | +------------------------- | ||
11 | +|属性名称|类型|例子|说明| | ||
12 | +|--------|----|----|----| | ||
13 | +|parent_id|Integer|1|父类分类| | ||
14 | +|name|String|流行|分类名称| | ||
15 | +|status|Byte|1|状态| | ||
16 | +|orderBy|Byte|3|排序| | ||
17 | +|advertCode|String|324dfasf|广告码| | ||
18 | +--------------------- | ||
11 | 19 | ||
12 | 20 | ||
13 | ### 对应SQL的操作库表 | 21 | ### 对应SQL的操作库表 |
14 | 22 | ||
15 | -```xml | ||
16 | - <select id="selectAllSortList" resultMap="BaseResultMap"> | ||
17 | - select | ||
18 | - <include refid="Base_Column_List" /> | ||
19 | - from article_sort | ||
20 | - order by order_by DESC | ||
21 | - </select> | 23 | +```<insert id="insertSelective" parameterType="com.yohobuy.platform.dal.guang.model.ArticleSort"> |
24 | + insert into article_sort | ||
25 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
26 | + <if test="id != null"> | ||
27 | + id, | ||
28 | + </if> | ||
29 | + <if test="parentId != null"> | ||
30 | + parent_id, | ||
31 | + </if> | ||
32 | + <if test="name != null"> | ||
33 | + name, | ||
34 | + </if> | ||
35 | + <if test="status != null"> | ||
36 | + status, | ||
37 | + </if> | ||
38 | + <if test="orderBy != null"> | ||
39 | + order_by, | ||
40 | + </if> | ||
41 | + <if test="advertCode != null"> | ||
42 | + advert_code, | ||
43 | + </if> | ||
44 | + <if test="createTime != null"> | ||
45 | + create_time, | ||
46 | + </if> | ||
47 | + </trim> | ||
48 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
49 | + <if test="id != null"> | ||
50 | + #{id,jdbcType=INTEGER}, | ||
51 | + </if> | ||
52 | + <if test="parentId != null"> | ||
53 | + #{parentId,jdbcType=INTEGER}, | ||
54 | + </if> | ||
55 | + <if test="name != null"> | ||
56 | + #{name,jdbcType=VARCHAR}, | ||
57 | + </if> | ||
58 | + <if test="status != null"> | ||
59 | + #{status,jdbcType=TINYINT}, | ||
60 | + </if> | ||
61 | + <if test="orderBy != null"> | ||
62 | + #{orderBy,jdbcType=TINYINT}, | ||
63 | + </if> | ||
64 | + <if test="advertCode != null"> | ||
65 | + #{advertCode,jdbcType=VARCHAR}, | ||
66 | + </if> | ||
67 | + <if test="createTime != null"> | ||
68 | + #{createTime,jdbcType=INTEGER}, | ||
69 | + </if> | ||
70 | + </trim> | ||
71 | + </insert> | ||
22 | ``` | 72 | ``` |
23 | 73 | ||
24 | ### 错误编码 | 74 | ### 错误编码 |
@@ -26,47 +76,16 @@ | @@ -26,47 +76,16 @@ | ||
26 | ------------------------- | 76 | ------------------------- |
27 | |错误码code|消息|说明| | 77 | |错误码code|消息|说明| |
28 | |--------|----|----| | 78 | |--------|----|----| |
29 | -|200|操作成功| | | 79 | +|200|添加成功| | |
80 | +|400|添加失败| | | ||
81 | + | ||
30 | 82 | ||
31 | ### 返回 | 83 | ### 返回 |
32 | 84 | ||
33 | ``` json | 85 | ``` json |
34 | { | 86 | { |
35 | "code": 200, | 87 | "code": 200, |
36 | - "data": [ | ||
37 | - { | ||
38 | - "id": "1", | ||
39 | - "orderBy": "1", | ||
40 | - "status":"1" | ||
41 | - "name":"推荐" | ||
42 | - }, | ||
43 | - { | ||
44 | - "id": "2", | ||
45 | - "orderBy": "2", | ||
46 | - "status":"1" | ||
47 | - "name":"搭配" | ||
48 | - }, | ||
49 | - { | ||
50 | - "id": "3", | ||
51 | - "orderBy": "3", | ||
52 | - "status":"1" | ||
53 | - "name":"潮人" | ||
54 | - }, | ||
55 | - { | ||
56 | - "id": "4", | ||
57 | - "orderBy": "4", | ||
58 | - "status":"1" | ||
59 | - "name":"潮品" | ||
60 | - }, | ||
61 | - { | ||
62 | - "id": "5", | ||
63 | - "orderBy": "5", | ||
64 | - "status":"1" | ||
65 | - "name":"专题" | ||
66 | - } | ||
67 | - ], | ||
68 | - md5=3be40e83baf090a2ea799d9ece2ee199, | ||
69 | - message=分类列表 | 88 | + "message":分类列表 |
70 | } | 89 | } |
71 | 90 | ||
72 | ``` | 91 | ``` |
-
Please register or login to post a comment