zhaoliang 3 months ago
parent
commit
60eb72c759
100 changed files with 5226 additions and 0 deletions
  1. 32 0
      .gitignore
  2. 45 0
      xuecheng-plus-base/src/main/java/com/xuecheng/base/config/LocalDateTimeConfig.java
  3. 31 0
      xuecheng-plus-base/src/main/java/com/xuecheng/base/model/PageParams.java
  4. 39 0
      xuecheng-plus-base/src/main/java/com/xuecheng/base/model/PageResult.java
  5. 19 0
      xuecheng-plus-content/pom.xml
  6. 58 0
      xuecheng-plus-content/xuecheng-plus-content-api/pom.xml
  7. 19 0
      xuecheng-plus-content/xuecheng-plus-content-api/src/main/java/com/xuecheng/ContentApplication.java
  8. 42 0
      xuecheng-plus-content/xuecheng-plus-content-api/src/main/java/com/xuecheng/content/api/CourseBaseInfoController.java
  9. 23 0
      xuecheng-plus-content/xuecheng-plus-content-api/src/main/resources/bootstrap.yml
  10. 85 0
      xuecheng-plus-content/xuecheng-plus-content-api/src/main/resources/log4j2-dev.xml
  11. 34 0
      xuecheng-plus-content/xuecheng-plus-content-model/pom.xml
  12. 23 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/dto/QueryCourseParamsDto.java
  13. 116 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseBase.java
  14. 57 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseCategory.java
  15. 62 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseMarket.java
  16. 161 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CoursePublish.java
  17. 156 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CoursePublishPre.java
  18. 60 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseTeacher.java
  19. 103 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/Teachplan.java
  20. 63 0
      xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/TeachplanMedia.java
  21. 19 0
      xuecheng-plus-content/xuecheng-plus-content-service/pom.xml
  22. 90 0
      xuecheng-plus-generator/pom.xml
  23. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseBaseController.java
  24. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseCategoryController.java
  25. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseMarketController.java
  26. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CoursePublishController.java
  27. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CoursePublishPreController.java
  28. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseTeacherController.java
  29. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/TeachplanController.java
  30. 25 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/TeachplanMediaController.java
  31. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseBaseMapper.java
  32. 32 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseBaseMapper.xml
  33. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseCategoryMapper.java
  34. 21 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseCategoryMapper.xml
  35. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseMarketMapper.java
  36. 22 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseMarketMapper.xml
  37. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishMapper.java
  38. 41 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishMapper.xml
  39. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishPreMapper.java
  40. 40 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishPreMapper.xml
  41. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseTeacherMapper.java
  42. 21 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseTeacherMapper.xml
  43. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMapper.java
  44. 30 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMapper.xml
  45. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMediaMapper.java
  46. 22 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMediaMapper.xml
  47. 119 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseBase.java
  48. 56 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseCategory.java
  49. 61 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseMarket.java
  50. 160 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CoursePublish.java
  51. 155 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CoursePublishPre.java
  52. 63 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseTeacher.java
  53. 106 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/Teachplan.java
  54. 66 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/TeachplanMedia.java
  55. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseBaseService.java
  56. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseCategoryService.java
  57. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseMarketService.java
  58. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CoursePublishPreService.java
  59. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CoursePublishService.java
  60. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseTeacherService.java
  61. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/TeachplanMediaService.java
  62. 16 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/TeachplanService.java
  63. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseBaseServiceImpl.java
  64. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseCategoryServiceImpl.java
  65. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseMarketServiceImpl.java
  66. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CoursePublishPreServiceImpl.java
  67. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CoursePublishServiceImpl.java
  68. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseTeacherServiceImpl.java
  69. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/TeachplanMediaServiceImpl.java
  70. 23 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/TeachplanServiceImpl.java
  71. 101 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/BankCodeGenerator.java
  72. 104 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/CommonCodeGenerator.java
  73. 117 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/ContentCodeGenerator.java
  74. 107 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/LearningCodeGenerator.java
  75. 108 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/MediaCodeGenerator.java
  76. 116 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/MessageCodeGenerator.java
  77. 111 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/OrderCodeGenerator.java
  78. 103 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/SystemCodeGenerator.java
  79. 114 0
      xuecheng-plus-generator/src/main/java/com/xuecheng/generator/UcenterCodeGenerator.java
  80. 44 0
      xuecheng-plus-generator/src/main/resources/templates/controller.java.ftl
  81. 37 0
      xuecheng-plus-generator/src/main/resources/templates/default/controller.btl
  82. 39 0
      xuecheng-plus-generator/src/main/resources/templates/default/controller.java.btl
  83. 38 0
      xuecheng-plus-generator/src/main/resources/templates/default/controller.java.ftl
  84. 41 0
      xuecheng-plus-generator/src/main/resources/templates/default/controller.java.vm
  85. 14 0
      xuecheng-plus-generator/src/main/resources/templates/default/dao.btl
  86. 24 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.btl
  87. 162 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.java.btl
  88. 151 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.java.ftl
  89. 153 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.java.vm
  90. 124 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.btl
  91. 115 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.ftl
  92. 114 0
      xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.vm
  93. 20 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.btl
  94. 19 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.ftl
  95. 20 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.vm
  96. 41 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.btl
  97. 39 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.ftl
  98. 39 0
      xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.vm
  99. 19 0
      xuecheng-plus-generator/src/main/resources/templates/default/service.java.btl
  100. 0 0
      xuecheng-plus-generator/src/main/resources/templates/default/service.java.ftl

+ 32 - 0
.gitignore

@@ -0,0 +1,32 @@
1
+HELP.md
2
+target/
3
+!.mvn/wrapper/maven-wrapper.jar
4
+!**/src/main/**
5
+!**/src/test/**
6
+
7
+### STS ###
8
+.apt_generated
9
+.classpath
10
+.factorypath
11
+.project
12
+.settings
13
+.springBeans
14
+.sts4-cache
15
+
16
+### IntelliJ IDEA ###
17
+.idea
18
+*.iws
19
+*.iml
20
+*.ipr
21
+
22
+### NetBeans ###
23
+/nbproject/private/
24
+/nbbuild/
25
+/dist/
26
+/nbdist/
27
+/.nb-gradle/
28
+build/
29
+logs/
30
+
31
+### VS Code ###
32
+.vscode/

+ 45 - 0
xuecheng-plus-base/src/main/java/com/xuecheng/base/config/LocalDateTimeConfig.java

@@ -0,0 +1,45 @@
1
+package com.xuecheng.base.config;
2
+
3
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
4
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
5
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
6
+import org.springframework.context.annotation.Bean;
7
+import org.springframework.context.annotation.Configuration;
8
+
9
+import java.time.LocalDateTime;
10
+import java.time.format.DateTimeFormatter;
11
+
12
+@Configuration
13
+public class LocalDateTimeConfig {
14
+
15
+    /*
16
+     * 序列化内容
17
+     *   LocalDateTime -> String
18
+     * 服务端返回给客户端内容
19
+     * */
20
+    @Bean
21
+    public LocalDateTimeSerializer localDateTimeSerializer() {
22
+        return new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
23
+    }
24
+
25
+    /*
26
+     * 反序列化内容
27
+     *   String -> LocalDateTime
28
+     * 客户端传入服务端数据
29
+     * */
30
+    @Bean
31
+    public LocalDateTimeDeserializer localDateTimeDeserializer() {
32
+        return new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
33
+    }
34
+
35
+
36
+    // 配置
37
+    @Bean
38
+    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
39
+        return builder -> {
40
+            builder.serializerByType(LocalDateTime.class, localDateTimeSerializer());
41
+            builder.deserializerByType(LocalDateTime.class, localDateTimeDeserializer());
42
+        };
43
+    }
44
+
45
+}

+ 31 - 0
xuecheng-plus-base/src/main/java/com/xuecheng/base/model/PageParams.java

@@ -0,0 +1,31 @@
1
+package com.xuecheng.base.model;
2
+
3
+import io.swagger.annotations.ApiModelProperty;
4
+import lombok.Data;
5
+import lombok.ToString;
6
+
7
+/**
8
+ * @author Mr.M
9
+ * @version 1.0
10
+ * @description 分页查询分页参数
11
+ * @date 2023/2/11 15:33
12
+ */
13
+@Data
14
+@ToString
15
+public class PageParams {
16
+
17
+    //当前页码
18
+    @ApiModelProperty("页码")
19
+    private Long pageNo = 1L;
20
+    //每页显示记录数
21
+    @ApiModelProperty("每页记录数")
22
+    private Long pageSize = 30L;
23
+
24
+    public PageParams() {
25
+    }
26
+
27
+    public PageParams(Long pageNo, Long pageSize) {
28
+        this.pageNo = pageNo;
29
+        this.pageSize = pageSize;
30
+    }
31
+}

+ 39 - 0
xuecheng-plus-base/src/main/java/com/xuecheng/base/model/PageResult.java

@@ -0,0 +1,39 @@
1
+package com.xuecheng.base.model;
2
+
3
+import lombok.Data;
4
+import lombok.ToString;
5
+
6
+import java.io.Serializable;
7
+import java.util.List;
8
+
9
+/**
10
+ * @author Mr.M
11
+ * @version 1.0
12
+ * @description 分页查询结果模型类
13
+ * @date 2023/2/11 15:40
14
+ */
15
+@Data
16
+@ToString
17
+public class PageResult<T> implements Serializable {
18
+
19
+    // 数据列表
20
+    private List<T> items;
21
+
22
+    //总记录数
23
+    private long counts;
24
+
25
+    //当前页码
26
+    private long page;
27
+
28
+    //每页记录数
29
+    private long pageSize;
30
+
31
+    public PageResult(List<T> items, long counts, long page, long pageSize) {
32
+        this.items = items;
33
+        this.counts = counts;
34
+        this.page = page;
35
+        this.pageSize = pageSize;
36
+    }
37
+
38
+
39
+}

+ 19 - 0
xuecheng-plus-content/pom.xml

@@ -0,0 +1,19 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <artifactId>xuecheng-plus-parent</artifactId>
7
+        <groupId>com.xuecheng</groupId>
8
+        <version>0.0.1-SNAPSHOT</version>
9
+        <relativePath>../xuecheng-plus-parent</relativePath>
10
+    </parent>
11
+    <packaging>pom</packaging>
12
+    <artifactId>xuecheng-plus-content</artifactId>
13
+    <modules>
14
+        <module>xuecheng-plus-content-api</module>
15
+        <module>xuecheng-plus-content-model</module>
16
+        <module>xuecheng-plus-content-service</module>
17
+    </modules>
18
+
19
+</project>

+ 58 - 0
xuecheng-plus-content/xuecheng-plus-content-api/pom.xml

@@ -0,0 +1,58 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <artifactId>xuecheng-plus-content</artifactId>
7
+        <groupId>com.xuecheng</groupId>
8
+        <version>0.0.1-SNAPSHOT</version>
9
+    </parent>
10
+    <artifactId>xuecheng-plus-content-api</artifactId>
11
+    <dependencies>
12
+        <dependency>
13
+            <groupId>com.xuecheng</groupId>
14
+            <artifactId>xuecheng-plus-content-service</artifactId>
15
+            <version>0.0.1-SNAPSHOT</version>
16
+        </dependency>
17
+
18
+        <!--cloud的基础环境包-->
19
+        <dependency>
20
+            <groupId>org.springframework.cloud</groupId>
21
+            <artifactId>spring-cloud-context</artifactId>
22
+        </dependency>
23
+        <!-- Spring Boot 的 Spring Web MVC 集成 -->
24
+        <dependency>
25
+            <groupId>org.springframework.boot</groupId>
26
+            <artifactId>spring-boot-starter-web</artifactId>
27
+        </dependency>
28
+
29
+
30
+        <!-- 排除 Spring Boot 依赖的日志包冲突 -->
31
+        <dependency>
32
+            <groupId>org.springframework.boot</groupId>
33
+            <artifactId>spring-boot-starter</artifactId>
34
+            <exclusions>
35
+                <exclusion>
36
+                    <groupId>org.springframework.boot</groupId>
37
+                    <artifactId>spring-boot-starter-logging</artifactId>
38
+                </exclusion>
39
+            </exclusions>
40
+        </dependency>
41
+        <dependency>
42
+            <groupId>org.springframework.boot</groupId>
43
+            <artifactId>spring-boot-starter-validation</artifactId>
44
+        </dependency>
45
+        <!-- Spring Boot 集成 log4j2 -->
46
+        <dependency>
47
+            <groupId>org.springframework.boot</groupId>
48
+            <artifactId>spring-boot-starter-log4j2</artifactId>
49
+        </dependency>
50
+
51
+        <!-- Spring Boot 集成 swagger -->
52
+        <dependency>
53
+            <groupId>com.spring4all</groupId>
54
+            <artifactId>swagger-spring-boot-starter</artifactId>
55
+            <version>1.9.0.RELEASE</version>
56
+        </dependency>
57
+    </dependencies>
58
+</project>

+ 19 - 0
xuecheng-plus-content/xuecheng-plus-content-api/src/main/java/com/xuecheng/ContentApplication.java

@@ -0,0 +1,19 @@
1
+package com.xuecheng;
2
+
3
+import com.spring4all.swagger.EnableSwagger2Doc;
4
+import org.springframework.boot.SpringApplication;
5
+import org.springframework.boot.autoconfigure.SpringBootApplication;
6
+
7
+/**
8
+ * @author Mr.M
9
+ * @version 1.0
10
+ * @description 内容管理服务启动类
11
+ * @date 2023/2/11 15:49
12
+ */
13
+@EnableSwagger2Doc
14
+@SpringBootApplication
15
+public class ContentApplication {
16
+    public static void main(String[] args) {
17
+        SpringApplication.run(ContentApplication.class, args);
18
+    }
19
+}

+ 42 - 0
xuecheng-plus-content/xuecheng-plus-content-api/src/main/java/com/xuecheng/content/api/CourseBaseInfoController.java

@@ -0,0 +1,42 @@
1
+package com.xuecheng.content.api;
2
+
3
+import com.xuecheng.base.model.PageParams;
4
+import com.xuecheng.base.model.PageResult;
5
+import com.xuecheng.content.model.dto.QueryCourseParamsDto;
6
+import com.xuecheng.content.model.po.CourseBase;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.RequestBody;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import java.time.LocalDateTime;
15
+import java.util.ArrayList;
16
+import java.util.List;
17
+
18
+/**
19
+ * @author Mr.M
20
+ * @version 1.0
21
+ * @description TODO
22
+ * @date 2023/2/11 15:44
23
+ */
24
+@Api(value = "课程信息管理接口",tags = "课程信息管理接口")
25
+@RestController
26
+public class CourseBaseInfoController {
27
+
28
+    @ApiOperation("课程查询接口")
29
+    @PostMapping("/course/list")
30
+    public PageResult<CourseBase> list(PageParams pageParams, @RequestBody(required=false) QueryCourseParamsDto queryCourseParamsDto) {
31
+
32
+
33
+        CourseBase courseBase = new CourseBase();
34
+        courseBase.setName("测试名称");
35
+        courseBase.setCreateDate(LocalDateTime.now());
36
+        List<CourseBase> courseBases = new ArrayList();
37
+        courseBases.add(courseBase);
38
+        PageResult pageResult = new PageResult<CourseBase>(courseBases,10,1,10);
39
+        return pageResult;
40
+
41
+    }
42
+}

+ 23 - 0
xuecheng-plus-content/xuecheng-plus-content-api/src/main/resources/bootstrap.yml

@@ -0,0 +1,23 @@
1
+server:
2
+  servlet:
3
+    context-path: /content
4
+  port: 63040
5
+#微服务配置
6
+spring:
7
+  application:
8
+    name: content-api
9
+  datasource:
10
+    driver-class-name: com.mysql.cj.jdbc.Driver
11
+    url: jdbc:mysql://192.168.101.65:3306/xc402_content?serverTimezone=UTC&userUnicode=true&useSSL=false&
12
+    username: root
13
+    password: mysql
14
+# 日志文件配置路径
15
+logging:
16
+  config: classpath:log4j2-dev.xml
17
+
18
+swagger:
19
+  title: "学成在线内容管理系统"
20
+  description: "内容系统管理系统对课程相关信息进行管理"
21
+  base-package: com.xuecheng.content
22
+  enabled: true
23
+  version: 1.0.0

+ 85 - 0
xuecheng-plus-content/xuecheng-plus-content-api/src/main/resources/log4j2-dev.xml

@@ -0,0 +1,85 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Configuration monitorInterval="180" packages="">
3
+    <properties>
4
+        <property name="logdir">logs</property>
5
+        <property name="PATTERN">%date{YYYY-MM-dd HH:mm:ss,SSS} %level [%thread][%file:%line] - %msg%n%throwable</property>
6
+    </properties>
7
+    <Appenders>
8
+        <Console name="Console" target="SYSTEM_OUT">
9
+            <PatternLayout pattern="${PATTERN}"/>
10
+        </Console>
11
+
12
+        <RollingFile name="ErrorAppender" fileName="${logdir}/error.log"
13
+            filePattern="${logdir}/$${date:yyyy-MM-dd}/error.%d{yyyy-MM-dd-HH}.log" append="true">
14
+            <PatternLayout pattern="${PATTERN}"/>
15
+            <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
16
+            <Policies>
17
+                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
18
+            </Policies>
19
+        </RollingFile>
20
+
21
+        <RollingFile name="DebugAppender" fileName="${logdir}/info.log"
22
+            filePattern="${logdir}/$${date:yyyy-MM-dd}/info.%d{yyyy-MM-dd-HH}.log" append="true">
23
+            <PatternLayout pattern="${PATTERN}"/>
24
+            <ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
25
+            <Policies>
26
+                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
27
+            </Policies>
28
+        </RollingFile>
29
+        
30
+        <!--异步appender-->
31
+         <Async name="AsyncAppender" includeLocation="true">
32
+            <AppenderRef ref="ErrorAppender"/>
33
+            <AppenderRef ref="DebugAppender"/>
34
+        </Async>
35
+    </Appenders>
36
+    
37
+    <Loggers>
38
+         <!--过滤掉spring和mybatis的一些无用的debug信息
39
+        <logger name="org.springframework" level="INFO">
40
+        </logger>
41
+        <logger name="org.mybatis" level="INFO">
42
+        </logger>-->
43
+        <logger name="cn.itcast.wanxinp2p.consumer.mapper" level="DEBUG">
44
+        </logger>
45
+
46
+        <logger name="springfox" level="INFO">
47
+        </logger>
48
+		<logger name="org.apache.http" level="INFO">
49
+        </logger>
50
+        <logger name="com.netflix.discovery" level="INFO">
51
+        </logger>
52
+        
53
+        <logger name="RocketmqCommon"  level="INFO" >
54
+		</logger>
55
+		
56
+		<logger name="RocketmqRemoting" level="INFO"  >
57
+		</logger>
58
+		
59
+		<logger name="RocketmqClient" level="WARN">
60
+		</logger>
61
+
62
+        <logger name="org.dromara.hmily" level="WARN">
63
+        </logger>
64
+
65
+        <logger name="org.dromara.hmily.lottery" level="WARN">
66
+        </logger>
67
+
68
+        <logger name="org.dromara.hmily.bonuspoint" level="WARN">
69
+        </logger>
70
+		
71
+        <!--OFF   0-->
72
+        <!--FATAL   100-->
73
+        <!--ERROR   200-->
74
+        <!--WARN   300-->
75
+        <!--INFO   400-->
76
+        <!--DEBUG   500-->
77
+        <!--TRACE   600-->
78
+        <!--ALL   Integer.MAX_VALUE-->
79
+        <Root level="DEBUG" includeLocation="true">
80
+            <AppenderRef ref="AsyncAppender"/>
81
+            <AppenderRef ref="Console"/>
82
+            <AppenderRef ref="DebugAppender"/>
83
+        </Root>
84
+    </Loggers>
85
+</Configuration>

