fuxingfan il y a 4 ans
Parent
révision
befe7f99ce

+ 145
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/CurriculumController.java Voir le fichier

@@ -0,0 +1,145 @@
1
+package com.yunzhi.marketing.xlk.controller;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
+import com.yunzhi.marketing.base.BaseController;
6
+import com.yunzhi.marketing.base.ResponseBean;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.web.bind.annotation.PathVariable;
9
+import org.springframework.web.bind.annotation.RequestBody;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RequestMethod;
12
+import org.springframework.web.bind.annotation.RequestParam;
13
+import org.springframework.web.bind.annotation.ResponseBody;
14
+import com.yunzhi.marketing.xlk.service.ICurriculumService;
15
+import com.yunzhi.marketing.xlk.entity.Curriculum;
16
+import org.springframework.web.bind.annotation.RestController;
17
+/**
18
+ * <p>
19
+    * 课程表  前端控制器
20
+    * </p>
21
+ *
22
+ * @author jobob
23
+ * @since 2021-05-18
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+public class CurriculumController extends BaseController {
28
+
29
+    private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CurriculumController.class);
30
+
31
+    @Autowired
32
+    public ICurriculumService iCurriculumService;
33
+
34
+
35
+    /**
36
+     * 分页查询列表
37
+     * @param pageNum
38
+     * @param pageSize
39
+     * @return
40
+     */
41
+    @RequestMapping(value="/curriculum",method= RequestMethod.GET)
42
+    public ResponseBean curriculumList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
43
+                                       @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
44
+        ResponseBean responseBean = new ResponseBean();
45
+        try {
46
+            //使用分页插件
47
+		    IPage<Curriculum> pg = new Page<>(pageNum, pageSize);
48
+            com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<Curriculum> queryWrapper = new com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<>();
49
+            queryWrapper.orderByDesc("create_date");
50
+
51
+            IPage<Curriculum> result = iCurriculumService.page(pg, queryWrapper);
52
+            responseBean.addSuccess(result);
53
+        }catch (Exception e){
54
+            e.printStackTrace();
55
+            logger.error("curriculumList -=- {}",e.toString());
56
+            responseBean.addError(e.getMessage());
57
+        }
58
+        return responseBean;
59
+    }
60
+
61
+    /**
62
+     * 保存对象
63
+     * @param curriculum 实体对象
64
+     * @return
65
+     */
66
+    @RequestMapping(value="/curriculum",method= RequestMethod.POST)
67
+    public ResponseBean curriculumAdd(@RequestBody Curriculum curriculum){
68
+        ResponseBean responseBean = new ResponseBean();
69
+        try {
70
+            if (iCurriculumService.save(curriculum)){
71
+                responseBean.addSuccess(curriculum);
72
+            }else {
73
+                responseBean.addError("fail");
74
+            }
75
+        }catch (Exception e){
76
+            e.printStackTrace();
77
+            logger.error("curriculumAdd -=- {}",e.toString());
78
+            responseBean.addError(e.getMessage());
79
+        }
80
+        return responseBean;
81
+    }
82
+
83
+    /**
84
+     * 根据id删除对象
85
+     * @param id  实体ID
86
+     */
87
+    @ResponseBody
88
+    @RequestMapping(value="/curriculum/{id}", method= RequestMethod.DELETE)
89
+    public ResponseBean curriculumDelete(@PathVariable Integer id){
90
+        ResponseBean responseBean = new ResponseBean();
91
+        try {
92
+            if(iCurriculumService.removeById(id)){
93
+                responseBean.addSuccess("success");
94
+            }else {
95
+                responseBean.addError("fail");
96
+            }
97
+        }catch (Exception e){
98
+            e.printStackTrace();
99
+            logger.error("curriculumDelete -=- {}",e.toString());
100
+            responseBean.addError(e.getMessage());
101
+        }
102
+        return responseBean;
103
+    }
104
+
105
+    /**
106
+     * 修改对象
107
+     * @param id  实体ID
108
+     * @param curriculum 实体对象
109
+     * @return
110
+     */
111
+    @RequestMapping(value="/curriculum/{id}",method= RequestMethod.PUT)
112
+    public ResponseBean curriculumUpdate(@PathVariable Integer id,
113
+                                        @RequestBody Curriculum curriculum){
114
+        ResponseBean responseBean = new ResponseBean();
115
+        try {
116
+            if (iCurriculumService.updateById(curriculum)){
117
+                responseBean.addSuccess(curriculum);
118
+            }else {
119
+                responseBean.addError("fail");
120
+            }
121
+        }catch (Exception e){
122
+            e.printStackTrace();
123
+            logger.error("curriculumUpdate -=- {}",e.toString());
124
+            responseBean.addError(e.getMessage());
125
+        }
126
+        return responseBean;
127
+    }
128
+
129
+    /**
130
+     * 根据id查询对象
131
+     * @param id  实体ID
132
+     */
133
+    @RequestMapping(value="/curriculum/{id}",method= RequestMethod.GET)
134
+    public ResponseBean curriculumGet(@PathVariable Integer id){
135
+        ResponseBean responseBean = new ResponseBean();
136
+        try {
137
+            responseBean.addSuccess(iCurriculumService.getById(id));
138
+        }catch (Exception e){
139
+            e.printStackTrace();
140
+            logger.error("curriculumDelete -=- {}",e.toString());
141
+            responseBean.addError(e.getMessage());
142
+        }
143
+        return responseBean;
144
+    }
145
+}