+ 34 - 0
xuecheng-plus-content/xuecheng-plus-content-model/pom.xml

@@ -0,0 +1,34 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <artifactId>xuecheng-plus-content</artifactId>
7
+        <groupId>com.xuecheng</groupId>
8
+        <version>0.0.1-SNAPSHOT</version>
9
+    </parent>
10
+    <artifactId>xuecheng-plus-content-model</artifactId>
11
+    <dependencies>
12
+        <dependency>
13
+            <groupId>com.xuecheng</groupId>
14
+            <artifactId>xuecheng-plus-base</artifactId>
15
+            <version>0.0.1-SNAPSHOT</version>
16
+        </dependency>
17
+        <!--存在mybatisplus注解添加相关注解保证不报错-->
18
+        <dependency>
19
+            <groupId>com.baomidou</groupId>
20
+            <artifactId>mybatis-plus-annotation</artifactId>
21
+            <version>${mybatis-plus-boot-starter.version}</version>
22
+        </dependency>
23
+        <dependency>
24
+            <groupId>com.baomidou</groupId>
25
+            <artifactId>mybatis-plus-core</artifactId>
26
+            <version>${mybatis-plus-boot-starter.version}</version>
27
+        </dependency>
28
+        <dependency>
29
+            <groupId>org.projectlombok</groupId>
30
+            <artifactId>lombok</artifactId>
31
+        </dependency>
32
+    </dependencies>
33
+
34
+</project>

+ 23 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/dto/QueryCourseParamsDto.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.model.dto;
2
+
3
+import lombok.Data;
4
+import lombok.ToString;
5
+
6
+/**
7
+ * @author Mr.M
8
+ * @version 1.0
9
+ * @description 课程查询条件模型类
10
+ * @date 2023/2/11 15:37
11
+ */
12
+@Data
13
+@ToString
14
+public class QueryCourseParamsDto {
15
+
16
+    //审核状态
17
+    private String auditStatus;
18
+    //课程名称
19
+    private String courseName;
20
+    //发布状态
21
+    private String publishStatus;
22
+
23
+}

+ 116 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseBase.java

@@ -0,0 +1,116 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.*;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * <p>
11
+ * 课程基本信息
12
+ * </p>
13
+ *
14
+ * @author itcast
15
+ */
16
+@Data
17
+@TableName("course_base")
18
+public class CourseBase implements Serializable {
19
+
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    /**
23
+     * 主键
24
+     */
25
+    @TableId(value = "id", type = IdType.AUTO)
26
+    private Long id;
27
+
28
+    /**
29
+     * 机构ID
30
+     */
31
+    private Long companyId;
32
+
33
+    /**
34
+     * 机构名称
35
+     */
36
+    private String companyName;
37
+
38
+    /**
39
+     * 课程名称
40
+     */
41
+    private String name;
42
+
43
+    /**
44
+     * 适用人群
45
+     */
46
+    private String users;
47
+
48
+    /**
49
+     * 课程标签
50
+     */
51
+    private String tags;
52
+
53
+    /**
54
+     * 大分类
55
+     */
56
+    private String mt;
57
+
58
+    /**
59
+     * 小分类
60
+     */
61
+    private String st;
62
+
63
+    /**
64
+     * 课程等级
65
+     */
66
+    private String grade;
67
+
68
+    /**
69
+     * 教育模式(common普通,record 录播,live直播等)
70
+     */
71
+    private String teachmode;
72
+
73
+    /**
74
+     * 课程介绍
75
+     */
76
+    private String description;
77
+
78
+    /**
79
+     * 课程图片
80
+     */
81
+    private String pic;
82
+
83
+    /**
84
+     * 创建时间
85
+     */
86
+    @TableField(fill = FieldFill.INSERT)
87
+    private LocalDateTime createDate;
88
+
89
+    /**
90
+     * 修改时间
91
+     */
92
+    @TableField(fill = FieldFill.INSERT_UPDATE)
93
+    private LocalDateTime changeDate;
94
+
95
+    /**
96
+     * 创建人
97
+     */
98
+    private String createPeople;
99
+
100
+    /**
101
+     * 更新人
102
+     */
103
+    private String changePeople;
104
+
105
+    /**
106
+     * 审核状态
107
+     */
108
+    private String auditStatus;
109
+
110
+    /**
111
+     * 课程发布状态 未发布  已发布 下线
112
+     */
113
+    private String status;
114
+
115
+
116
+}

+ 57 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseCategory.java

@@ -0,0 +1,57 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+
8
+/**
9
+ * <p>
10
+ * 课程分类
11
+ * </p>
12
+ *
13
+ * @author itcast
14
+ */
15
+@Data
16
+@TableName("course_category")
17
+public class CourseCategory implements Serializable {
18
+
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    /**
22
+     * 主键
23
+     */
24
+    private String id;
25
+
26
+    /**
27
+     * 分类名称
28
+     */
29
+    private String name;
30
+
31
+    /**
32
+     * 分类标签默认和名称一样
33
+     */
34
+    private String label;
35
+
36
+    /**
37
+     * 父结点id(第一级的父节点是0,自关联字段id)
38
+     */
39
+    private String parentid;
40
+
41
+    /**
42
+     * 是否显示
43
+     */
44
+    private Integer isShow;
45
+
46
+    /**
47
+     * 排序字段
48
+     */
49
+    private Integer orderby;
50
+
51
+    /**
52
+     * 是否叶子
53
+     */
54
+    private Integer isLeaf;
55
+
56
+
57
+}

+ 62 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseMarket.java

@@ -0,0 +1,62 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+
8
+/**
9
+ * <p>
10
+ * 课程营销信息
11
+ * </p>
12
+ *
13
+ * @author itcast
14
+ */
15
+@Data
16
+@TableName("course_market")
17
+public class CourseMarket implements Serializable {
18
+
19
+    private static final long serialVersionUID = 1L;
20
+
21
+    /**
22
+     * 主键,课程id
23
+     */
24
+    private Long id;
25
+
26
+    /**
27
+     * 收费规则,对应数据字典
28
+     */
29
+    private String charge;
30
+
31
+    /**
32
+     * 现价
33
+     */
34
+    private Float price;
35
+
36
+    /**
37
+     * 原价
38
+     */
39
+    private Float originalPrice;
40
+
41
+    /**
42
+     * 咨询qq
43
+     */
44
+    private String qq;
45
+
46
+    /**
47
+     * 微信
48
+     */
49
+    private String wechat;
50
+
51
+    /**
52
+     * 电话
53
+     */
54
+    private String phone;
55
+
56
+    /**
57
+     * 有效期天数
58
+     */
59
+    private Integer validDays;
60
+
61
+
62
+}

+ 161 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CoursePublish.java

@@ -0,0 +1,161 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.FieldFill;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 课程发布
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Data
19
+@TableName("course_publish")
20
+public class CoursePublish implements Serializable {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+    /**
25
+     * 主键
26
+     */
27
+    private Long id;
28
+
29
+    /**
30
+     * 机构ID
31
+     */
32
+    private Long companyId;
33
+
34
+    /**
35
+     * 公司名称
36
+     */
37
+    private String companyName;
38
+
39
+    /**
40
+     * 课程名称
41
+     */
42
+    private String name;
43
+
44
+    /**
45
+     * 适用人群
46
+     */
47
+    private String users;
48
+
49
+    /**
50
+     * 标签
51
+     */
52
+    private String tags;
53
+
54
+    /**
55
+     * 创建人
56
+     */
57
+    private String username;
58
+
59
+    /**
60
+     * 大分类
61
+     */
62
+    private String mt;
63
+
64
+    /**
65
+     * 大分类名称
66
+     */
67
+    private String mtName;
68
+
69
+    /**
70
+     * 小分类
71
+     */
72
+    private String st;
73
+
74
+    /**
75
+     * 小分类名称
76
+     */
77
+    private String stName;
78
+
79
+    /**
80
+     * 课程等级
81
+     */
82
+    private String grade;
83
+
84
+    /**
85
+     * 教育模式
86
+     */
87
+    private String teachmode;
88
+
89
+    /**
90
+     * 课程图片
91
+     */
92
+    private String pic;
93
+
94
+    /**
95
+     * 课程介绍
96
+     */
97
+    private String description;
98
+
99
+    /**
100
+     * 课程营销信息,json格式
101
+     */
102
+    private String market;
103
+
104
+    /**
105
+     * 所有课程计划,json格式
106
+     */
107
+    private String teachplan;
108
+
109
+    /**
110
+     * 教师信息,json格式
111
+     */
112
+    private String teachers;
113
+
114
+    /**
115
+     * 发布时间
116
+     */
117
+    @TableField(fill = FieldFill.INSERT)
118
+    private LocalDateTime createDate;
119
+
120
+    /**
121
+     * 上架时间
122
+     */
123
+    private LocalDateTime onlineDate;
124
+
125
+    /**
126
+     * 下架时间
127
+     */
128
+    private LocalDateTime offlineDate;
129
+
130
+    /**
131
+     * 发布状态
132
+     */
133
+    private String status;
134
+
135
+    /**
136
+     * 备注
137
+     */
138
+    private String remark;
139
+
140
+    /**
141
+     * 收费规则,对应数据字典--203
142
+     */
143
+    private String charge;
144
+
145
+    /**
146
+     * 现价
147
+     */
148
+    private Float price;
149
+
150
+    /**
151
+     * 原价
152
+     */
153
+    private Float originalPrice;
154
+
155
+    /**
156
+     * 课程有效期天数
157
+     */
158
+    private Integer validDays;
159
+
160
+
161
+}

+ 156 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CoursePublishPre.java

@@ -0,0 +1,156 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.FieldFill;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 课程发布
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Data
19
+@TableName("course_publish_pre")
20
+public class CoursePublishPre implements Serializable {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+    /**
25
+     * 主键
26
+     */
27
+    private Long id;
28
+
29
+    /**
30
+     * 机构ID
31
+     */
32
+    private Long companyId;
33
+
34
+    /**
35
+     * 公司名称
36
+     */
37
+    private String companyName;
38
+
39
+    /**
40
+     * 课程名称
41
+     */
42
+    private String name;
43
+
44
+    /**
45
+     * 适用人群
46
+     */
47
+    private String users;
48
+
49
+    /**
50
+     * 标签
51
+     */
52
+    private String tags;
53
+
54
+    /**
55
+     * 创建人
56
+     */
57
+    private String username;
58
+
59
+    /**
60
+     * 大分类
61
+     */
62
+    private String mt;
63
+
64
+    /**
65
+     * 大分类名称
66
+     */
67
+    private String mtName;
68
+
69
+    /**
70
+     * 小分类
71
+     */
72
+    private String st;
73
+
74
+    /**
75
+     * 小分类名称
76
+     */
77
+    private String stName;
78
+
79
+    /**
80
+     * 课程等级
81
+     */
82
+    private String grade;
83
+
84
+    /**
85
+     * 教育模式
86
+     */
87
+    private String teachmode;
88
+
89
+    /**
90
+     * 课程图片
91
+     */
92
+    private String pic;
93
+
94
+    /**
95
+     * 课程介绍
96
+     */
97
+    private String description;
98
+
99
+    /**
100
+     * 课程营销信息,json格式
101
+     */
102
+    private String market;
103
+
104
+    /**
105
+     * 所有课程计划,json格式
106
+     */
107
+    private String teachplan;
108
+
109
+    /**
110
+     * 教师信息,json格式
111
+     */
112
+    private String teachers;
113
+
114
+    /**
115
+     * 提交时间
116
+     */
117
+    @TableField(fill = FieldFill.INSERT)
118
+    private LocalDateTime createDate;
119
+
120
+    /**
121
+     * 审核时间
122
+     */
123
+    private LocalDateTime auditDate;
124
+
125
+    /**
126
+     * 状态
127
+     */
128
+    private String status;
129
+
130
+    /**
131
+     * 备注
132
+     */
133
+    private String remark;
134
+
135
+    /**
136
+     * 收费规则,对应数据字典--203
137
+     */
138
+    private String charge;
139
+
140
+    /**
141
+     * 现价
142
+     */
143
+    private Float price;
144
+
145
+    /**
146
+     * 原价
147
+     */
148
+    private Float originalPrice;
149
+
150
+    /**
151
+     * 课程有效期天数
152
+     */
153
+    private Integer validDays;
154
+
155
+
156
+}

+ 60 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/CourseTeacher.java

@@ -0,0 +1,60 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.*;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * <p>
11
+ * 课程-教师关系表
12
+ * </p>
13
+ *
14
+ * @author itcast
15
+ */
16
+@Data
17
+@TableName("course_teacher")
18
+public class CourseTeacher implements Serializable {
19
+
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    /**
23
+     * 主键
24
+     */
25
+    @TableId(value = "id", type = IdType.AUTO)
26
+    private Long id;
27
+
28
+    /**
29
+     * 课程标识
30
+     */
31
+    private Long courseId;
32
+
33
+    /**
34
+     * 教师标识
35
+     */
36
+    private String teacherName;
37
+
38
+    /**
39
+     * 教师职位
40
+     */
41
+    private String position;
42
+
43
+    /**
44
+     * 教师简介
45
+     */
46
+    private String introduction;
47
+
48
+    /**
49
+     * 照片
50
+     */
51
+    private String photograph;
52
+
53
+    /**
54
+     * 创建时间
55
+     */
56
+    @TableField(fill = FieldFill.INSERT)
57
+    private LocalDateTime createDate;
58
+
59
+
60
+}

+ 103 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/Teachplan.java

@@ -0,0 +1,103 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.*;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * <p>
11
+ * 课程计划
12
+ * </p>
13
+ *
14
+ * @author itcast
15
+ */
16
+@Data
17
+@TableName("teachplan")
18
+public class Teachplan implements Serializable {
19
+
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    @TableId(value = "id", type = IdType.AUTO)
23
+    private Long id;
24
+
25
+    /**
26
+     * 课程计划名称
27
+     */
28
+    private String pname;
29
+
30
+    /**
31
+     * 课程计划父级Id
32
+     */
33
+    private Long parentid;
34
+
35
+    /**
36
+     * 层级,分为1、2、3级
37
+     */
38
+    private Integer grade;
39
+
40
+    /**
41
+     * 课程类型:1视频、2文档
42
+     */
43
+    private String mediaType;
44
+
45
+    /**
46
+     * 开始直播时间
47
+     */
48
+    private LocalDateTime startTime;
49
+
50
+    /**
51
+     * 直播结束时间
52
+     */
53
+    private LocalDateTime endTime;
54
+
55
+    /**
56
+     * 章节及课程时介绍
57
+     */
58
+    private String description;
59
+
60
+    /**
61
+     * 时长,单位时:分:秒
62
+     */
63
+    private String timelength;
64
+
65
+    /**
66
+     * 排序字段
67
+     */
68
+    private Integer orderby;
69
+
70
+    /**
71
+     * 课程标识
72
+     */
73
+    private Long courseId;
74
+
75
+    /**
76
+     * 课程发布标识
77
+     */
78
+    private Long coursePubId;
79
+
80
+    /**
81
+     * 状态(1正常  0删除)
82
+     */
83
+    private Integer status;
84
+
85
+    /**
86
+     * 是否支持试学或预览(试看)
87
+     */
88
+    private String isPreview;
89
+
90
+    /**
91
+     * 创建时间
92
+     */
93
+    @TableField(fill = FieldFill.INSERT)
94
+    private LocalDateTime createDate;
95
+
96
+    /**
97
+     * 修改时间
98
+     */
99
+    @TableField(fill = FieldFill.INSERT_UPDATE)
100
+    private LocalDateTime changeDate;
101
+
102
+
103
+}

+ 63 - 0
xuecheng-plus-content/xuecheng-plus-content-model/src/main/java/com/xuecheng/content/model/po/TeachplanMedia.java

@@ -0,0 +1,63 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.*;
4
+import lombok.Data;
5
+
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * <p>
11
+ * 
12
+ * </p>
13
+ *
14
+ * @author itcast
15
+ */
16
+@Data
17
+@TableName("teachplan_media")
18
+public class TeachplanMedia implements Serializable {
19
+
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    /**
23
+     * 主键
24
+     */
25
+    @TableId(value = "id", type = IdType.AUTO)
26
+    private Long id;
27
+
28
+    /**
29
+     * 媒资文件id
30
+     */
31
+    private String mediaId;
32
+
33
+    /**
34
+     * 课程计划标识
35
+     */
36
+    private Long teachplanId;
37
+
38
+    /**
39
+     * 课程标识
40
+     */
41
+    private Long courseId;
42
+
43
+    /**
44
+     * 媒资文件原始名称
45
+     */
46
+    @TableField("media_fileName")
47
+    private String mediaFilename;
48
+
49
+    @TableField(fill = FieldFill.INSERT)
50
+    private LocalDateTime createDate;
51
+
52
+    /**
53
+     * 创建人
54
+     */
55
+    private String createPeople;
56
+
57
+    /**
58
+     * 修改人
59
+     */
60
+    private String changePeople;
61
+
62
+
63
+}

+ 19 - 0
xuecheng-plus-content/xuecheng-plus-content-service/pom.xml

@@ -0,0 +1,19 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <artifactId>xuecheng-plus-content</artifactId>
7
+        <groupId>com.xuecheng</groupId>
8
+        <version>0.0.1-SNAPSHOT</version>
9
+    </parent>
10
+    <artifactId>xuecheng-plus-content-service</artifactId>
11
+   <dependencies>
12
+       <dependency>
13
+           <groupId>com.xuecheng</groupId>
14
+           <artifactId>xuecheng-plus-content-model</artifactId>
15
+           <version>0.0.1-SNAPSHOT</version>
16
+       </dependency>
17
+   </dependencies>
18
+
19
+</project>

+ 90 - 0
xuecheng-plus-generator/pom.xml

@@ -0,0 +1,90 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <parent>
6
+        <artifactId>xuecheng-plus-parent</artifactId>
7
+        <groupId>com.xuecheng</groupId>
8
+        <version>0.0.1-SNAPSHOT</version>
9
+        <relativePath>../xuecheng-plus-parent</relativePath>
10
+    </parent>
11
+    <modelVersion>4.0.0</modelVersion>
12
+
13
+    <artifactId>xuecheng-plus-generator</artifactId>
14
+
15
+    <dependencies>
16
+
17
+        <!-- 日志相关配置 -->
18
+        <dependency>
19
+            <groupId>org.springframework.boot</groupId>
20
+            <artifactId>spring-boot-starter</artifactId>
21
+            <exclusions>
22
+                <exclusion>
23
+                    <groupId>org.springframework.boot</groupId>
24
+                    <artifactId>spring-boot-starter-logging</artifactId>
25
+                </exclusion>
26
+            </exclusions>
27
+        </dependency>
28
+
29
+        <dependency>
30
+            <groupId>org.springframework.boot</groupId>
31
+            <artifactId>spring-boot-starter-log4j2</artifactId>
32
+        </dependency>
33
+
34
+        <!-- mp 的 Spring boot 启动器 -->
35
+        <dependency>
36
+            <groupId>com.baomidou</groupId>
37
+            <artifactId>mybatis-plus-boot-starter</artifactId>
38
+        </dependency>
39
+
40
+        <!-- mp 代码生成器 -->
41
+        <dependency>
42
+            <groupId>com.baomidou</groupId>
43
+            <artifactId>mybatis-plus-generator</artifactId>
44
+        </dependency>
45
+
46
+        <!-- spring boot 的 freemark 模板引擎 -->
47
+        <dependency>
48
+            <groupId>org.springframework.boot</groupId>
49
+            <artifactId>spring-boot-starter-freemarker</artifactId>
50
+        </dependency>
51
+
52
+        <!-- 数据库连接池 -->
53
+        <dependency>
54
+            <groupId>com.alibaba</groupId>
55
+            <artifactId>druid-spring-boot-starter</artifactId>
56
+        </dependency>
57
+
58
+        <!-- 数据库驱动包 -->
59
+        <dependency>
60
+            <groupId>mysql</groupId>
61
+            <artifactId>mysql-connector-java</artifactId>
62
+        </dependency>
63
+
64
+
65
+        <!-- lombok -->
66
+        <dependency>
67
+            <groupId>org.projectlombok</groupId>
68
+            <artifactId>lombok</artifactId>
69
+        </dependency>
70
+
71
+
72
+        <!-- 只用swagger注解, 缩小依赖的lib包 -->
73
+        <dependency>
74
+            <groupId>io.swagger</groupId>
75
+            <artifactId>swagger-annotations</artifactId>
76
+            <version>1.5.20</version>
77
+        </dependency>
78
+
79
+
80
+        <dependency>
81
+            <groupId>org.springframework</groupId>
82
+            <artifactId>spring-web</artifactId>
83
+        </dependency>
84
+
85
+
86
+    </dependencies>
87
+
88
+
89
+
90
+</project>

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseBaseController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CourseBaseService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程基本信息 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("courseBase")
21
+public class CourseBaseController {
22
+
23
+    @Autowired
24
+    private CourseBaseService  courseBaseService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseCategoryController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CourseCategoryService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程分类 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("courseCategory")
21
+public class CourseCategoryController {
22
+
23
+    @Autowired
24
+    private CourseCategoryService  courseCategoryService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseMarketController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CourseMarketService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程营销信息 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("courseMarket")
21
+public class CourseMarketController {
22
+
23
+    @Autowired
24
+    private CourseMarketService  courseMarketService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CoursePublishController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CoursePublishService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程发布 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("coursePublish")
21
+public class CoursePublishController {
22
+
23
+    @Autowired
24
+    private CoursePublishService  coursePublishService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CoursePublishPreController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CoursePublishPreService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程发布 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("coursePublishPre")
21
+public class CoursePublishPreController {
22
+
23
+    @Autowired
24
+    private CoursePublishPreService  coursePublishPreService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/CourseTeacherController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.CourseTeacherService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程-教师关系表 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("courseTeacher")
21
+public class CourseTeacherController {
22
+
23
+    @Autowired
24
+    private CourseTeacherService  courseTeacherService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/TeachplanController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.TeachplanService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ * 课程计划 前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("teachplan")
21
+public class TeachplanController {
22
+
23
+    @Autowired
24
+    private TeachplanService  teachplanService;
25
+}

+ 25 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/controller/TeachplanMediaController.java

@@ -0,0 +1,25 @@
1
+package com.xuecheng.content.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+import com.xuecheng.content.service.TeachplanMediaService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+
11
+/**
12
+ * <p>
13
+ *  前端控制器
14
+ * </p>
15
+ *
16
+ * @author itcast
17
+ */
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("teachplanMedia")
21
+public class TeachplanMediaController {
22
+
23
+    @Autowired
24
+    private TeachplanMediaService  teachplanMediaService;
25
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseBaseMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CourseBase;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程基本信息 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CourseBaseMapper extends BaseMapper<CourseBase> {
15
+
16
+}

+ 32 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseBaseMapper.xml

@@ -0,0 +1,32 @@
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.xuecheng.content.mapper.CourseBaseMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CourseBase">
7
+        <id column="id" property="id" />
8
+        <result column="company_id" property="companyId" />
9
+        <result column="company_name" property="companyName" />
10
+        <result column="name" property="name" />
11
+        <result column="users" property="users" />
12
+        <result column="tags" property="tags" />
13
+        <result column="mt" property="mt" />
14
+        <result column="st" property="st" />
15
+        <result column="grade" property="grade" />
16
+        <result column="teachmode" property="teachmode" />
17
+        <result column="description" property="description" />
18
+        <result column="pic" property="pic" />
19
+        <result column="create_date" property="createDate" />
20
+        <result column="change_date" property="changeDate" />
21
+        <result column="create_people" property="createPeople" />
22
+        <result column="change_people" property="changePeople" />
23
+        <result column="audit_status" property="auditStatus" />
24
+        <result column="status" property="status" />
25
+    </resultMap>
26
+
27
+    <!-- 通用查询结果列 -->
28
+    <sql id="Base_Column_List">
29
+        id, company_id, company_name, name, users, tags, mt, st, grade, teachmode, description, pic, create_date, change_date, create_people, change_people, audit_status, status
30
+    </sql>
31
+
32
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseCategoryMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CourseCategory;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程分类 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CourseCategoryMapper extends BaseMapper<CourseCategory> {
15
+
16
+}

+ 21 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseCategoryMapper.xml

@@ -0,0 +1,21 @@
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.xuecheng.content.mapper.CourseCategoryMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CourseCategory">
7
+        <id column="id" property="id" />
8
+        <result column="name" property="name" />
9
+        <result column="label" property="label" />
10
+        <result column="parentid" property="parentid" />
11
+        <result column="is_show" property="isShow" />
12
+        <result column="orderby" property="orderby" />
13
+        <result column="is_leaf" property="isLeaf" />
14
+    </resultMap>
15
+
16
+    <!-- 通用查询结果列 -->
17
+    <sql id="Base_Column_List">
18
+        id, name, label, parentid, is_show, orderby, is_leaf
19
+    </sql>
20
+
21
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseMarketMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CourseMarket;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程营销信息 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CourseMarketMapper extends BaseMapper<CourseMarket> {
15
+
16
+}

+ 22 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseMarketMapper.xml

@@ -0,0 +1,22 @@
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.xuecheng.content.mapper.CourseMarketMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CourseMarket">
7
+        <id column="id" property="id" />
8
+        <result column="charge" property="charge" />
9
+        <result column="price" property="price" />
10
+        <result column="original_price" property="originalPrice" />
11
+        <result column="qq" property="qq" />
12
+        <result column="wechat" property="wechat" />
13
+        <result column="phone" property="phone" />
14
+        <result column="valid_days" property="validDays" />
15
+    </resultMap>
16
+
17
+    <!-- 通用查询结果列 -->
18
+    <sql id="Base_Column_List">
19
+        id, charge, price, original_price, qq, wechat, phone, valid_days
20
+    </sql>
21
+
22
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CoursePublish;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程发布 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CoursePublishMapper extends BaseMapper<CoursePublish> {
15
+
16
+}

+ 41 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishMapper.xml

@@ -0,0 +1,41 @@
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.xuecheng.content.mapper.CoursePublishMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CoursePublish">
7
+        <id column="id" property="id" />
8
+        <result column="company_id" property="companyId" />
9
+        <result column="company_name" property="companyName" />
10
+        <result column="name" property="name" />
11
+        <result column="users" property="users" />
12
+        <result column="tags" property="tags" />
13
+        <result column="username" property="username" />
14
+        <result column="mt" property="mt" />
15
+        <result column="mt_name" property="mtName" />
16
+        <result column="st" property="st" />
17
+        <result column="st_name" property="stName" />
18
+        <result column="grade" property="grade" />
19
+        <result column="teachmode" property="teachmode" />
20
+        <result column="pic" property="pic" />
21
+        <result column="description" property="description" />
22
+        <result column="market" property="market" />
23
+        <result column="teachplan" property="teachplan" />
24
+        <result column="teachers" property="teachers" />
25
+        <result column="create_date" property="createDate" />
26
+        <result column="online_date" property="onlineDate" />
27
+        <result column="offline_date" property="offlineDate" />
28
+        <result column="status" property="status" />
29
+        <result column="remark" property="remark" />
30
+        <result column="charge" property="charge" />
31
+        <result column="price" property="price" />
32
+        <result column="original_price" property="originalPrice" />
33
+        <result column="valid_days" property="validDays" />
34
+    </resultMap>
35
+
36
+    <!-- 通用查询结果列 -->
37
+    <sql id="Base_Column_List">
38
+        id, company_id, company_name, name, users, tags, username, mt, mt_name, st, st_name, grade, teachmode, pic, description, market, teachplan, teachers, create_date, online_date, offline_date, status, remark, charge, price, original_price, valid_days
39
+    </sql>
40
+
41
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishPreMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CoursePublishPre;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程发布 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CoursePublishPreMapper extends BaseMapper<CoursePublishPre> {
15
+
16
+}

+ 40 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CoursePublishPreMapper.xml

@@ -0,0 +1,40 @@
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.xuecheng.content.mapper.CoursePublishPreMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CoursePublishPre">
7
+        <id column="id" property="id" />
8
+        <result column="company_id" property="companyId" />
9
+        <result column="company_name" property="companyName" />
10
+        <result column="name" property="name" />
11
+        <result column="users" property="users" />
12
+        <result column="tags" property="tags" />
13
+        <result column="username" property="username" />
14
+        <result column="mt" property="mt" />
15
+        <result column="mt_name" property="mtName" />
16
+        <result column="st" property="st" />
17
+        <result column="st_name" property="stName" />
18
+        <result column="grade" property="grade" />
19
+        <result column="teachmode" property="teachmode" />
20
+        <result column="pic" property="pic" />
21
+        <result column="description" property="description" />
22
+        <result column="market" property="market" />
23
+        <result column="teachplan" property="teachplan" />
24
+        <result column="teachers" property="teachers" />
25
+        <result column="create_date" property="createDate" />
26
+        <result column="audit_date" property="auditDate" />
27
+        <result column="status" property="status" />
28
+        <result column="remark" property="remark" />
29
+        <result column="charge" property="charge" />
30
+        <result column="price" property="price" />
31
+        <result column="original_price" property="originalPrice" />
32
+        <result column="valid_days" property="validDays" />
33
+    </resultMap>
34
+
35
+    <!-- 通用查询结果列 -->
36
+    <sql id="Base_Column_List">
37
+        id, company_id, company_name, name, users, tags, username, mt, mt_name, st, st_name, grade, teachmode, pic, description, market, teachplan, teachers, create_date, audit_date, status, remark, charge, price, original_price, valid_days
38
+    </sql>
39
+
40
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseTeacherMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.CourseTeacher;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程-教师关系表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface CourseTeacherMapper extends BaseMapper<CourseTeacher> {
15
+
16
+}

+ 21 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/CourseTeacherMapper.xml

@@ -0,0 +1,21 @@
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.xuecheng.content.mapper.CourseTeacherMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.CourseTeacher">
7
+        <id column="id" property="id" />
8
+        <result column="course_id" property="courseId" />
9
+        <result column="teacher_name" property="teacherName" />
10
+        <result column="position" property="position" />
11
+        <result column="introduction" property="introduction" />
12
+        <result column="photograph" property="photograph" />
13
+        <result column="create_date" property="createDate" />
14
+    </resultMap>
15
+
16
+    <!-- 通用查询结果列 -->
17
+    <sql id="Base_Column_List">
18
+        id, course_id, teacher_name, position, introduction, photograph, create_date
19
+    </sql>
20
+
21
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.Teachplan;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ * 课程计划 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface TeachplanMapper extends BaseMapper<Teachplan> {
15
+
16
+}

+ 30 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMapper.xml

@@ -0,0 +1,30 @@
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.xuecheng.content.mapper.TeachplanMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.Teachplan">
7
+        <id column="id" property="id" />
8
+        <result column="pname" property="pname" />
9
+        <result column="parentid" property="parentid" />
10
+        <result column="grade" property="grade" />
11
+        <result column="media_type" property="mediaType" />
12
+        <result column="start_time" property="startTime" />
13
+        <result column="end_time" property="endTime" />
14
+        <result column="description" property="description" />
15
+        <result column="timelength" property="timelength" />
16
+        <result column="orderby" property="orderby" />
17
+        <result column="course_id" property="courseId" />
18
+        <result column="course_pub_id" property="coursePubId" />
19
+        <result column="status" property="status" />
20
+        <result column="is_preview" property="isPreview" />
21
+        <result column="create_date" property="createDate" />
22
+        <result column="change_date" property="changeDate" />
23
+    </resultMap>
24
+
25
+    <!-- 通用查询结果列 -->
26
+    <sql id="Base_Column_List">
27
+        id, pname, parentid, grade, media_type, start_time, end_time, description, timelength, orderby, course_id, course_pub_id, status, is_preview, create_date, change_date
28
+    </sql>
29
+
30
+</mapper>

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMediaMapper.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.mapper;
2
+
3
+import com.xuecheng.content.model.po.TeachplanMedia;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.springframework.stereotype.Repository;
6
+
7
+/**
8
+ * <p>
9
+ *  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+public interface TeachplanMediaMapper extends BaseMapper<TeachplanMedia> {
15
+
16
+}

+ 22 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/mapper/TeachplanMediaMapper.xml

@@ -0,0 +1,22 @@
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.xuecheng.content.mapper.TeachplanMediaMapper">
4
+
5
+    <!-- 通用查询映射结果 -->
6
+    <resultMap id="BaseResultMap" type="com.xuecheng.content.model.po.TeachplanMedia">
7
+        <id column="id" property="id" />
8
+        <result column="media_id" property="mediaId" />
9
+        <result column="teachplan_id" property="teachplanId" />
10
+        <result column="course_id" property="courseId" />
11
+        <result column="media_fileName" property="mediaFilename" />
12
+        <result column="create_date" property="createDate" />
13
+        <result column="create_people" property="createPeople" />
14
+        <result column="change_people" property="changePeople" />
15
+    </resultMap>
16
+
17
+    <!-- 通用查询结果列 -->
18
+    <sql id="Base_Column_List">
19
+        id, media_id, teachplan_id, course_id, media_fileName, create_date, create_people, change_people
20
+    </sql>
21
+
22
+</mapper>

+ 119 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseBase.java

@@ -0,0 +1,119 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import com.baomidou.mybatisplus.annotation.FieldFill;
7
+import com.baomidou.mybatisplus.annotation.TableField;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import com.baomidou.mybatisplus.annotation.TableName;
11
+
12
+/**
13
+ * <p>
14
+ * 课程基本信息
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Data
20
+@TableName("course_base")
21
+public class CourseBase implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 主键
27
+     */
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Long id;
30
+
31
+    /**
32
+     * 机构ID
33
+     */
34
+    private Long companyId;
35
+
36
+    /**
37
+     * 机构名称
38
+     */
39
+    private String companyName;
40
+
41
+    /**
42
+     * 课程名称
43
+     */
44
+    private String name;
45
+
46
+    /**
47
+     * 适用人群
48
+     */
49
+    private String users;
50
+
51
+    /**
52
+     * 课程标签
53
+     */
54
+    private String tags;
55
+
56
+    /**
57
+     * 大分类
58
+     */
59
+    private String mt;
60
+
61
+    /**
62
+     * 小分类
63
+     */
64
+    private String st;
65
+
66
+    /**
67
+     * 课程等级
68
+     */
69
+    private String grade;
70
+
71
+    /**
72
+     * 教育模式(common普通,record 录播,live直播等)
73
+     */
74
+    private String teachmode;
75
+
76
+    /**
77
+     * 课程介绍
78
+     */
79
+    private String description;
80
+
81
+    /**
82
+     * 课程图片
83
+     */
84
+    private String pic;
85
+
86
+    /**
87
+     * 创建时间
88
+     */
89
+    @TableField(fill = FieldFill.INSERT)
90
+    private LocalDateTime createDate;
91
+
92
+    /**
93
+     * 修改时间
94
+     */
95
+    @TableField(fill = FieldFill.INSERT_UPDATE)
96
+    private LocalDateTime changeDate;
97
+
98
+    /**
99
+     * 创建人
100
+     */
101
+    private String createPeople;
102
+
103
+    /**
104
+     * 更新人
105
+     */
106
+    private String changePeople;
107
+
108
+    /**
109
+     * 审核状态
110
+     */
111
+    private String auditStatus;
112
+
113
+    /**
114
+     * 课程发布状态 未发布  已发布 下线
115
+     */
116
+    private String status;
117
+
118
+
119
+}

+ 56 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseCategory.java

@@ -0,0 +1,56 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import java.io.Serializable;
4
+import lombok.Data;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+
7
+/**
8
+ * <p>
9
+ * 课程分类
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+@Data
15
+@TableName("course_category")
16
+public class CourseCategory implements Serializable {
17
+
18
+    private static final long serialVersionUID = 1L;
19
+
20
+    /**
21
+     * 主键
22
+     */
23
+    private String id;
24
+
25
+    /**
26
+     * 分类名称
27
+     */
28
+    private String name;
29
+
30
+    /**
31
+     * 分类标签默认和名称一样
32
+     */
33
+    private String label;
34
+
35
+    /**
36
+     * 父结点id(第一级的父节点是0,自关联字段id)
37
+     */
38
+    private String parentid;
39
+
40
+    /**
41
+     * 是否显示
42
+     */
43
+    private Integer isShow;
44
+
45
+    /**
46
+     * 排序字段
47
+     */
48
+    private Integer orderby;
49
+
50
+    /**
51
+     * 是否叶子
52
+     */
53
+    private Integer isLeaf;
54
+
55
+
56
+}

+ 61 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseMarket.java

@@ -0,0 +1,61 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import java.io.Serializable;
4
+import lombok.Data;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+
7
+/**
8
+ * <p>
9
+ * 课程营销信息
10
+ * </p>
11
+ *
12
+ * @author itcast
13
+ */
14
+@Data
15
+@TableName("course_market")
16
+public class CourseMarket implements Serializable {
17
+
18
+    private static final long serialVersionUID = 1L;
19
+
20
+    /**
21
+     * 主键,课程id
22
+     */
23
+    private Long id;
24
+
25
+    /**
26
+     * 收费规则,对应数据字典
27
+     */
28
+    private String charge;
29
+
30
+    /**
31
+     * 现价
32
+     */
33
+    private Float price;
34
+
35
+    /**
36
+     * 原价
37
+     */
38
+    private Float originalPrice;
39
+
40
+    /**
41
+     * 咨询qq
42
+     */
43
+    private String qq;
44
+
45
+    /**
46
+     * 微信
47
+     */
48
+    private String wechat;
49
+
50
+    /**
51
+     * 电话
52
+     */
53
+    private String phone;
54
+
55
+    /**
56
+     * 有效期天数
57
+     */
58
+    private Integer validDays;
59
+
60
+
61
+}

+ 160 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CoursePublish.java

@@ -0,0 +1,160 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import java.time.LocalDateTime;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.annotation.TableField;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import com.baomidou.mybatisplus.annotation.TableName;
9
+
10
+/**
11
+ * <p>
12
+ * 课程发布
13
+ * </p>
14
+ *
15
+ * @author itcast
16
+ */
17
+@Data
18
+@TableName("course_publish")
19
+public class CoursePublish implements Serializable {
20
+
21
+    private static final long serialVersionUID = 1L;
22
+
23
+    /**
24
+     * 主键
25
+     */
26
+    private Long id;
27
+
28
+    /**
29
+     * 机构ID
30
+     */
31
+    private Long companyId;
32
+
33
+    /**
34
+     * 公司名称
35
+     */
36
+    private String companyName;
37
+
38
+    /**
39
+     * 课程名称
40
+     */
41
+    private String name;
42
+
43
+    /**
44
+     * 适用人群
45
+     */
46
+    private String users;
47
+
48
+    /**
49
+     * 标签
50
+     */
51
+    private String tags;
52
+
53
+    /**
54
+     * 创建人
55
+     */
56
+    private String username;
57
+
58
+    /**
59
+     * 大分类
60
+     */
61
+    private String mt;
62
+
63
+    /**
64
+     * 大分类名称
65
+     */
66
+    private String mtName;
67
+
68
+    /**
69
+     * 小分类
70
+     */
71
+    private String st;
72
+
73
+    /**
74
+     * 小分类名称
75
+     */
76
+    private String stName;
77
+
78
+    /**
79
+     * 课程等级
80
+     */
81
+    private String grade;
82
+
83
+    /**
84
+     * 教育模式
85
+     */
86
+    private String teachmode;
87
+
88
+    /**
89
+     * 课程图片
90
+     */
91
+    private String pic;
92
+
93
+    /**
94
+     * 课程介绍
95
+     */
96
+    private String description;
97
+
98
+    /**
99
+     * 课程营销信息,json格式
100
+     */
101
+    private String market;
102
+
103
+    /**
104
+     * 所有课程计划,json格式
105
+     */
106
+    private String teachplan;
107
+
108
+    /**
109
+     * 教师信息,json格式
110
+     */
111
+    private String teachers;
112
+
113
+    /**
114
+     * 发布时间
115
+     */
116
+    @TableField(fill = FieldFill.INSERT)
117
+    private LocalDateTime createDate;
118
+
119
+    /**
120
+     * 上架时间
121
+     */
122
+    private LocalDateTime onlineDate;
123
+
124
+    /**
125
+     * 下架时间
126
+     */
127
+    private LocalDateTime offlineDate;
128
+
129
+    /**
130
+     * 发布状态
131
+     */
132
+    private String status;
133
+
134
+    /**
135
+     * 备注
136
+     */
137
+    private String remark;
138
+
139
+    /**
140
+     * 收费规则,对应数据字典--203
141
+     */
142
+    private String charge;
143
+
144
+    /**
145
+     * 现价
146
+     */
147
+    private Float price;
148
+
149
+    /**
150
+     * 原价
151
+     */
152
+    private Float originalPrice;
153
+
154
+    /**
155
+     * 课程有效期天数
156
+     */
157
+    private Integer validDays;
158
+
159
+
160
+}

+ 155 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CoursePublishPre.java

@@ -0,0 +1,155 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import java.time.LocalDateTime;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.annotation.TableField;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import com.baomidou.mybatisplus.annotation.TableName;
9
+
10
+/**
11
+ * <p>
12
+ * 课程发布
13
+ * </p>
14
+ *
15
+ * @author itcast
16
+ */
17
+@Data
18
+@TableName("course_publish_pre")
19
+public class CoursePublishPre implements Serializable {
20
+
21
+    private static final long serialVersionUID = 1L;
22
+
23
+    /**
24
+     * 主键
25
+     */
26
+    private Long id;
27
+
28
+    /**
29
+     * 机构ID
30
+     */
31
+    private Long companyId;
32
+
33
+    /**
34
+     * 公司名称
35
+     */
36
+    private String companyName;
37
+
38
+    /**
39
+     * 课程名称
40
+     */
41
+    private String name;
42
+
43
+    /**
44
+     * 适用人群
45
+     */
46
+    private String users;
47
+
48
+    /**
49
+     * 标签
50
+     */
51
+    private String tags;
52
+
53
+    /**
54
+     * 创建人
55
+     */
56
+    private String username;
57
+
58
+    /**
59
+     * 大分类
60
+     */
61
+    private String mt;
62
+
63
+    /**
64
+     * 大分类名称
65
+     */
66
+    private String mtName;
67
+
68
+    /**
69
+     * 小分类
70
+     */
71
+    private String st;
72
+
73
+    /**
74
+     * 小分类名称
75
+     */
76
+    private String stName;
77
+
78
+    /**
79
+     * 课程等级
80
+     */
81
+    private String grade;
82
+
83
+    /**
84
+     * 教育模式
85
+     */
86
+    private String teachmode;
87
+
88
+    /**
89
+     * 课程图片
90
+     */
91
+    private String pic;
92
+
93
+    /**
94
+     * 课程介绍
95
+     */
96
+    private String description;
97
+
98
+    /**
99
+     * 课程营销信息,json格式
100
+     */
101
+    private String market;
102
+
103
+    /**
104
+     * 所有课程计划,json格式
105
+     */
106
+    private String teachplan;
107
+
108
+    /**
109
+     * 教师信息,json格式
110
+     */
111
+    private String teachers;
112
+
113
+    /**
114
+     * 提交时间
115
+     */
116
+    @TableField(fill = FieldFill.INSERT)
117
+    private LocalDateTime createDate;
118
+
119
+    /**
120
+     * 审核时间
121
+     */
122
+    private LocalDateTime auditDate;
123
+
124
+    /**
125
+     * 状态
126
+     */
127
+    private String status;
128
+
129
+    /**
130
+     * 备注
131
+     */
132
+    private String remark;
133
+
134
+    /**
135
+     * 收费规则,对应数据字典--203
136
+     */
137
+    private String charge;
138
+
139
+    /**
140
+     * 现价
141
+     */
142
+    private Float price;
143
+
144
+    /**
145
+     * 原价
146
+     */
147
+    private Float originalPrice;
148
+
149
+    /**
150
+     * 课程有效期天数
151
+     */
152
+    private Integer validDays;
153
+
154
+
155
+}

+ 63 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/CourseTeacher.java

@@ -0,0 +1,63 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import com.baomidou.mybatisplus.annotation.FieldFill;
7
+import com.baomidou.mybatisplus.annotation.TableField;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import com.baomidou.mybatisplus.annotation.TableName;
11
+
12
+/**
13
+ * <p>
14
+ * 课程-教师关系表
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Data
20
+@TableName("course_teacher")
21
+public class CourseTeacher implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 主键
27
+     */
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Long id;
30
+
31
+    /**
32
+     * 课程标识
33
+     */
34
+    private Long courseId;
35
+
36
+    /**
37
+     * 教师标识
38
+     */
39
+    private String teacherName;
40
+
41
+    /**
42
+     * 教师职位
43
+     */
44
+    private String position;
45
+
46
+    /**
47
+     * 教师简介
48
+     */
49
+    private String introduction;
50
+
51
+    /**
52
+     * 照片
53
+     */
54
+    private String photograph;
55
+
56
+    /**
57
+     * 创建时间
58
+     */
59
+    @TableField(fill = FieldFill.INSERT)
60
+    private LocalDateTime createDate;
61
+
62
+
63
+}

+ 106 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/Teachplan.java

@@ -0,0 +1,106 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import com.baomidou.mybatisplus.annotation.FieldFill;
7
+import com.baomidou.mybatisplus.annotation.TableField;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import com.baomidou.mybatisplus.annotation.TableName;
11
+
12
+/**
13
+ * <p>
14
+ * 课程计划
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Data
20
+@TableName("teachplan")
21
+public class Teachplan implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    @TableId(value = "id", type = IdType.AUTO)
26
+    private Long id;
27
+
28
+    /**
29
+     * 课程计划名称
30
+     */
31
+    private String pname;
32
+
33
+    /**
34
+     * 课程计划父级Id
35
+     */
36
+    private Long parentid;
37
+
38
+    /**
39
+     * 层级,分为1、2、3级
40
+     */
41
+    private Integer grade;
42
+
43
+    /**
44
+     * 课程类型:1视频、2文档
45
+     */
46
+    private String mediaType;
47
+
48
+    /**
49
+     * 开始直播时间
50
+     */
51
+    private LocalDateTime startTime;
52
+
53
+    /**
54
+     * 直播结束时间
55
+     */
56
+    private LocalDateTime endTime;
57
+
58
+    /**
59
+     * 章节及课程时介绍
60
+     */
61
+    private String description;
62
+
63
+    /**
64
+     * 时长,单位时:分:秒
65
+     */
66
+    private String timelength;
67
+
68
+    /**
69
+     * 排序字段
70
+     */
71
+    private Integer orderby;
72
+
73
+    /**
74
+     * 课程标识
75
+     */
76
+    private Long courseId;
77
+
78
+    /**
79
+     * 课程发布标识
80
+     */
81
+    private Long coursePubId;
82
+
83
+    /**
84
+     * 状态(1正常  0删除)
85
+     */
86
+    private Integer status;
87
+
88
+    /**
89
+     * 是否支持试学或预览(试看)
90
+     */
91
+    private String isPreview;
92
+
93
+    /**
94
+     * 创建时间
95
+     */
96
+    @TableField(fill = FieldFill.INSERT)
97
+    private LocalDateTime createDate;
98
+
99
+    /**
100
+     * 修改时间
101
+     */
102
+    @TableField(fill = FieldFill.INSERT_UPDATE)
103
+    private LocalDateTime changeDate;
104
+
105
+
106
+}

+ 66 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/model/po/TeachplanMedia.java

@@ -0,0 +1,66 @@
1
+package com.xuecheng.content.model.po;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import com.baomidou.mybatisplus.annotation.FieldFill;
7
+import com.baomidou.mybatisplus.annotation.TableField;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import com.baomidou.mybatisplus.annotation.TableName;
11
+
12
+/**
13
+ * <p>
14
+ * 
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Data
20
+@TableName("teachplan_media")
21
+public class TeachplanMedia implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 主键
27
+     */
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Long id;
30
+
31
+    /**
32
+     * 媒资文件id
33
+     */
34
+    private String mediaId;
35
+
36
+    /**
37
+     * 课程计划标识
38
+     */
39
+    private Long teachplanId;
40
+
41
+    /**
42
+     * 课程标识
43
+     */
44
+    private Long courseId;
45
+
46
+    /**
47
+     * 媒资文件原始名称
48
+     */
49
+    @TableField("media_fileName")
50
+    private String mediaFilename;
51
+
52
+    @TableField(fill = FieldFill.INSERT)
53
+    private LocalDateTime createDate;
54
+
55
+    /**
56
+     * 创建人
57
+     */
58
+    private String createPeople;
59
+
60
+    /**
61
+     * 修改人
62
+     */
63
+    private String changePeople;
64
+
65
+
66
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseBaseService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CourseBase;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程基本信息 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CourseBaseService extends IService<CourseBase> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseCategoryService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CourseCategory;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程分类 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CourseCategoryService extends IService<CourseCategory> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseMarketService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CourseMarket;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程营销信息 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CourseMarketService extends IService<CourseMarket> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CoursePublishPreService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CoursePublishPre;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程发布 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CoursePublishPreService extends IService<CoursePublishPre> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CoursePublishService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CoursePublish;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程发布 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CoursePublishService extends IService<CoursePublish> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/CourseTeacherService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.CourseTeacher;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程-教师关系表 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface CourseTeacherService extends IService<CourseTeacher> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/TeachplanMediaService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.TeachplanMedia;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ *  服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface TeachplanMediaService extends IService<TeachplanMedia> {
15
+
16
+}

+ 16 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/TeachplanService.java

@@ -0,0 +1,16 @@
1
+package com.xuecheng.content.service;
2
+
3
+import com.xuecheng.content.model.po.Teachplan;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 课程计划 服务类
9
+ * </p>
10
+ *
11
+ * @author itcast
12
+ * @since 2023-02-11
13
+ */
14
+public interface TeachplanService extends IService<Teachplan> {
15
+
16
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseBaseServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CourseBase;
4
+import com.xuecheng.content.mapper.CourseBaseMapper;
5
+import com.xuecheng.content.service.CourseBaseService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程基本信息 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CourseBaseServiceImpl extends ServiceImpl<CourseBaseMapper, CourseBase> implements CourseBaseService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseCategoryServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CourseCategory;
4
+import com.xuecheng.content.mapper.CourseCategoryMapper;
5
+import com.xuecheng.content.service.CourseCategoryService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程分类 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CourseCategoryServiceImpl extends ServiceImpl<CourseCategoryMapper, CourseCategory> implements CourseCategoryService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseMarketServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CourseMarket;
4
+import com.xuecheng.content.mapper.CourseMarketMapper;
5
+import com.xuecheng.content.service.CourseMarketService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程营销信息 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CourseMarketServiceImpl extends ServiceImpl<CourseMarketMapper, CourseMarket> implements CourseMarketService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CoursePublishPreServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CoursePublishPre;
4
+import com.xuecheng.content.mapper.CoursePublishPreMapper;
5
+import com.xuecheng.content.service.CoursePublishPreService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程发布 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CoursePublishPreServiceImpl extends ServiceImpl<CoursePublishPreMapper, CoursePublishPre> implements CoursePublishPreService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CoursePublishServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CoursePublish;
4
+import com.xuecheng.content.mapper.CoursePublishMapper;
5
+import com.xuecheng.content.service.CoursePublishService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程发布 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CoursePublishServiceImpl extends ServiceImpl<CoursePublishMapper, CoursePublish> implements CoursePublishService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/CourseTeacherServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.CourseTeacher;
4
+import com.xuecheng.content.mapper.CourseTeacherMapper;
5
+import com.xuecheng.content.service.CourseTeacherService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程-教师关系表 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class CourseTeacherServiceImpl extends ServiceImpl<CourseTeacherMapper, CourseTeacher> implements CourseTeacherService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/TeachplanMediaServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.TeachplanMedia;
4
+import com.xuecheng.content.mapper.TeachplanMediaMapper;
5
+import com.xuecheng.content.service.TeachplanMediaService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ *  服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class TeachplanMediaServiceImpl extends ServiceImpl<TeachplanMediaMapper, TeachplanMedia> implements TeachplanMediaService {
22
+
23
+}

+ 23 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/content/service/impl/TeachplanServiceImpl.java

@@ -0,0 +1,23 @@
1
+package com.xuecheng.content.service.impl;
2
+
3
+import com.xuecheng.content.model.po.Teachplan;
4
+import com.xuecheng.content.mapper.TeachplanMapper;
5
+import com.xuecheng.content.service.TeachplanService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.transaction.annotation.Transactional;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+
12
+/**
13
+ * <p>
14
+ * 课程计划 服务实现类
15
+ * </p>
16
+ *
17
+ * @author itcast
18
+ */
19
+@Slf4j
20
+@Service
21
+public class TeachplanServiceImpl extends ServiceImpl<TeachplanMapper, Teachplan> implements TeachplanService {
22
+
23
+}

+ 101 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/BankCodeGenerator.java

@@ -0,0 +1,101 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class BankCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "bank1";
20
+	private static final String DATA_SOURCE_USER_NAME  = "root";
21
+	private static final String DATA_SOURCE_PASSWORD  = "root";
22
+	private static final String[] TABLE_NAMES = new String[]{
23
+			"account_info",
24
+			"de_duplication",
25
+	};
26
+
27
+	// TODO 默认生成entity,需要生成DTO修改此变量
28
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
29
+	private static final Boolean IS_DTO = false;
30
+
31
+	public static void main(String[] args) {
32
+		// 代码生成器
33
+		AutoGenerator mpg = new AutoGenerator();
34
+		// 选择 freemarker 引擎,默认 Velocity
35
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
36
+		// 全局配置
37
+		GlobalConfig gc = new GlobalConfig();
38
+		gc.setFileOverride(true);
39
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
40
+		gc.setAuthor("itcast");
41
+		gc.setOpen(false);
42
+		gc.setSwagger2(false);
43
+		gc.setServiceName("%sService");
44
+        gc.setBaseResultMap(true);
45
+        gc.setBaseColumnList(true);
46
+
47
+		if (IS_DTO) {
48
+			gc.setSwagger2(true);
49
+			gc.setEntityName("%sDTO");
50
+		}
51
+		mpg.setGlobalConfig(gc);
52
+
53
+		// 数据库配置
54
+		DataSourceConfig dsc = new DataSourceConfig();
55
+		dsc.setDbType(DbType.MYSQL);
56
+		dsc.setUrl("jdbc:mysql://localhost:3306/" + SERVICE_NAME
57
+				+ "?useUnicode=true&useSSL=false&characterEncoding=utf8");
58
+		dsc.setDriverName("com.mysql.jdbc.Driver");
59
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
60
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
61
+		mpg.setDataSource(dsc);
62
+
63
+		// 包配置
64
+		PackageConfig pc = new PackageConfig();
65
+		pc.setParent("com.xuecheng.rocketmq");
66
+
67
+		pc.setServiceImpl("service.impl");
68
+		pc.setXml("mapper");
69
+		pc.setEntity("model.po");
70
+		mpg.setPackageInfo(pc);
71
+
72
+
73
+		// 设置模板
74
+		TemplateConfig tc = new TemplateConfig();
75
+		mpg.setTemplate(tc);
76
+
77
+		// 策略配置
78
+		StrategyConfig strategy = new StrategyConfig();
79
+		strategy.setNaming(NamingStrategy.underline_to_camel);
80
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
81
+		strategy.setEntityLombokModel(true);
82
+		strategy.setRestControllerStyle(true);
83
+		strategy.setInclude(TABLE_NAMES);
84
+		strategy.setControllerMappingHyphenStyle(true);
85
+		strategy.setTablePrefix(pc.getModuleName() + "_");
86
+		// Boolean类型字段是否移除is前缀处理
87
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
88
+		strategy.setRestControllerStyle(true);
89
+
90
+		// 自动填充字段配置
91
+		strategy.setTableFillList(Arrays.asList(
92
+				new TableFill("create_date", FieldFill.INSERT),
93
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
94
+				new TableFill("modify_date", FieldFill.UPDATE)
95
+		));
96
+		mpg.setStrategy(strategy);
97
+
98
+		mpg.execute();
99
+	}
100
+
101
+}

+ 104 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/CommonCodeGenerator.java

@@ -0,0 +1,104 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class CommonCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "comments";
20
+
21
+	private static final String DATA_SOURCE_USER_NAME  = "root";
22
+	private static final String DATA_SOURCE_PASSWORD  = "root";
23
+	private static final String[] TABLE_NAMES = new String[]{
24
+			"comment",
25
+			"comment_reply",
26
+			"comment_target",
27
+	};
28
+
29
+	// TODO 默认生成entity,需要生成DTO修改此变量
30
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
31
+	private static final Boolean IS_DTO = true;
32
+
33
+	public static void main(String[] args) {
34
+		// 代码生成器
35
+		AutoGenerator mpg = new AutoGenerator();
36
+		// 选择 freemarker 引擎,默认 Velocity
37
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
38
+		// 全局配置
39
+		GlobalConfig gc = new GlobalConfig();
40
+		gc.setFileOverride(true);
41
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
42
+		gc.setAuthor("itcast");
43
+		gc.setOpen(false);
44
+		gc.setSwagger2(false);
45
+		gc.setServiceName("%sService");
46
+        gc.setBaseResultMap(true);
47
+        gc.setBaseColumnList(true);
48
+
49
+		if (IS_DTO) {
50
+			gc.setSwagger2(true);
51
+			gc.setEntityName("%sDTO");
52
+		}
53
+		mpg.setGlobalConfig(gc);
54
+
55
+		// 数据库配置
56
+		DataSourceConfig dsc = new DataSourceConfig();
57
+		dsc.setDbType(DbType.MYSQL);
58
+		dsc.setUrl("jdbc:mysql://localhost:3306/" + SERVICE_NAME
59
+				+ "?useUnicode=true&useSSL=false&characterEncoding=utf8");
60
+		dsc.setDriverName("com.mysql.jdbc.Driver");
61
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
62
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
63
+		mpg.setDataSource(dsc);
64
+
65
+		// 包配置
66
+		PackageConfig pc = new PackageConfig();
67
+		pc.setModuleName(SERVICE_NAME);
68
+		pc.setParent("com.xuecheng");
69
+
70
+		pc.setServiceImpl("service.impl");
71
+		pc.setXml("mapper");
72
+		pc.setEntity("model.po");
73
+		mpg.setPackageInfo(pc);
74
+
75
+
76
+		// 设置模板
77
+		TemplateConfig tc = new TemplateConfig();
78
+		mpg.setTemplate(tc);
79
+
80
+		// 策略配置
81
+		StrategyConfig strategy = new StrategyConfig();
82
+		strategy.setNaming(NamingStrategy.underline_to_camel);
83
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
84
+		strategy.setEntityLombokModel(true);
85
+		strategy.setRestControllerStyle(true);
86
+		strategy.setInclude(TABLE_NAMES);
87
+		strategy.setControllerMappingHyphenStyle(true);
88
+		strategy.setTablePrefix(pc.getModuleName() + "_");
89
+		// Boolean类型字段是否移除is前缀处理
90
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
91
+		strategy.setRestControllerStyle(true);
92
+
93
+		// 自动填充字段配置
94
+		strategy.setTableFillList(Arrays.asList(
95
+				new TableFill("create_date", FieldFill.INSERT),
96
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
97
+				new TableFill("modify_date", FieldFill.UPDATE)
98
+		));
99
+		mpg.setStrategy(strategy);
100
+
101
+		mpg.execute();
102
+	}
103
+
104
+}

+ 117 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/ContentCodeGenerator.java

@@ -0,0 +1,117 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class ContentCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "content";
20
+
21
+	//数据库账号
22
+	private static final String DATA_SOURCE_USER_NAME  = "root";
23
+	//数据库密码
24
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
25
+	//生成的表
26
+	private static final String[] TABLE_NAMES = new String[]{
27
+//			"mq_message",
28
+//			"mq_message_history"
29
+			"course_base",
30
+			"course_market",
31
+			"course_teacher",
32
+			"course_category",
33
+			"teachplan",
34
+			"teachplan_media",
35
+			"course_publish",
36
+			"course_publish_pre"
37
+
38
+	};
39
+
40
+	// TODO 默认生成entity,需要生成DTO修改此变量
41
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
42
+	private static final Boolean IS_DTO = false;
43
+
44
+	public static void main(String[] args) {
45
+		// 代码生成器
46
+		AutoGenerator mpg = new AutoGenerator();
47
+		// 选择 freemarker 引擎,默认 Velocity
48
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
49
+		// 全局配置
50
+		GlobalConfig gc = new GlobalConfig();
51
+		gc.setFileOverride(true);
52
+		//生成路径
53
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
54
+		gc.setAuthor("itcast");
55
+		gc.setOpen(false);
56
+		gc.setSwagger2(false);
57
+		gc.setServiceName("%sService");
58
+        gc.setBaseResultMap(true);
59
+        gc.setBaseColumnList(true);
60
+
61
+		if (IS_DTO) {
62
+			gc.setSwagger2(true);
63
+			gc.setEntityName("%sDTO");
64
+		}
65
+		mpg.setGlobalConfig(gc);
66
+
67
+		// 数据库配置
68
+		DataSourceConfig dsc = new DataSourceConfig();
69
+		dsc.setDbType(DbType.MYSQL);
70
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xc402_" + SERVICE_NAME
71
+				+ "?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=utf8");
72
+//		dsc.setDriverName("com.mysql.jdbc.Driver");
73
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
74
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
75
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
76
+		mpg.setDataSource(dsc);
77
+
78
+		// 包配置
79
+		PackageConfig pc = new PackageConfig();
80
+		pc.setModuleName(SERVICE_NAME);
81
+		pc.setParent("com.xuecheng");
82
+
83
+		pc.setServiceImpl("service.impl");
84
+		pc.setXml("mapper");
85
+		pc.setEntity("model.po");
86
+		mpg.setPackageInfo(pc);
87
+
88
+
89
+		// 设置模板
90
+		TemplateConfig tc = new TemplateConfig();
91
+		mpg.setTemplate(tc);
92
+
93
+		// 策略配置
94
+		StrategyConfig strategy = new StrategyConfig();
95
+		strategy.setNaming(NamingStrategy.underline_to_camel);
96
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
97
+		strategy.setEntityLombokModel(true);
98
+		strategy.setRestControllerStyle(true);
99
+		strategy.setInclude(TABLE_NAMES);
100
+		strategy.setControllerMappingHyphenStyle(true);
101
+		strategy.setTablePrefix(pc.getModuleName() + "_");
102
+		// Boolean类型字段是否移除is前缀处理
103
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
104
+		strategy.setRestControllerStyle(true);
105
+
106
+		// 自动填充字段配置
107
+		strategy.setTableFillList(Arrays.asList(
108
+				new TableFill("create_date", FieldFill.INSERT),
109
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
110
+				new TableFill("modify_date", FieldFill.UPDATE)
111
+		));
112
+		mpg.setStrategy(strategy);
113
+
114
+		mpg.execute();
115
+	}
116
+
117
+}