+ 114
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/Curriculum.java Voir le fichier

@@ -0,0 +1,114 @@
1
+package com.yunzhi.marketing.xlk.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+
5
+import java.time.LocalDateTime;
6
+import com.baomidou.mybatisplus.annotation.TableField;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 课程表 
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2021-05-18
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@TableName("xlk_curriculum")
23
+public class Curriculum implements java.io.Serializable {
24
+
25
+    private static final long serialVersionUID = 1L;
26
+
27
+    /**
28
+     * 主键
29
+     */
30
+    private Integer curriculumId;
31
+
32
+    /**
33
+     * 创建人
34
+     */
35
+    @TableField("CREATED_BY")
36
+    private String createdBy;
37
+
38
+    /**
39
+     * 创建时间
40
+     */
41
+    @TableField("CREATED_TIME")
42
+    private LocalDateTime createdTime;
43
+
44
+    /**
45
+     * 更新人
46
+     */
47
+    @TableField("UPDATED_BY")
48
+    private String updatedBy;
49
+
50
+    /**
51
+     * 更新时间
52
+     */
53
+    @TableField("UPDATED_TIME")
54
+    private LocalDateTime updatedTime;
55
+
56
+    /**
57
+     * 公司id
58
+     */
59
+    @TableField("ORG_ID")
60
+    private Integer orgId;
61
+
62
+    /**
63
+     * 参与对象
64
+     */
65
+    private String roleId;
66
+
67
+    /**
68
+     * 主图
69
+     */
70
+    private String curriculumImg;
71
+
72
+    /**
73
+     * 标题
74
+     */
75
+    private String name;
76
+
77
+    /**
78
+     * 简介
79
+     */
80
+    private String remark;
81
+
82
+    /**
83
+     * 详情类型:0富文本或者1视频
84
+     */
85
+    private Integer type;
86
+
87
+    /**
88
+     * 视频地址
89
+     */
90
+    private String curriculumUrl;
91
+
92
+    /**
93
+     * 富文本内容
94
+     */
95
+    private String content;
96
+
97
+    /**
98
+     * 权重
99
+     */
100
+    @TableField("WEIGHT")
101
+    private Integer weight;
102
+
103
+    /**
104
+     * 阅读人数
105
+     */
106
+    private Integer lookNum;
107
+
108
+    /**
109
+     * 是否发布
110
+     */
111
+    private Integer isPublish;
112
+
113
+
114
+}

+ 16
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/CurriculumMapper.java Voir le fichier

@@ -0,0 +1,16 @@
1
+package com.yunzhi.marketing.xlk.mapper;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Curriculum;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+
6
+/**
7
+ * <p>
8
+ * 课程表  Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2021-05-18
13
+ */
14
+public interface CurriculumMapper extends BaseMapper<Curriculum> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/marketing/xlk/service/ICurriculumService.java Voir le fichier

@@ -0,0 +1,16 @@
1
+package com.yunzhi.marketing.xlk.service;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Curriculum;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程表  服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2021-05-18
13
+ */
14
+public interface ICurriculumService extends IService<Curriculum> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/CurriculumServiceImpl.java Voir le fichier

@@ -0,0 +1,20 @@
1
+package com.yunzhi.marketing.xlk.service.impl;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Curriculum;
4
+import com.yunzhi.marketing.xlk.mapper.CurriculumMapper;
5
+import com.yunzhi.marketing.xlk.service.ICurriculumService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 课程表  服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2021-05-18
16
+ */
17
+@Service
18
+public class CurriculumServiceImpl extends ServiceImpl<CurriculumMapper, Curriculum> implements ICurriculumService {
19
+
20
+}

+ 24912
- 0
src/main/resources/db/marketing-cloud.sql
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 169
- 0
src/main/resources/db/marketing.pdman.json Voir le fichier

@@ -19392,6 +19392,19 @@
19392 19392
               "notNull": false,
19393 19393
               "autoIncrement": false,
19394 19394
               "defaultValue": ""
19395
+            },
19396
+            {
19397
+              "name": "look_num",
19398
+              "type": "Integer",
19399
+              "remark": "",
19400
+              "chnname": "阅读人数"
19401
+            },
19402
+            {
19403
+              "name": "is_publish",
19404
+              "type": "Integer",
19405
+              "remark": "",
19406
+              "chnname": "是否发布",
19407
+              "defaultValue": "0"
19395 19408
             }
19396 19409
           ],
19397 19410
           "indexs": [],
@@ -19442,6 +19455,162 @@
19442 19455
             }
19443 19456
           ],
19444 19457
           "chnname": "视频表"