+ 107 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/LearningCodeGenerator.java

@@ -0,0 +1,107 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class LearningCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "learning";
20
+
21
+	//数据库账号
22
+	private static final String DATA_SOURCE_USER_NAME  = "root";
23
+	//数据库密码
24
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
25
+	//生成的表
26
+	private static final String[] TABLE_NAMES = new String[]{
27
+			"xc_learn_record"
28
+	};
29
+
30
+	// TODO 默认生成entity,需要生成DTO修改此变量
31
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
32
+	private static final Boolean IS_DTO = false;
33
+
34
+	public static void main(String[] args) {
35
+		// 代码生成器
36
+		AutoGenerator mpg = new AutoGenerator();
37
+		// 选择 freemarker 引擎,默认 Velocity
38
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
39
+		// 全局配置
40
+		GlobalConfig gc = new GlobalConfig();
41
+		gc.setFileOverride(true);
42
+		//生成路径
43
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
44
+		gc.setAuthor("itcast");
45
+		gc.setOpen(false);
46
+		gc.setSwagger2(false);
47
+		gc.setServiceName("%sService");
48
+		gc.setBaseResultMap(true);
49
+		gc.setBaseColumnList(true);
50
+
51
+		if (IS_DTO) {
52
+			gc.setSwagger2(true);
53
+			gc.setEntityName("%sDTO");
54
+		}
55
+		mpg.setGlobalConfig(gc);
56
+
57
+		// 数据库配置
58
+		DataSourceConfig dsc = new DataSourceConfig();
59
+		dsc.setDbType(DbType.MYSQL);
60
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_" + SERVICE_NAME
61
+				+ "?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=utf8");
62
+//		dsc.setDriverName("com.mysql.jdbc.Driver");
63
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
64
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
65
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
66
+		mpg.setDataSource(dsc);
67
+
68
+		// 包配置
69
+		PackageConfig pc = new PackageConfig();
70
+		pc.setModuleName(SERVICE_NAME);
71
+		pc.setParent("com.xuecheng");
72
+
73
+		pc.setServiceImpl("service.impl");
74
+		pc.setXml("mapper");
75
+		pc.setEntity("model.po");
76
+		mpg.setPackageInfo(pc);
77
+
78
+
79
+		// 设置模板
80
+		TemplateConfig tc = new TemplateConfig();
81
+		mpg.setTemplate(tc);
82
+
83
+		// 策略配置
84
+		StrategyConfig strategy = new StrategyConfig();
85
+		strategy.setNaming(NamingStrategy.underline_to_camel);
86
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
87
+		strategy.setEntityLombokModel(true);
88
+		strategy.setRestControllerStyle(true);
89
+		strategy.setInclude(TABLE_NAMES);
90
+		strategy.setControllerMappingHyphenStyle(true);
91
+		strategy.setTablePrefix(pc.getModuleName() + "_");
92
+		// Boolean类型字段是否移除is前缀处理
93
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
94
+		strategy.setRestControllerStyle(true);
95
+
96
+		// 自动填充字段配置
97
+		strategy.setTableFillList(Arrays.asList(
98
+				new TableFill("create_date", FieldFill.INSERT),
99
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
100
+				new TableFill("modify_date", FieldFill.UPDATE)
101
+		));
102
+		mpg.setStrategy(strategy);
103
+
104
+		mpg.execute();
105
+	}
106
+
107
+}