19458
+        },
19459
+        {
19460
+          "title": "xlk_curriculum",
19461
+          "fields": [
19462
+            {
19463
+              "name": "curriculum_id",
19464
+              "type": "Integer",
19465
+              "remark": "",
19466
+              "chnname": "主键",
19467
+              "pk": true,
19468
+              "notNull": true
19469
+            },
19470
+            {
19471
+              "name": "CREATED_BY",
19472
+              "type": "IdOrKey",
19473
+              "remark": "",
19474
+              "chnname": "创建人"
19475
+            },
19476
+            {
19477
+              "name": "CREATED_TIME",
19478
+              "type": "DateTime",
19479
+              "remark": "",
19480
+              "chnname": "创建时间"
19481
+            },
19482
+            {
19483
+              "name": "UPDATED_BY",
19484
+              "type": "IdOrKey",
19485
+              "remark": "",
19486
+              "chnname": "更新人"
19487
+            },
19488
+            {
19489
+              "name": "UPDATED_TIME",
19490
+              "type": "DateTime",
19491
+              "remark": "",
19492
+              "chnname": "更新时间"
19493
+            },
19494
+            {
19495
+              "name": "ORG_ID",
19496
+              "type": "Integer",
19497
+              "remark": "",
19498
+              "chnname": "公司id"
19499
+            },
19500
+            {
19501
+              "name": "role_id",
19502
+              "type": "DefaultString",
19503
+              "remark": "",
19504
+              "chnname": "参与对象"
19505
+            },
19506
+            {
19507
+              "name": "curriculum_img",
19508
+              "type": "MiddleString",
19509
+              "remark": "",
19510
+              "chnname": "主图"
19511
+            },
19512
+            {
19513
+              "name": "name",
19514
+              "type": "ShortString",
19515
+              "remark": "",
19516
+              "chnname": "标题"
19517
+            },
19518
+            {
19519
+              "name": "remark",
19520
+              "type": "DefaultString",
19521
+              "remark": "",
19522
+              "chnname": "简介"
19523
+            },
19524
+            {
19525
+              "name": "type",
19526
+              "type": "Integer",
19527
+              "remark": "",
19528
+              "chnname": "详情类型:0富文本或者1视频"
19529
+            },
19530
+            {
19531
+              "name": "curriculum_url",
19532
+              "type": "ShortString",
19533
+              "remark": "",
19534
+              "chnname": "视频地址"
19535
+            },
19536
+            {
19537
+              "name": "content",
19538
+              "type": "LongText",
19539
+              "remark": "",
19540
+              "chnname": "富文本内容"
19541
+            },
19542
+            {
19543
+              "name": "WEIGHT",
19544
+              "type": "INT_10",
19545
+              "chnname": "权重",
19546
+              "remark": "",
19547
+              "pk": false,
19548
+              "notNull": false,
19549
+              "autoIncrement": false,
19550
+              "defaultValue": ""
19551
+            },
19552
+            {
19553
+              "name": "look_num",
19554
+              "type": "Integer",
19555
+              "remark": "",
19556
+              "chnname": "阅读人数"
19557
+            },
19558
+            {
19559
+              "name": "is_publish",
19560
+              "type": "Integer",
19561
+              "remark": "",
19562
+              "chnname": "是否发布",
19563
+              "defaultValue": "0"
19564
+            }
19565
+          ],
19566
+          "indexs": [],
19567
+          "headers": [
19568
+            {
19569
+              "fieldName": "chnname",
19570
+              "relationNoShow": false
19571
+            },
19572
+            {
19573
+              "fieldName": "name",
19574
+              "relationNoShow": false
19575
+            },
19576
+            {
19577
+              "fieldName": "type",
19578
+              "relationNoShow": false
19579
+            },
19580
+            {
19581
+              "fieldName": "dataType",
19582
+              "relationNoShow": true
19583
+            },
19584
+            {
19585
+              "fieldName": "remark",
19586
+              "relationNoShow": true
19587
+            },
19588
+            {
19589
+              "fieldName": "pk",
19590
+              "relationNoShow": false
19591
+            },
19592
+            {
19593
+              "fieldName": "notNull",
19594
+              "relationNoShow": true
19595
+            },
19596
+            {
19597
+              "fieldName": "autoIncrement",
19598
+              "relationNoShow": true
19599
+            },
19600
+            {
19601
+              "fieldName": "defaultValue",
19602
+              "relationNoShow": true
19603
+            },
19604
+            {
19605
+              "fieldName": "relationNoShow",
19606
+              "relationNoShow": true
19607
+            },
19608
+            {
19609
+              "fieldName": "uiHint",
19610
+              "relationNoShow": true
19611
+            }
19612
+          ],
19613
+          "chnname": "课程表"
19445 19614
         }
19446 19615
       ],
19447 19616
       "graphCanvas": {

+ 5
- 0
src/main/resources/mapper/xlk/CurriculumMapper.xml Voir le fichier

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.yunzhi.marketing.xlk.mapper.CurriculumMapper">
4
+
5
+</mapper>