+ 108 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/MediaCodeGenerator.java

@@ -0,0 +1,108 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class MediaCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "media";
20
+
21
+	private static final String DATA_SOURCE_USER_NAME  = "root";
22
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
23
+	private static final String[] TABLE_NAMES = new String[]{
24
+			"media_files",
25
+			"media_process",
26
+			"media_process_history",
27
+			"mq_message",
28
+			"mq_message_history"
29
+			// "live_course",
30
+	};
31
+
32
+	// TODO 默认生成entity,需要生成DTO修改此变量
33
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
34
+	private static final Boolean IS_DTO = false;
35
+
36
+	public static void main(String[] args) {
37
+		// 代码生成器
38
+		AutoGenerator mpg = new AutoGenerator();
39
+		// 选择 freemarker 引擎,默认 Velocity
40
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
41
+		// 全局配置
42
+		GlobalConfig gc = new GlobalConfig();
43
+		gc.setFileOverride(true);
44
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
45
+		gc.setAuthor("itcast");
46
+		gc.setOpen(false);
47
+		gc.setSwagger2(false);
48
+		gc.setServiceName("%sService");
49
+        gc.setBaseResultMap(true);
50
+        gc.setBaseColumnList(true);
51
+
52
+		if (IS_DTO) {
53
+			gc.setSwagger2(true);
54
+			gc.setEntityName("%sDTO");
55
+		}
56
+		mpg.setGlobalConfig(gc);
57
+
58
+		// 数据库配置
59
+		DataSourceConfig dsc = new DataSourceConfig();
60
+		dsc.setDbType(DbType.MYSQL);
61
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_media"
62
+				+ "?useUnicode=true&useSSL=false&characterEncoding=utf8");
63
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
64
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
65
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
66
+		mpg.setDataSource(dsc);
67
+
68
+		// 包配置
69
+		PackageConfig pc = new PackageConfig();
70
+		pc.setModuleName(SERVICE_NAME);
71
+		pc.setParent("com.xuecheng");
72
+
73
+		pc.setServiceImpl("service.impl");
74
+		pc.setXml("mapper");
75
+		pc.setEntity("model.po");
76
+		mpg.setPackageInfo(pc);
77
+
78
+
79
+		// 设置模板
80
+		TemplateConfig tc = new TemplateConfig();
81
+		mpg.setTemplate(tc);
82
+
83
+		// 策略配置
84
+		StrategyConfig strategy = new StrategyConfig();
85
+		strategy.setNaming(NamingStrategy.underline_to_camel);
86
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
87
+		strategy.setEntityLombokModel(true);
88
+		strategy.setRestControllerStyle(true);
89
+		strategy.setInclude(TABLE_NAMES);
90
+		strategy.setControllerMappingHyphenStyle(true);
91
+		//此项是将生成的po类名中去掉pc.getModuleName() + "_"
92
+//		strategy.setTablePrefix(pc.getModuleName() + "_");
93
+		// Boolean类型字段是否移除is前缀处理
94
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
95
+		strategy.setRestControllerStyle(true);
96
+
97
+		// 自动填充字段配置
98
+		strategy.setTableFillList(Arrays.asList(
99
+				new TableFill("create_date", FieldFill.INSERT),
100
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
101
+				new TableFill("modify_date", FieldFill.UPDATE)
102
+		));
103
+		mpg.setStrategy(strategy);
104
+
105
+		mpg.execute();
106
+	}
107
+
108
+}

+ 116 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/MessageCodeGenerator.java

@@ -0,0 +1,116 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class MessageCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "messagesdk";
20
+
21
+	//数据库账号
22
+	private static final String DATA_SOURCE_USER_NAME  = "root";
23
+	//数据库密码
24
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
25
+	//生成的表
26
+	private static final String[] TABLE_NAMES = new String[]{
27
+			"mq_message",
28
+			"mq_message_history"
29
+//			 "course_base",
30
+//			 "course_market",
31
+//			 "teachplan",
32
+//			 "teachplan_media",
33
+//			 "course_teacher",
34
+//			 "course_pub",
35
+//			 "course_pub_pre"
36
+//			"course_category"
37
+	};
38
+
39
+	// TODO 默认生成entity,需要生成DTO修改此变量
40
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
41
+	private static final Boolean IS_DTO = false;
42
+
43
+	public static void main(String[] args) {
44
+		// 代码生成器
45
+		AutoGenerator mpg = new AutoGenerator();
46
+		// 选择 freemarker 引擎,默认 Velocity
47
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
48
+		// 全局配置
49
+		GlobalConfig gc = new GlobalConfig();
50
+		gc.setFileOverride(true);
51
+		//生成路径
52
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
53
+		gc.setAuthor("itcast");
54
+		gc.setOpen(false);
55
+		gc.setSwagger2(false);
56
+		gc.setServiceName("%sService");
57
+        gc.setBaseResultMap(true);
58
+        gc.setBaseColumnList(true);
59
+
60
+		if (IS_DTO) {
61
+			gc.setSwagger2(true);
62
+			gc.setEntityName("%sDTO");
63
+		}
64
+		mpg.setGlobalConfig(gc);
65
+
66
+		// 数据库配置
67
+		DataSourceConfig dsc = new DataSourceConfig();
68
+		dsc.setDbType(DbType.MYSQL);
69
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_content"
70
+				+ "?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=utf8");
71
+//		dsc.setDriverName("com.mysql.jdbc.Driver");
72
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
73
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
74
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
75
+		mpg.setDataSource(dsc);
76
+
77
+		// 包配置
78
+		PackageConfig pc = new PackageConfig();
79
+		pc.setModuleName(SERVICE_NAME);
80
+		pc.setParent("com.xuecheng");
81
+
82
+		pc.setServiceImpl("service.impl");
83
+		pc.setXml("mapper");
84
+		pc.setEntity("model.po");
85
+		mpg.setPackageInfo(pc);
86
+
87
+
88
+		// 设置模板
89
+		TemplateConfig tc = new TemplateConfig();
90
+		mpg.setTemplate(tc);
91
+
92
+		// 策略配置
93
+		StrategyConfig strategy = new StrategyConfig();
94
+		strategy.setNaming(NamingStrategy.underline_to_camel);
95
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
96
+		strategy.setEntityLombokModel(true);
97
+		strategy.setRestControllerStyle(true);
98
+		strategy.setInclude(TABLE_NAMES);
99
+		strategy.setControllerMappingHyphenStyle(true);
100
+		strategy.setTablePrefix(pc.getModuleName() + "_");
101
+		// Boolean类型字段是否移除is前缀处理
102
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
103
+		strategy.setRestControllerStyle(true);
104
+
105
+		// 自动填充字段配置
106
+		strategy.setTableFillList(Arrays.asList(
107
+				new TableFill("create_date", FieldFill.INSERT),
108
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
109
+				new TableFill("modify_date", FieldFill.UPDATE)
110
+		));
111
+		mpg.setStrategy(strategy);
112
+
113
+		mpg.execute();
114
+	}
115
+
116
+}

+ 111 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/OrderCodeGenerator.java

@@ -0,0 +1,111 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class OrderCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "orders";
20
+
21
+	//数据库账号
22
+	private static final String DATA_SOURCE_USER_NAME  = "root";
23
+	//数据库密码
24
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
25
+	//生成的表
26
+	private static final String[] TABLE_NAMES = new String[]{
27
+//			"mq_message",
28
+//			"mq_message_history",
29
+			"xc_orders",
30
+			"xc_orders_goods",
31
+			"xc_pay_record"
32
+	};
33
+
34
+	// TODO 默认生成entity,需要生成DTO修改此变量
35
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
36
+	private static final Boolean IS_DTO = false;
37
+
38
+	public static void main(String[] args) {
39
+		// 代码生成器
40
+		AutoGenerator mpg = new AutoGenerator();
41
+		// 选择 freemarker 引擎,默认 Velocity
42
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
43
+		// 全局配置
44
+		GlobalConfig gc = new GlobalConfig();
45
+		gc.setFileOverride(true);
46
+		//生成路径
47
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
48
+		gc.setAuthor("itcast");
49
+		gc.setOpen(false);
50
+		gc.setSwagger2(false);
51
+		gc.setServiceName("%sService");
52
+		gc.setBaseResultMap(true);
53
+		gc.setBaseColumnList(true);
54
+
55
+		if (IS_DTO) {
56
+			gc.setSwagger2(true);
57
+			gc.setEntityName("%sDTO");
58
+		}
59
+		mpg.setGlobalConfig(gc);
60
+
61
+		// 数据库配置
62
+		DataSourceConfig dsc = new DataSourceConfig();
63
+		dsc.setDbType(DbType.MYSQL);
64
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_" + SERVICE_NAME
65
+				+ "?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=utf8");
66
+//		dsc.setDriverName("com.mysql.jdbc.Driver");
67
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
68
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
69
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
70
+		mpg.setDataSource(dsc);
71
+
72
+		// 包配置
73
+		PackageConfig pc = new PackageConfig();
74
+		pc.setModuleName(SERVICE_NAME);
75
+		pc.setParent("com.xuecheng");
76
+
77
+		pc.setServiceImpl("service.impl");
78
+		pc.setXml("mapper");
79
+		pc.setEntity("model.po");
80
+		mpg.setPackageInfo(pc);
81
+
82
+
83
+		// 设置模板
84
+		TemplateConfig tc = new TemplateConfig();
85
+		mpg.setTemplate(tc);
86
+
87
+		// 策略配置
88
+		StrategyConfig strategy = new StrategyConfig();
89
+		strategy.setNaming(NamingStrategy.underline_to_camel);
90
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
91
+		strategy.setEntityLombokModel(true);
92
+		strategy.setRestControllerStyle(true);
93
+		strategy.setInclude(TABLE_NAMES);
94
+		strategy.setControllerMappingHyphenStyle(true);
95
+		strategy.setTablePrefix(pc.getModuleName() + "_");
96
+		// Boolean类型字段是否移除is前缀处理
97
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
98
+		strategy.setRestControllerStyle(true);
99
+
100
+		// 自动填充字段配置
101
+		strategy.setTableFillList(Arrays.asList(
102
+				new TableFill("create_date", FieldFill.INSERT),
103
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
104
+				new TableFill("modify_date", FieldFill.UPDATE)
105
+		));
106
+		mpg.setStrategy(strategy);
107
+
108
+		mpg.execute();
109
+	}
110
+
111
+}

+ 103 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/SystemCodeGenerator.java

@@ -0,0 +1,103 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class SystemCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "system";
20
+
21
+	private static final String DATA_SOURCE_USER_NAME  = "root";
22
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
23
+	private static final String[] TABLE_NAMES = new String[]{
24
+			"course_category",
25
+			"dictionary",
26
+	};
27
+
28
+	// TODO 默认生成entity,需要生成DTO修改此变量
29
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
30
+	private static final Boolean IS_DTO = false;
31
+
32
+	public static void main(String[] args) {
33
+		// 代码生成器
34
+		AutoGenerator mpg = new AutoGenerator();
35
+		// 选择 freemarker 引擎,默认 Velocity
36
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
37
+		// 全局配置
38
+		GlobalConfig gc = new GlobalConfig();
39
+		gc.setFileOverride(true);
40
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
41
+		gc.setAuthor("itcast");
42
+		gc.setOpen(false);
43
+		gc.setSwagger2(false);
44
+		gc.setServiceName("%sService");
45
+        gc.setBaseResultMap(true);
46
+        gc.setBaseColumnList(true);
47
+
48
+		if (IS_DTO) {
49
+			gc.setSwagger2(true);
50
+			gc.setEntityName("%sDTO");
51
+		}
52
+		mpg.setGlobalConfig(gc);
53
+
54
+		// 数据库配置
55
+		DataSourceConfig dsc = new DataSourceConfig();
56
+		dsc.setDbType(DbType.MYSQL);
57
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_" + SERVICE_NAME
58
+				+ "?useUnicode=true&useSSL=false&characterEncoding=utf8");
59
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
60
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
61
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
62
+		mpg.setDataSource(dsc);
63
+
64
+		// 包配置
65
+		PackageConfig pc = new PackageConfig();
66
+		pc.setModuleName(SERVICE_NAME);
67
+		pc.setParent("com.xuecheng");
68
+
69
+		pc.setServiceImpl("service.impl");
70
+		pc.setXml("mapper");
71
+		pc.setEntity("model.po");
72
+		mpg.setPackageInfo(pc);
73
+
74
+
75
+		// 设置模板
76
+		TemplateConfig tc = new TemplateConfig();
77
+		mpg.setTemplate(tc);
78
+
79
+		// 策略配置
80
+		StrategyConfig strategy = new StrategyConfig();
81
+		strategy.setNaming(NamingStrategy.underline_to_camel);
82
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
83
+		strategy.setEntityLombokModel(true);
84
+		strategy.setRestControllerStyle(true);
85
+		strategy.setInclude(TABLE_NAMES);
86
+		strategy.setControllerMappingHyphenStyle(true);
87
+		strategy.setTablePrefix(pc.getModuleName() + "_");
88
+		// Boolean类型字段是否移除is前缀处理
89
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
90
+		strategy.setRestControllerStyle(true);
91
+
92
+		// 自动填充字段配置
93
+		strategy.setTableFillList(Arrays.asList(
94
+				new TableFill("create_date", FieldFill.INSERT),
95
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
96
+				new TableFill("modify_date", FieldFill.UPDATE)
97
+		));
98
+		mpg.setStrategy(strategy);
99
+
100
+		mpg.execute();
101
+	}
102
+
103
+}

+ 114 - 0
xuecheng-plus-generator/src/main/java/com/xuecheng/generator/UcenterCodeGenerator.java

@@ -0,0 +1,114 @@
1
+package com.xuecheng.generator;
2
+
3
+import com.baomidou.mybatisplus.annotation.DbType;
4
+import com.baomidou.mybatisplus.annotation.FieldFill;
5
+import com.baomidou.mybatisplus.generator.AutoGenerator;
6
+import com.baomidou.mybatisplus.generator.config.*;
7
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
8
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
9
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
10
+
11
+import java.util.Arrays;
12
+
13
+/**
14
+ * MyBatis-Plus 代码生成类
15
+ */
16
+public class UcenterCodeGenerator {
17
+
18
+	// TODO 修改服务名以及数据表名
19
+	private static final String SERVICE_NAME = "ucenter";
20
+
21
+	//数据库账号
22
+	private static final String DATA_SOURCE_USER_NAME  = "root";
23
+	//数据库密码
24
+	private static final String DATA_SOURCE_PASSWORD  = "mysql";
25
+	//生成的表
26
+	private static final String[] TABLE_NAMES = new String[]{
27
+			"xc_company",
28
+			"xc_company_user",
29
+			"xc_menu",
30
+			"xc_permission",
31
+			"xc_role",
32
+			"xc_teacher",
33
+			"xc_user",
34
+			"xc_user_role"
35
+	};
36
+
37
+	// TODO 默认生成entity,需要生成DTO修改此变量
38
+	// 一般情况下要先生成 DTO类 然后修改此参数再生成 PO 类。
39
+	private static final Boolean IS_DTO = false;
40
+
41
+	public static void main(String[] args) {
42
+		// 代码生成器
43
+		AutoGenerator mpg = new AutoGenerator();
44
+		// 选择 freemarker 引擎,默认 Velocity
45
+		mpg.setTemplateEngine(new FreemarkerTemplateEngine());
46
+		// 全局配置
47
+		GlobalConfig gc = new GlobalConfig();
48
+		gc.setFileOverride(true);
49
+		//生成路径
50
+		gc.setOutputDir(System.getProperty("user.dir") + "/xuecheng-plus-generator/src/main/java");
51
+		gc.setAuthor("itcast");
52
+		gc.setOpen(false);
53
+		gc.setSwagger2(false);
54
+		gc.setServiceName("%sService");
55
+        gc.setBaseResultMap(true);
56
+        gc.setBaseColumnList(true);
57
+
58
+		if (IS_DTO) {
59
+			gc.setSwagger2(true);
60
+			gc.setEntityName("%sDTO");
61
+		}
62
+		mpg.setGlobalConfig(gc);
63
+
64
+		// 数据库配置
65
+		DataSourceConfig dsc = new DataSourceConfig();
66
+		dsc.setDbType(DbType.MYSQL);
67
+		dsc.setUrl("jdbc:mysql://192.168.101.65:3306/xcplus_users"
68
+				+ "?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=utf8");
69
+//		dsc.setDriverName("com.mysql.jdbc.Driver");
70
+		dsc.setDriverName("com.mysql.cj.jdbc.Driver");
71
+		dsc.setUsername(DATA_SOURCE_USER_NAME);
72
+		dsc.setPassword(DATA_SOURCE_PASSWORD);
73
+		mpg.setDataSource(dsc);
74
+
75
+		// 包配置
76
+		PackageConfig pc = new PackageConfig();
77
+		pc.setModuleName(SERVICE_NAME);
78
+		pc.setParent("com.xuecheng");
79
+
80
+		pc.setServiceImpl("service.impl");
81
+		pc.setXml("mapper");
82
+		pc.setEntity("model.po");
83
+		mpg.setPackageInfo(pc);
84
+
85
+
86
+		// 设置模板
87
+		TemplateConfig tc = new TemplateConfig();
88
+		mpg.setTemplate(tc);
89
+
90
+		// 策略配置
91
+		StrategyConfig strategy = new StrategyConfig();
92
+		strategy.setNaming(NamingStrategy.underline_to_camel);
93
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
94
+		strategy.setEntityLombokModel(true);
95
+		strategy.setRestControllerStyle(true);
96
+		strategy.setInclude(TABLE_NAMES);
97
+		strategy.setControllerMappingHyphenStyle(true);
98
+		strategy.setTablePrefix(pc.getModuleName() + "_");
99
+		// Boolean类型字段是否移除is前缀处理
100
+		strategy.setEntityBooleanColumnRemoveIsPrefix(true);
101
+		strategy.setRestControllerStyle(true);
102
+
103
+		// 自动填充字段配置
104
+		strategy.setTableFillList(Arrays.asList(
105
+				new TableFill("create_date", FieldFill.INSERT),
106
+				new TableFill("change_date", FieldFill.INSERT_UPDATE),
107
+				new TableFill("modify_date", FieldFill.UPDATE)
108
+		));
109
+		mpg.setStrategy(strategy);
110
+
111
+		mpg.execute();
112
+	}
113
+
114
+}

+ 44 - 0
xuecheng-plus-generator/src/main/resources/templates/controller.java.ftl

@@ -0,0 +1,44 @@
1
+package ${package.Controller};
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+<#if restControllerStyle>
5
+import org.springframework.web.bind.annotation.RestController;
6
+<#else>
7
+import org.springframework.stereotype.Controller;
8
+</#if>
9
+<#if superControllerClassPackage??>
10
+import ${superControllerClassPackage};
11
+</#if>
12
+import ${package.Service}.${table.serviceName};
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiOperation;
15
+import lombok.extern.slf4j.Slf4j;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+
18
+/**
19
+ * <p>
20
+ * ${table.comment!} 前端控制器
21
+ * </p>
22
+ *
23
+ * @author ${author}
24
+ */
25
+@Slf4j
26
+<#if restControllerStyle>
27
+@RestController
28
+<#else>
29
+@Controller
30
+</#if>
31
+<#if kotlin>
32
+class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
33
+<#else>
34
+<#if superControllerClass??>
35
+public class ${table.controllerName} extends ${superControllerClass} {
36
+<#else>
37
+@RequestMapping("${entity?uncap_first}")
38
+public class ${table.controllerName} {
39
+</#if>
40
+
41
+    @Autowired
42
+    private ${table.serviceName}  ${table.serviceName?uncap_first};
43
+}
44
+</#if>

+ 37 - 0
xuecheng-plus-generator/src/main/resources/templates/default/controller.btl

@@ -0,0 +1,37 @@
1
+package ${entity.controllerPackage};
2
+
3
+import cn.exrick.xboot.base.XbootBaseController;
4
+import cn.exrick.xboot.common.utils.PageUtil;
5
+import cn.exrick.xboot.common.utils.ResultUtil;
6
+import cn.exrick.xboot.common.vo.PageVo;
7
+import cn.exrick.xboot.common.vo.Result;
8
+import ${entity.entityPackage}.${entity.className};
9
+import ${entity.servicePackage}.${entity.className}Service;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiOperation;
12
+import lombok.extern.slf4j.Slf4j;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.data.domain.Page;
15
+import org.springframework.web.bind.annotation.*;
16
+import org.springframework.transaction.annotation.Transactional;
17
+
18
+
19
+/**
20
+ * @author ${entity.author}
21
+ */
22
+@Slf4j
23
+@RestController
24
+@Api(description = "${entity.description}管理接口")
25
+@RequestMapping("/xboot/${entity.classNameLowerCase}")
26
+@Transactional
27
+public class ${entity.className}Controller extends XbootBaseController<${entity.className}, ${entity.primaryKeyType}>{
28
+
29
+    @Autowired
30
+    private ${entity.className}Service ${entity.classNameLowerCase}Service;
31
+
32
+    @Override
33
+    public ${entity.className}Service getService() {
34
+        return ${entity.classNameLowerCase}Service;
35
+    }
36
+
37
+}

+ 39 - 0
xuecheng-plus-generator/src/main/resources/templates/default/controller.java.btl

@@ -0,0 +1,39 @@
1
+package ${package.Controller};
2
+
3
+
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+
6
+<% if(restControllerStyle){ %>
7
+import org.springframework.web.bind.annotation.RestController;
8
+<% }else{ %>
9
+import org.springframework.stereotype.Controller;
10
+<% } %>
11
+<% if(isNotEmpty(superControllerClassPackage)){ %>
12
+import ${superControllerClassPackage};
13
+<% } %>
14
+
15
+/**
16
+ * <p>
17
+ * ${table.comment!} 前端控制器
18
+ * </p>
19
+ *
20
+ * @author ${author}
21
+ * @since ${date}
22
+ */
23
+<% if(restControllerStyle){ %>
24
+@RestController
25
+<% }else{ %>
26
+@Controller
27
+<% } %>
28
+@RequestMapping("<% if(isNotEmpty(package.ModuleName)){ %>/${package.ModuleName}<% } %>/<% if(isNotEmpty(controllerMappingHyphenStyle)){ %>${controllerMappingHyphen}<% }else{ %>${table.entityPath}<% } %>")
29
+<% if(kotlin){ %>
30
+class ${table.controllerName}<% if(isNotEmpty(superControllerClass)){ %> : ${superControllerClass}()<% } %>
31
+<% }else{ %>
32
+    <% if(isNotEmpty(superControllerClass)){ %>
33
+public class ${table.controllerName} extends ${superControllerClass} {
34
+    <% }else{ %>
35
+public class ${table.controllerName} {
36
+    <% } %>
37
+
38
+}
39
+<% } %>

+ 38 - 0
xuecheng-plus-generator/src/main/resources/templates/default/controller.java.ftl

@@ -0,0 +1,38 @@
1
+package ${package.Controller};
2
+
3
+
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+
6
+<#if restControllerStyle>
7
+import org.springframework.web.bind.annotation.RestController;
8
+<#else>
9
+import org.springframework.stereotype.Controller;
10
+</#if>
11
+<#if superControllerClassPackage??>
12
+import ${superControllerClassPackage};
13
+</#if>
14
+
15
+/**
16
+ * <p>
17
+ * ${table.comment!} 前端控制器
18
+ * </p>
19
+ *
20
+ * @author ${author}
21
+ */
22
+<#if restControllerStyle>
23
+@RestController
24
+<#else>
25
+@Controller
26
+</#if>
27
+@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
28
+<#if kotlin>
29
+class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
30
+<#else>
31
+<#if superControllerClass??>
32
+public class ${table.controllerName} extends ${superControllerClass} {
33
+<#else>
34
+public class ${table.controllerName} {
35
+</#if>
36
+
37
+}
38
+</#if>

+ 41 - 0
xuecheng-plus-generator/src/main/resources/templates/default/controller.java.vm

@@ -0,0 +1,41 @@
1
+package ${package.Controller};
2
+
3
+
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+
6
+#if(${restControllerStyle})
7
+import org.springframework.web.bind.annotation.RestController;
8
+#else
9
+import org.springframework.stereotype.Controller;
10
+#end
11
+#if(${superControllerClassPackage})
12
+import ${superControllerClassPackage};
13
+#end
14
+
15
+/**
16
+ * <p>
17
+ * $!{table.comment} 前端控制器
18
+ * </p>
19
+ *
20
+ * @author ${author}
21
+ * @since ${date}
22
+ */
23
+#if(${restControllerStyle})
24
+@RestController
25
+#else
26
+@Controller
27
+#end
28
+@RequestMapping("#if(${package.ModuleName})/${package.ModuleName}#end/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end")
29
+#if(${kotlin})
30
+class ${table.controllerName}#if(${superControllerClass}) : ${superControllerClass}()#end
31
+
32
+#else
33
+#if(${superControllerClass})
34
+public class ${table.controllerName} extends ${superControllerClass} {
35
+#else
36
+public class ${table.controllerName} {
37
+#end
38
+
39
+}
40
+
41
+#end

+ 14 - 0
xuecheng-plus-generator/src/main/resources/templates/default/dao.btl

@@ -0,0 +1,14 @@
1
+package ${entity.daoPackage};
2
+
3
+import cn.exrick.xboot.base.XbootBaseDao;
4
+import ${entity.entityPackage}.${entity.className};
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * ${entity.description}数据处理层
10
+ * @author ${entity.author}
11
+ */
12
+public interface ${entity.className}Dao extends XbootBaseDao<${entity.className},${entity.primaryKeyType}> {
13
+
14
+}

+ 24 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.btl

@@ -0,0 +1,24 @@
1
+package ${entity.entityPackage};
2
+
3
+import cn.exrick.xboot.base.XbootBaseEntity;
4
+import com.baomidou.mybatisplus.annotations.TableName;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import io.swagger.annotations.ApiModel;
7
+import lombok.Data;
8
+
9
+import javax.persistence.Entity;
10
+import javax.persistence.Table;
11
+
12
+/**
13
+ * @author ${entity.author}
14
+ */
15
+@Data
16
+@Entity
17
+@Table(name = "${entity.tableName}")
18
+@TableName("${entity.tableName}")
19
+@ApiModel(value = "${entity.description}")
20
+public class ${entity.className} extends XbootBaseEntity {
21
+
22
+    private static final long serialVersionUID = 1L;
23
+
24
+}

+ 162 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.java.btl

@@ -0,0 +1,162 @@
1
+package ${package.Entity};
2
+<% for(pkg in table.importPackages){ %>
3
+import ${pkg};
4
+<% } %>
5
+<% if(swagger2){ %>
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+<% } %>
9
+<% if(entityLombokModel){ %>
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+import lombok.experimental.Accessors;
13
+<% } %>
14
+/**
15
+ * <p>
16
+ * ${table.comment!}
17
+ * </p>
18
+ *
19
+ * @author ${author}
20
+ * @since ${date}
21
+ */
22
+<% if(entityLombokModel){ %>
23
+@Data
24
+    <% if(isNotEmpty(superEntityClass)){ %>
25
+@EqualsAndHashCode(callSuper = true)
26
+    <% }else{ %>
27
+@EqualsAndHashCode(callSuper = false)
28
+    <% } %>
29
+@Accessors(chain = true)
30
+<% } %>
31
+<% if(table.convert){ %>
32
+@TableName("${table.name}")
33
+<% } %>
34
+<% if(swagger2){ %>
35
+@ApiModel(value="${entity}对象", description="${table.comment!''}")
36
+<% } %>
37
+<% if(isNotEmpty(superEntityClass)){ %>
38
+public class ${entity} extends ${superEntityClass}<% if(activeRecord){ %><${entity}><%}%>{
39
+<% }else if(activeRecord){ %>
40
+public class ${entity} extends Model<${entity}> {
41
+<% }else{ %>
42
+public class ${entity} implements Serializable {
43
+<% } %>
44
+
45
+<% if(entitySerialVersionUID){ %>
46
+    private static final long serialVersionUID = 1L;
47
+<% } %>
48
+<% /** -----------BEGIN 字段循环遍历----------- **/ %>
49
+<% for(field in table.fields){ %>
50
+    <%
51
+    if(field.keyFlag){
52
+        var keyPropertyName = field.propertyName;
53
+    }
54
+    %>
55
+
56
+    <% if(isNotEmpty(field.comment)){ %>
57
+        <% if(swagger2){ %>
58
+    @ApiModelProperty(value = "${field.comment}")
59
+        <% }else{ %>
60
+    /**
61
+     * ${field.comment}
62
+     */
63
+        <% } %>
64
+    <% } %>
65
+    <% if(field.keyFlag){ %>
66
+    <%
67
+    /*主键*/
68
+    %>
69
+        <% if(field.keyIdentityFlag){ %>
70
+    @TableId(value = "${field.name}", type = IdType.AUTO)
71
+        <% }else if(isNotEmpty(idType)){ %>
72
+    @TableId(value = "${field.name}", type = IdType.${idType})
73
+        <% }else if(field.convert){ %>
74
+    @TableId("${field.name}")
75
+         <% } %>
76
+    <%
77
+    /*普通字段*/
78
+    %>
79
+    <% }else if(isNotEmpty(field.fill)){ %>
80
+        <% if(field.convert){ %>
81
+    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
82
+        <% }else{ %>
83
+    @TableField(fill = FieldFill.${field.fill})
84
+        <% } %>
85
+    <% }else if(field.convert){ %>
86
+    @TableField("${field.name}")
87
+    <% } %>
88
+    <%
89
+    /*乐观锁注解*/
90
+    %>
91
+    <% if(versionFieldName!'' == field.name){ %>
92
+    @Version
93
+    <% } %>
94
+    <%
95
+    /*逻辑删除注解*/
96
+    %>
97
+    <% if(logicDeleteFieldName!'' == field.name){ %>
98
+    @TableLogic
99
+    <% } %>
100
+    private ${field.propertyType} ${field.propertyName};
101
+<% } %>
102
+<% /** -----------END 字段循环遍历----------- **/ %>
103
+
104
+<% if(!entityLombokModel){ %>
105
+    <% for(field in table.fields){ %>
106
+        <%
107
+        var getprefix ='';
108
+        if(field.propertyType=='boolean'){
109
+            getprefix='is';
110
+        }else{
111
+            getprefix='get';
112
+        }
113
+        %>
114
+    public ${field.propertyType} ${getprefix}${field.capitalName}() {
115
+        return ${field.propertyName};
116
+    }
117
+
118
+        <% if(entityBuilderModel){ %>
119
+    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
120
+        <% }else{ %>
121
+    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
122
+        <% } %>
123
+        this.${field.propertyName} = ${field.propertyName};
124
+        <% if(entityBuilderModel){ %>
125
+        return this;
126
+        <% } %>
127
+    }
128
+
129
+    <% } %>
130
+<% } %>
131
+<% if(entityColumnConstant){ %>
132
+   <% for(field in table.fields){ %>
133
+    public static final String ${strutil.toUpperCase(field.name)} = "${field.name}";
134
+
135
+   <% } %>
136
+<% } %>
137
+<% if(activeRecord){ %>
138
+    @Override
139
+    protected Serializable pkVal() {
140
+    <% if(isNotEmpty(keyPropertyName)){ %>
141
+        return this.${keyPropertyName};
142
+    <% }else{ %>
143
+        return null;
144
+    <% } %>
145
+    }
146
+
147
+<% } %>
148
+<% if(!entityLombokModel){ %>
149
+    @Override
150
+    public String toString() {
151
+        return "${entity}{" +
152
+    <% for(field in table.fields){ %>
153
+       <% if(fieldLP.index==0){ %>
154
+        "${field.propertyName}=" + ${field.propertyName} +
155
+       <% }else{ %>
156
+        ", ${field.propertyName}=" + ${field.propertyName} +
157
+       <% } %>
158
+    <% } %>
159
+        "}";
160
+    }
161
+<% } %>
162
+}

+ 151 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.java.ftl

@@ -0,0 +1,151 @@
1
+package ${package.Entity};
2
+
3
+<#list table.importPackages as pkg>
4
+    import ${pkg};
5
+</#list>
6
+<#if swagger2>
7
+    import io.swagger.annotations.ApiModel;
8
+    import io.swagger.annotations.ApiModelProperty;
9
+</#if>
10
+<#if entityLombokModel>
11
+    import lombok.Data;
12
+    import lombok.EqualsAndHashCode;
13
+    import lombok.experimental.Accessors;
14
+</#if>
15
+
16
+/**
17
+* <p>
18
+    * ${table.comment!}
19
+    * </p>
20
+*
21
+* @author ${author}
22
+*/
23
+<#if entityLombokModel>
24
+    @Data
25
+    <#if superEntityClass??>
26
+        @EqualsAndHashCode(callSuper = true)
27
+    <#else>
28
+        @EqualsAndHashCode(callSuper = false)
29
+    </#if>
30
+    @Accessors(chain = true)
31
+</#if>
32
+<#if table.convert>
33
+    @TableName("${table.name}")
34
+</#if>
35
+<#if swagger2>
36
+    @ApiModel(value="${entity}对象", description="${table.comment!}")
37
+</#if>
38
+<#if superEntityClass??>
39
+    public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}></#if> {
40
+<#elseif activeRecord>
41
+    public class ${entity} extends Model<${entity}> {
42
+<#else>
43
+    public class ${entity} implements Serializable {
44
+</#if>
45
+
46
+<#if entitySerialVersionUID>
47
+    private static final long serialVersionUID = 1L;
48
+</#if>
49
+<#-- ----------  BEGIN 字段循环遍历  ---------->
50
+<#list table.fields as field>
51
+    <#if field.keyFlag>
52
+        <#assign keyPropertyName="${field.propertyName}"/>
53
+    </#if>
54
+
55
+    <#if field.comment!?length gt 0>
56
+        <#if swagger2>
57
+            @ApiModelProperty(value = "${field.comment}")
58
+        <#else>
59
+            /**
60
+            * ${field.comment}
61
+            */
62
+        </#if>
63
+    </#if>
64
+    <#if field.keyFlag>
65
+    <#-- 主键 -->
66
+        <#if field.keyIdentityFlag>
67
+            @TableId(value = "${field.name}", type = IdType.AUTO)
68
+        <#elseif idType??>
69
+            @TableId(value = "${field.name}", type = IdType.${idType})
70
+        <#elseif field.convert>
71
+            @TableId("${field.name}")
72
+        </#if>
73
+    <#-- 普通字段 -->
74
+    <#elseif field.fill??>
75
+    <#-- -----   存在字段填充设置   ----->
76
+        <#if field.convert>
77
+            @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
78
+        <#else>
79
+            @TableField(fill = FieldFill.${field.fill})
80
+        </#if>
81
+    <#elseif field.convert>
82
+        @TableField("${field.name}")
83
+    </#if>
84
+<#-- 乐观锁注解 -->
85
+    <#if (versionFieldName!"") == field.name>
86
+        @Version
87
+    </#if>
88
+<#-- 逻辑删除注解 -->
89
+    <#if (logicDeleteFieldName!"") == field.name>
90
+        @TableLogic
91
+    </#if>
92
+    private ${field.propertyType} ${field.propertyName};
93
+</#list>
94
+<#------------  END 字段循环遍历  ---------->
95
+
96
+<#if !entityLombokModel>
97
+    <#list table.fields as field>
98
+        <#if field.propertyType == "boolean">
99
+            <#assign getprefix="is"/>
100
+        <#else>
101
+            <#assign getprefix="get"/>
102
+        </#if>
103
+        public ${field.propertyType} ${getprefix}${field.capitalName}() {
104
+        return ${field.propertyName};
105
+        }
106
+
107
+        <#if entityBuilderModel>
108
+            public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
109
+        <#else>
110
+            public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
111
+        </#if>
112
+        this.${field.propertyName} = ${field.propertyName};
113
+        <#if entityBuilderModel>
114
+            return this;
115
+        </#if>
116
+        }
117
+    </#list>
118
+</#if>
119
+
120
+<#if entityColumnConstant>
121
+    <#list table.fields as field>
122
+        public static final String ${field.name?upper_case} = "${field.name}";
123
+
124
+    </#list>
125
+</#if>
126
+<#if activeRecord>
127
+    @Override
128
+    protected Serializable pkVal() {
129
+    <#if keyPropertyName??>
130
+        return this.${keyPropertyName};
131
+    <#else>
132
+        return null;
133
+    </#if>
134
+    }
135
+
136
+</#if>
137
+<#if !entityLombokModel>
138
+    @Override
139
+    public String toString() {
140
+    return "${entity}{" +
141
+    <#list table.fields as field>
142
+        <#if field_index==0>
143
+            "${field.propertyName}=" + ${field.propertyName} +
144
+        <#else>
145
+            ", ${field.propertyName}=" + ${field.propertyName} +
146
+        </#if>
147
+    </#list>
148
+    "}";
149
+    }
150
+</#if>
151
+}

+ 153 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.java.vm

@@ -0,0 +1,153 @@
1
+package ${package.Entity};
2
+
3
+#foreach($pkg in ${table.importPackages})
4
+import ${pkg};
5
+#end
6
+#if(${swagger2})
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+#end
10
+#if(${entityLombokModel})
11
+import lombok.Data;
12
+import lombok.EqualsAndHashCode;
13
+import lombok.experimental.Accessors;
14
+#end
15
+
16
+/**
17
+ * <p>
18
+ * $!{table.comment}
19
+ * </p>
20
+ *
21
+ * @author ${author}
22
+ * @since ${date}
23
+ */
24
+#if(${entityLombokModel})
25
+@Data
26
+#if(${superEntityClass})
27
+@EqualsAndHashCode(callSuper = true)
28
+#else
29
+@EqualsAndHashCode(callSuper = false)
30
+#end
31
+@Accessors(chain = true)
32
+#end
33
+#if(${table.convert})
34
+@TableName("${table.name}")
35
+#end
36
+#if(${swagger2})
37
+@ApiModel(value="${entity}对象", description="$!{table.comment}")
38
+#end
39
+#if(${superEntityClass})
40
+public class ${entity} extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
41
+#elseif(${activeRecord})
42
+public class ${entity} extends Model<${entity}> {
43
+#else
44
+public class ${entity} implements Serializable {
45
+#end
46
+
47
+#if(${entitySerialVersionUID})
48
+private static final long serialVersionUID=1L;
49
+#end
50
+## ----------  BEGIN 字段循环遍历  ----------
51
+#foreach($field in ${table.fields})
52
+
53
+#if(${field.keyFlag})
54
+#set($keyPropertyName=${field.propertyName})
55
+#end
56
+#if("$!field.comment" != "")
57
+#if(${swagger2})
58
+    @ApiModelProperty(value = "${field.comment}")
59
+#else
60
+    /**
61
+     * ${field.comment}
62
+     */
63
+#end
64
+#end
65
+#if(${field.keyFlag})
66
+## 主键
67
+#if(${field.keyIdentityFlag})
68
+    @TableId(value = "${field.name}", type = IdType.AUTO)
69
+#elseif(!$null.isNull(${idType}) && "$!idType" != "")
70
+    @TableId(value = "${field.name}", type = IdType.${idType})
71
+#elseif(${field.convert})
72
+    @TableId("${field.name}")
73
+#end
74
+## 普通字段
75
+#elseif(${field.fill})
76
+## -----   存在字段填充设置   -----
77
+#if(${field.convert})
78
+    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
79
+#else
80
+    @TableField(fill = FieldFill.${field.fill})
81
+#end
82
+#elseif(${field.convert})
83
+    @TableField("${field.name}")
84
+#end
85
+## 乐观锁注解
86
+#if(${versionFieldName}==${field.name})
87
+    @Version
88
+#end
89
+## 逻辑删除注解
90
+#if(${logicDeleteFieldName}==${field.name})
91
+    @TableLogic
92
+#end
93
+    private ${field.propertyType} ${field.propertyName};
94
+#end
95
+## ----------  END 字段循环遍历  ----------
96
+
97
+#if(!${entityLombokModel})
98
+#foreach($field in ${table.fields})
99
+#if(${field.propertyType.equals("boolean")})
100
+#set($getprefix="is")
101
+#else
102
+#set($getprefix="get")
103
+#end
104
+
105
+    public ${field.propertyType} ${getprefix}${field.capitalName}() {
106
+        return ${field.propertyName};
107
+    }
108
+
109
+#if(${entityBuilderModel})
110
+    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
111
+#else
112
+    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
113
+#end
114
+        this.${field.propertyName} = ${field.propertyName};
115
+#if(${entityBuilderModel})
116
+        return this;
117
+#end
118
+    }
119
+#end
120
+#end
121
+
122
+#if(${entityColumnConstant})
123
+#foreach($field in ${table.fields})
124
+    public static final String ${field.name.toUpperCase()} = "${field.name}";
125
+
126
+#end
127
+#end
128
+#if(${activeRecord})
129
+    @Override
130
+    protected Serializable pkVal() {
131
+#if(${keyPropertyName})
132
+        return this.${keyPropertyName};
133
+#else
134
+        return null;
135
+#end
136
+    }
137
+
138
+#end
139
+#if(!${entityLombokModel})
140
+    @Override
141
+    public String toString() {
142
+        return "${entity}{" +
143
+#foreach($field in ${table.fields})
144
+#if($!{foreach.index}==0)
145
+        "${field.propertyName}=" + ${field.propertyName} +
146
+#else
147
+        ", ${field.propertyName}=" + ${field.propertyName} +
148
+#end
149
+#end
150
+        "}";
151
+    }
152
+#end
153
+}

+ 124 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.btl

@@ -0,0 +1,124 @@
1
+package ${package.Entity}
2
+<% for(pkg in table.importPackages){ %>
3
+import ${pkg}
4
+<% } %>
5
+<% if(swagger2){ %>
6
+import io.swagger.annotations.ApiModel
7
+import io.swagger.annotations.ApiModelProperty
8
+<% } %>
9
+/**
10
+ * <p>
11
+ * ${table.comment!}
12
+ * </p>
13
+ *
14
+ * @author ${author}
15
+ * @since ${date}
16
+ */
17
+<% if(table.convert){ %>
18
+@TableName("${table.name}")
19
+<% } %>
20
+<% if(swagger2){ %>
21
+@ApiModel(value="${entity}对象", description="${table.comment!''}")
22
+<% } %>
23
+<% if(isNotEmpty(superEntityClass)){ %>
24
+class ${entity} : ${superEntityClass}<% if(activeRecord){ %><${entity}><%}%>{
25
+<% }else if(activeRecord){ %>
26
+class ${entity} : Model<${entity}> {
27
+<% }else{ %>
28
+class ${entity} : Serializable {
29
+<% } %>
30
+
31
+<% /** -----------BEGIN 字段循环遍历----------- **/ %>
32
+<% for(field in table.fields){ %>
33
+    <%
34
+    if(field.keyFlag){
35
+        var keyPropertyName = field.propertyName;
36
+    }
37
+    %>
38
+
39
+    <% if(isNotEmpty(field.comment)){ %>
40
+        <% if(swagger2){ %>
41
+    @ApiModelProperty(value = "${field.comment}")
42
+        <% }else{ %>
43
+    /**
44
+     * ${field.comment}
45
+     */
46
+        <% } %>
47
+    <% } %>
48
+    <% if(field.keyFlag){ %>
49
+    <%
50
+    /*主键*/
51
+    %>
52
+        <% if(field.keyIdentityFlag){ %>
53
+    @TableId(value = "${field.name}", type = IdType.AUTO)
54
+        <% }else if(isNotEmpty(idType)){ %>
55
+    @TableId(value = "${field.name}", type = IdType.${idType})
56
+        <% }else if(field.convert){ %>
57
+    @TableId("${field.name}")
58
+         <% } %>
59
+    <%
60
+    /*普通字段*/
61
+    %>
62
+    <% }else if(isNotEmpty(field.fill)){ %>
63
+        <% if(field.convert){ %>
64
+    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
65
+        <% }else{ %>
66
+    @TableField(fill = FieldFill.${field.fill})
67
+        <% } %>
68
+    <% }else if(field.convert){ %>
69
+    @TableField("${field.name}")
70
+    <% } %>
71
+    <%
72
+    /*乐观锁注解*/
73
+    %>
74
+    <% if(versionFieldName!'' == field.name){ %>
75
+    @Version
76
+    <% } %>
77
+    <%
78
+    /*逻辑删除注解*/
79
+    %>
80
+    <% if(logicDeleteFieldName!'' == field.name){ %>
81
+    @TableLogic
82
+    <% } %>
83
+    <% if(field.propertyType == 'Integer'){ %>
84
+    var ${field.propertyName}: Int ? = null
85
+    <% }else{ %>
86
+    var ${field.propertyName}: ${field.propertyType} ? = null
87
+    <% } %>
88
+<% } %>
89
+<% /** -----------END 字段循环遍历----------- **/ %>
90
+
91
+<% if(entityColumnConstant){ %>
92
+    companion object {
93
+   <% for(field in table.fields){ %>
94
+    const val ${strutil.toUpperCase(field.name)} : String = "${field.name}"
95
+   <% } %>
96
+    }
97
+<% } %>
98
+<% if(activeRecord){ %>
99
+    @Override
100
+    override fun pkVal(): Serializable? {
101
+    <% if(isNotEmpty(keyPropertyName)){ %>
102
+        return this.${keyPropertyName}
103
+    <% }else{ %>
104
+        return null;
105
+    <% } %>
106
+    }
107
+
108
+<% } %>
109
+
110
+<% if(!entityLombokModel){ %>
111
+    @Override
112
+    override fun toString(): String  {
113
+        return "${entity}{" +
114
+    <% for(field in table.fields){ %>
115
+       <% if(fieldLP.index==0){ %>
116
+        "${field.propertyName}=" + ${field.propertyName} +
117
+       <% }else{ %>
118
+        ", ${field.propertyName}=" + ${field.propertyName} +
119
+       <% } %>
120
+    <% } %>
121
+        "}"
122
+    }
123
+<% } %>
124
+}

+ 115 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.ftl

@@ -0,0 +1,115 @@
1
+package ${package.Entity}
2
+
3
+<#list table.importPackages as pkg>
4
+import ${pkg}
5
+</#list>
6
+<#if swagger2>
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+</#if>
10
+/**
11
+ * <p>
12
+ * ${table.comment}
13
+ * </p>
14
+ *
15
+ * @author ${author}
16
+ * @since ${date}
17
+ */
18
+<#if table.convert>
19
+@TableName("${table.name}")
20
+</#if>
21
+<#if swagger2>
22
+    @ApiModel(value="${entity}对象", description="${table.comment!}")
23
+</#if>
24
+<#if superEntityClass??>
25
+class ${entity} : ${superEntityClass}<#if activeRecord><${entity}></#if> {
26
+<#elseif activeRecord>
27
+class ${entity} : Model<${entity}>() {
28
+<#else>
29
+class ${entity} : Serializable {
30
+</#if>
31
+
32
+<#-- ----------  BEGIN 字段循环遍历  ---------->
33
+<#list table.fields as field>
34
+<#if field.keyFlag>
35
+    <#assign keyPropertyName="${field.propertyName}"/>
36
+</#if>
37
+
38
+<#if field.comment!?length gt 0>
39
+<#if swagger2>
40
+        @ApiModelProperty(value = "${field.comment}")
41
+<#else>
42
+    /**
43
+     * ${field.comment}
44
+     */
45
+</#if>
46
+</#if>
47
+<#if field.keyFlag>
48
+<#-- 主键 -->
49
+<#if field.keyIdentityFlag>
50
+    @TableId(value = "${field.name}", type = IdType.AUTO)
51
+<#elseif idType ??>
52
+    @TableId(value = "${field.name}", type = IdType.${idType})
53
+<#elseif field.convert>
54
+    @TableId("${field.name}")
55
+</#if>
56
+<#-- 普通字段 -->
57
+<#elseif field.fill??>
58
+<#-- -----   存在字段填充设置   ----->
59
+<#if field.convert>
60
+    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
61
+<#else>
62
+    @TableField(fill = FieldFill.${field.fill})
63
+</#if>
64
+<#elseif field.convert>
65
+    @TableField("${field.name}")
66
+</#if>
67
+<#-- 乐观锁注解 -->
68
+<#if (versionFieldName!"") == field.name>
69
+    @Version
70
+</#if>
71
+<#-- 逻辑删除注解 -->
72
+<#if (logicDeleteFieldName!"") == field.name>
73
+    @TableLogic
74
+</#if>
75
+    <#if field.propertyType == "Integer">
76
+    var ${field.propertyName}: Int? = null
77
+    <#else>
78
+    var ${field.propertyName}: ${field.propertyType}? = null
79
+    </#if>
80
+</#list>
81
+<#-- ----------  END 字段循环遍历  ---------->
82
+
83
+
84
+<#if entityColumnConstant>
85
+    companion object {
86
+<#list table.fields as field>
87
+
88
+        const val ${field.name.toUpperCase()} : String = "${field.name}"
89
+
90
+</#list>
91
+    }
92
+
93
+</#if>
94
+<#if activeRecord>
95
+    override fun pkVal(): Serializable? {
96
+<#if keyPropertyName??>
97
+        return ${keyPropertyName}
98
+<#else>
99
+        return null
100
+</#if>
101
+    }
102
+
103
+</#if>
104
+    override fun toString(): String {
105
+        return "${entity}{" +
106
+<#list table.fields as field>
107
+<#if field_index==0>
108
+        "${field.propertyName}=" + ${field.propertyName} +
109
+<#else>
110
+        ", ${field.propertyName}=" + ${field.propertyName} +
111
+</#if>
112
+</#list>
113
+        "}"
114
+    }
115
+}

+ 114 - 0
xuecheng-plus-generator/src/main/resources/templates/default/entity.kt.vm

@@ -0,0 +1,114 @@
1
+package ${package.Entity};
2
+
3
+#foreach($pkg in ${table.importPackages})
4
+import ${pkg};
5
+#end
6
+#if(${swagger2})
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+#end
10
+/**
11
+ * <p>
12
+ * $!{table.comment}
13
+ * </p>
14
+ *
15
+ * @author ${author}
16
+ * @since ${date}
17
+ */
18
+#if(${table.convert})
19
+@TableName("${table.name}")
20
+#end
21
+#if(${swagger2})
22
+@ApiModel(value="${entity}对象", description="$!{table.comment}")
23
+#end
24
+#if(${superEntityClass})
25
+class ${entity} : ${superEntityClass}#if(${activeRecord})<${entity}>#end() {
26
+#elseif(${activeRecord})
27
+class ${entity} : Model<${entity}>() {
28
+#else
29
+class ${entity} : Serializable {
30
+#end
31
+
32
+## ----------  BEGIN 字段循环遍历  ----------
33
+#foreach($field in ${table.fields})
34
+#if(${field.keyFlag})
35
+#set($keyPropertyName=${field.propertyName})
36
+#end
37
+#if("$!field.comment" != "")
38
+    #if(${swagger2})
39
+    @ApiModelProperty(value = "${field.comment}")
40
+    #else
41
+    /**
42
+     * ${field.comment}
43
+     */
44
+    #end
45
+#end
46
+#if(${field.keyFlag})
47
+## 主键
48
+#if(${field.keyIdentityFlag})
49
+    @TableId(value = "${field.name}", type = IdType.AUTO)
50
+#elseif(!$null.isNull(${idType}) && "$!idType" != "")
51
+    @TableId(value = "${field.name}", type = IdType.${idType})
52
+#elseif(${field.convert})
53
+    @TableId("${field.name}")
54
+#end
55
+## 普通字段
56
+#elseif(${field.fill})
57
+## -----   存在字段填充设置   -----
58
+#if(${field.convert})
59
+    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
60
+#else
61
+    @TableField(fill = FieldFill.${field.fill})
62
+#end
63
+#elseif(${field.convert})
64
+    @TableField("${field.name}")
65
+#end
66
+## 乐观锁注解
67
+#if(${versionFieldName}==${field.name})
68
+    @Version
69
+#end
70
+## 逻辑删除注解
71
+#if(${logicDeleteFieldName}==${field.name})
72
+    @TableLogic
73
+#end
74
+    #if(${field.propertyType} == "Integer")
75
+    var ${field.propertyName}: Int? = null
76
+    #else
77
+    var ${field.propertyName}: ${field.propertyType}? = null
78
+    #end
79
+#end
80
+## ----------  END 字段循环遍历  ----------
81
+
82
+
83
+#if(${entityColumnConstant})
84
+    companion object {
85
+#foreach($field in ${table.fields})
86
+
87
+        const val ${field.name.toUpperCase()} : String = "${field.name}"
88
+
89
+#end
90
+    }
91
+
92
+#end
93
+#if(${activeRecord})
94
+    override fun pkVal(): Serializable? {
95
+#if(${keyPropertyName})
96
+        return ${keyPropertyName}
97
+#else
98
+        return null
99
+#end
100
+    }
101
+
102
+#end
103
+    override fun toString(): String {
104
+        return "${entity}{" +
105
+#foreach($field in ${table.fields})
106
+#if($!{foreach.index}==0)
107
+        "${field.propertyName}=" + ${field.propertyName} +
108
+#else
109
+        ", ${field.propertyName}=" + ${field.propertyName} +
110
+#end
111
+#end
112
+        "}"
113
+    }
114
+}

+ 20 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.btl

@@ -0,0 +1,20 @@
1
+package ${package.Mapper};
2
+
3
+import ${package.Entity}.${entity};
4
+import ${superMapperClassPackage};
5
+
6
+/**
7
+ * <p>
8
+ * ${table.comment!} Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author ${author}
12
+ * @since ${date}
13
+ */
14
+<% if(kotlin){ %>
15
+interface ${table.mapperName} : ${superMapperClass}<${entity}>
16
+<% }else{ %>
17
+public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
18
+
19
+}
20
+<% } %>

+ 19 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.ftl

@@ -0,0 +1,19 @@
1
+package ${package.Mapper};
2
+
3
+import ${package.Entity}.${entity};
4
+import ${superMapperClassPackage};
5
+
6
+/**
7
+ * <p>
8
+ * ${table.comment!} Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author ${author}
12
+ */
13
+<#if kotlin>
14
+interface ${table.mapperName} : ${superMapperClass}<${entity}>
15
+<#else>
16
+public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
17
+
18
+}
19
+</#if>

+ 20 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.java.vm

@@ -0,0 +1,20 @@
1
+package ${package.Mapper};
2
+
3
+import ${package.Entity}.${entity};
4
+import ${superMapperClassPackage};
5
+
6
+/**
7
+ * <p>
8
+ * $!{table.comment} Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author ${author}
12
+ * @since ${date}
13
+ */
14
+#if(${kotlin})
15
+interface ${table.mapperName} : ${superMapperClass}<${entity}>
16
+#else
17
+public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
18
+
19
+}
20
+#end

+ 41 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.btl

@@ -0,0 +1,41 @@
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="${package.Mapper}.${table.mapperName}">
4
+
5
+<% if(enableCache){ %>
6
+    <!-- 开启二级缓存 -->
7
+    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
8
+
9
+<% } %>
10
+<% if(baseResultMap){ %>
11
+    <!-- 通用查询映射结果 -->
12
+    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
13
+<% for(field in table.fields){ %>
14
+   <% /** 生成主键排在第一位 **/ %>
15
+   <% if(field.keyFlag){ %>
16
+        <id column="${field.name}" property="${field.propertyName}" />
17
+   <% } %>
18
+<% } %>
19
+<% for(field in table.commonFields){ %>
20
+    <% /** 生成公共字段 **/ %>
21
+    <result column="${field.name}" property="${field.propertyName}" />
22
+<% } %>
23
+<% for(field in table.fields){ %>
24
+   <% /** 生成普通字段 **/ %>
25
+   <% if(!field.keyFlag){ %>
26
+        <result column="${field.name}" property="${field.propertyName}" />
27
+   <% } %>
28
+<% } %>
29
+    </resultMap>
30
+<% } %>
31
+<% if(baseColumnList){ %>
32
+    <!-- 通用查询结果列 -->
33
+    <sql id="Base_Column_List">
34
+<% for(field in table.commonFields){ %>
35
+        ${field.name},
36
+<% } %>
37
+        ${table.fieldNames}
38
+    </sql>
39
+
40
+<% } %>
41
+</mapper>

+ 39 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.ftl

@@ -0,0 +1,39 @@
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="${package.Mapper}.${table.mapperName}">
4
+
5
+<#if enableCache>
6
+    <!-- 开启二级缓存 -->
7
+    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
8
+
9
+</#if>
10
+<#if baseResultMap>
11
+    <!-- 通用查询映射结果 -->
12
+    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
13
+<#list table.fields as field>
14
+<#if field.keyFlag><#--生成主键排在第一位-->
15
+        <id column="${field.name}" property="${field.propertyName}" />
16
+</#if>
17
+</#list>
18
+<#list table.commonFields as field><#--生成公共字段 -->
19
+    <result column="${field.name}" property="${field.propertyName}" />
20
+</#list>
21
+<#list table.fields as field>
22
+<#if !field.keyFlag><#--生成普通字段 -->
23
+        <result column="${field.name}" property="${field.propertyName}" />
24
+</#if>
25
+</#list>
26
+    </resultMap>
27
+
28
+</#if>
29
+<#if baseColumnList>
30
+    <!-- 通用查询结果列 -->
31
+    <sql id="Base_Column_List">
32
+<#list table.commonFields as field>
33
+        ${field.name},
34
+</#list>
35
+        ${table.fieldNames}
36
+    </sql>
37
+
38
+</#if>
39
+</mapper>

+ 39 - 0
xuecheng-plus-generator/src/main/resources/templates/default/mapper.xml.vm

@@ -0,0 +1,39 @@
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="${package.Mapper}.${table.mapperName}">
4
+
5
+#if(${enableCache})
6
+    <!-- 开启二级缓存 -->
7
+    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
8
+
9
+#end
10
+#if(${baseResultMap})
11
+    <!-- 通用查询映射结果 -->
12
+    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
13
+#foreach($field in ${table.fields})
14
+#if(${field.keyFlag})##生成主键排在第一位
15
+        <id column="${field.name}" property="${field.propertyName}" />
16
+#end
17
+#end
18
+#foreach($field in ${table.commonFields})##生成公共字段
19
+    <result column="${field.name}" property="${field.propertyName}" />
20
+#end
21
+#foreach($field in ${table.fields})
22
+#if(!${field.keyFlag})##生成普通字段
23
+        <result column="${field.name}" property="${field.propertyName}" />
24
+#end
25
+#end
26
+    </resultMap>
27
+
28
+#end
29
+#if(${baseColumnList})
30
+    <!-- 通用查询结果列 -->
31
+    <sql id="Base_Column_List">
32
+#foreach($field in ${table.commonFields})
33
+        ${field.name},
34
+#end
35
+        ${table.fieldNames}
36
+    </sql>
37
+
38
+#end
39
+</mapper>

+ 19 - 0
xuecheng-plus-generator/src/main/resources/templates/default/service.java.btl

@@ -0,0 +1,19 @@
1
+package ${package.Service};
2
+
3
+import ${package.Entity}.${entity};
4
+import ${superServiceClassPackage};
5
+
6
+/**
7
+ * <p>
8
+ * ${table.comment!} 服务类
9
+ * </p>
10
+ *
11
+ * @author ${author}
12
+ */
13
+<% if(kotlin){ %>
14
+interface ${table.serviceName} : ${superServiceClass}<${entity}>
15
+<% }else{ %>
16
+public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
17
+
18
+}
19
+<% } %>

+ 0 - 0
xuecheng-plus-generator/src/main/resources/templates/default/service.java.ftl


Some files were not shown because too many files changed in this diff