Browse Source

知识库——立项

hyq 1 year ago
parent
commit
eb6bd37981
19 changed files with 810 additions and 0 deletions
  1. 13 0
      cx-knowledge-base/.gitignore
  2. 68 0
      cx-knowledge-base/cx-knowledge-base-common/pom.xml
  3. 30 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/config/FeignConfiguration.java
  4. 15 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/feign/RwAdminFeginImpl.java
  5. 32 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/feign/RwAdminFeign.java
  6. 54 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/CommonUtils.java
  7. 124 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/DateUtils.java
  8. 28 0
      cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/ExceptionUtils.java
  9. 33 0
      cx-knowledge-base/cx-knowledge-base-entity/pom.xml
  10. 15 0
      cx-knowledge-base/cx-knowledge-base-entity/src/main/java/com/rongwei/bsentity/dto/IdGeneralDTO.java
  11. 11 0
      cx-knowledge-base/cx-knowledge-base-entity/src/main/java/com/rongwei/bsentity/enums/BoolEnum.java
  12. 87 0
      cx-knowledge-base/cx-knowledge-base-server/pom.xml
  13. 21 0
      cx-knowledge-base/cx-knowledge-base-server/src/main/java/com/rongwei/KnowledgeBaseServerApplication.java
  14. 13 0
      cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap-dev.yml
  15. 10 0
      cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap-pro.yml
  16. 54 0
      cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap.yml
  17. 36 0
      cx-knowledge-base/cx-knowledge-base-server/src/main/resources/logback-spring.xml
  18. 165 0
      cx-knowledge-base/pom.xml
  19. 1 0
      pom.xml

+ 13 - 0
cx-knowledge-base/.gitignore

@@ -0,0 +1,13 @@
+# Created by .ignore support plugin (hsz.mobi)
+.idea/.name
+.idea/compiler.xml
+.idea/encodings.xml
+.idea/libraries/
+.idea/misc.xml
+.idea/modules.xml
+.idea/vcs.xml
+cx-equipment-common/business-common.iml
+cx-equipment-entity/business-entity.iml
+cx-equipment-server/business-server.iml
+cx-equipment-server/src/test/
+rw-business.iml

+ 68 - 0
cx-knowledge-base/cx-knowledge-base-common/pom.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cx-knowledge-base</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cx-knowledge-base-common</artifactId>
+
+    <properties>
+        <mysql.version>8.0.11</mysql.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>cx-knowledge-base-entity</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+            <version>2.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>5.0.0</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>5.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.3.2</version>
+        </dependency>
+
+    </dependencies>
+</project>

+ 30 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/config/FeignConfiguration.java

@@ -0,0 +1,30 @@
+package com.rongwei.bscommon.sys.config;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+/**
+ * @author shangmi
+ * @title FeignConfigration
+ * @date 2023/12/6 11:54
+ * @description feign配置文件
+ */
+@Configuration
+public class FeignConfiguration implements RequestInterceptor {
+    private final static Logger log = LoggerFactory.getLogger(FeignConfiguration.class);
+    @Override
+    public void apply(RequestTemplate requestTemplate) {
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if(null == attributes){
+            return;
+        }
+        String authorization = attributes.getRequest().getHeader("Authorization");
+        log.info("Authorization:{}",authorization);
+        requestTemplate.header("Authorization",authorization);
+    }
+}

+ 15 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/feign/RwAdminFeginImpl.java

@@ -0,0 +1,15 @@
+package com.rongwei.bscommon.sys.feign;
+
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RwAdminFeginImpl implements RwAdminFeign {
+
+
+    @Override
+    public R getSerialNumberCode(SysSerialVo sysSerialVo) {
+        return R.error("admin服务异常");
+    }
+}

+ 32 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/feign/RwAdminFeign.java

@@ -0,0 +1,32 @@
+package com.rongwei.bscommon.sys.feign;
+
+import com.rongwei.bscommon.sys.config.FeignConfiguration;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @author shangmi
+ * @title RwAdminFeign
+ * @date 2023/12/6 11:38
+ * @description rw-admin api接口
+ */
+@FeignClient(value = "rw-admin",configuration = FeignConfiguration.class,fallback = RwAdminFeginImpl.class,contextId = "equ-admin")
+public interface RwAdminFeign {
+
+
+    /**
+     * 获得编号
+     *
+     * @param sysSerialVo
+     * @return {@link R}
+     * @date 2024/1/3 13:22
+     * @author shangmi
+     *
+     */
+
+    @PostMapping("/sys/generalCRUD/getSerialNumberCode")
+    R getSerialNumberCode(@RequestBody SysSerialVo sysSerialVo);
+}

+ 54 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/CommonUtils.java

@@ -0,0 +1,54 @@
+package com.rongwei.bscommon.sys.utils;
+
+import com.rongwei.commonservice.serial.service.SysSerialNumberService;
+import com.rongwei.commonservice.service.RedisService;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
+
+
+@Component
+public class CommonUtils {
+
+    @Autowired
+    private RedisService autoRedisService;
+    @Autowired
+    private SysSerialNumberService autoSysSerialNumberService;
+
+    private static RedisService redisService;
+    private static SysSerialNumberService sysSerialNumberService;
+
+    @PostConstruct
+    public void init() {
+        redisService = autoRedisService;
+        sysSerialNumberService = autoSysSerialNumberService;
+    }
+
+
+    /**
+     * 获取当前的登陆人信息
+     *
+     * @return
+     */
+    public static SysUserVo getCurrentUser() {
+        // 获取当前登录人信息
+        SysUserVo currUser = null;
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (attributes != null) {
+            HttpServletRequest request = attributes.getRequest();
+            if (request != null) {
+                String token = request.getHeader("token");
+                if (com.rongwei.rwcommon.utils.StringUtils.isNotEmpty(token)) {
+                    currUser = redisService.getLoginUser(token);
+                }
+            }
+        }
+        return currUser;
+    }
+
+}

+ 124 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/DateUtils.java

@@ -0,0 +1,124 @@
+package com.rongwei.bscommon.sys.utils;
+
+import com.rongwei.commonservice.serial.service.SysSerialNumberService;
+import com.rongwei.commonservice.service.RedisService;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import org.apache.commons.lang.StringUtils;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Utils class
+ * 工具类
+ *
+ * @author XH
+ * @date 2021/05/27
+ */
+@Component
+public class DateUtils {
+
+    @Autowired
+    private RedisService autoRedisService;
+    @Autowired
+    private SysSerialNumberService autoSysSerialNumberService;
+
+    private static RedisService redisService;
+    private static SysSerialNumberService sysSerialNumberService;
+
+
+    /**
+     * 时间格式
+     */
+    public static class DatePattern {
+        public static final String DATE_PATTERN_YMD_HOUR = "yyyy/MM/dd HH";
+    }
+
+    private static final Logger log = LoggerFactory.getLogger(DateUtils.class.getName());
+    private static final Pattern STR_IS_DATE_LAYOUT_PATTERN = Pattern.compile("^(?:(?!0000)[0-9]{4}([-/.年]?)(?:(?:0?[1-9]|1[0-2])([-/.月]?)(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])([-/.月]?)(?:29|30)([日]?)|(?:0?[13578]|1[02])([-/.月]?)31)([日]?)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.月]?)0?2([-/.月]?)29([日]?))$");
+    /**
+     * excel 导入时间格式类型
+     */
+    private static final List<String> IMPORT_EXCEL_DATE_FORMAT_TYPE = new ArrayList<String>() {{
+        add(DatePattern.DATE_PATTERN_YMD_HOUR);
+    }};
+
+    /**
+     * 获取当前的登陆人信息
+     *
+     * @return
+     */
+    public static SysUserVo getCurrentUser() {
+        // 获取当前登录人信息
+        SysUserVo currUser = null;
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (attributes != null) {
+            HttpServletRequest request = attributes.getRequest();
+            if (request != null) {
+                String token = request.getHeader("token");
+                if (com.rongwei.rwcommon.utils.StringUtils.isNotEmpty(token)) {
+                    currUser = redisService.getLoginUser(token);
+                }
+            }
+        }
+        return currUser;
+    }
+
+
+    /**
+     * 校验字符串是否为 日期格式
+     *
+     * @param str
+     * @return
+     */
+    public static boolean strIsDateLayout(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        Matcher matcher = STR_IS_DATE_LAYOUT_PATTERN.matcher(str);
+        if (matcher.matches()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public static Date importExcelFormatExcel(XSSFCell objValue) {
+        if (objValue == null) {
+            return null;
+        }
+        if (StringUtils.isBlank(objValue.toString())) {
+            return null;
+        }
+        try {
+            return objValue.getDateCellValue();
+        } catch (Exception e) {
+            log.debug("当前单元格不是时间格式");
+        }
+        AtomicReference<Date> date = new AtomicReference<>();
+        IMPORT_EXCEL_DATE_FORMAT_TYPE.forEach(format -> {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, Locale.ENGLISH);
+            try {
+                date.set(simpleDateFormat.parse(objValue.toString()));
+            } catch (ParseException e) {
+                log.error("excel解析时 时间格式化出现异常!时间格式:{},日期:{}", format, objValue);
+            }
+        });
+        return date.get();
+    }
+}

+ 28 - 0
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/utils/ExceptionUtils.java

@@ -0,0 +1,28 @@
+package com.rongwei.bscommon.sys.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+/**
+ * @author zhou
+ */
+public class ExceptionUtils {
+
+    private static final Logger logger = LoggerFactory.getLogger(ExceptionUtils.class);
+
+    /**
+     * 打印完整异常通用方法
+     * @param des
+     * @return
+     */
+    public static void printExceptionDetail(Exception e,String des) {
+        e.printStackTrace();
+        ByteArrayOutputStream errorDetail = new ByteArrayOutputStream();
+        e.printStackTrace(new PrintStream(errorDetail));
+        String exception = errorDetail.toString();
+        logger.error(des + exception);
+    }
+}

+ 33 - 0
cx-knowledge-base/cx-knowledge-base-entity/pom.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cx-knowledge-base</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cx-knowledge-base-entity</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>rw-common-config</artifactId>
+            <version>1.1-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.rongwei</groupId>
+                    <artifactId>rw-common-license</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>rw-common-utils</artifactId>
+            <version>1.1-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

+ 15 - 0
cx-knowledge-base/cx-knowledge-base-entity/src/main/java/com/rongwei/bsentity/dto/IdGeneralDTO.java

@@ -0,0 +1,15 @@
+package com.rongwei.bsentity.dto;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class IdGeneralDTO implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private String id;
+
+}

+ 11 - 0
cx-knowledge-base/cx-knowledge-base-entity/src/main/java/com/rongwei/bsentity/enums/BoolEnum.java

@@ -0,0 +1,11 @@
+package com.rongwei.bsentity.enums;
+
+/**
+ * @author shangmi
+ * @title BoolEnum
+ * @date 2023/11/24 15:35
+ * @description 布尔值枚举
+ */
+public enum BoolEnum {
+    FALSE, TRUE
+}

+ 87 - 0
cx-knowledge-base/cx-knowledge-base-server/pom.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cx-knowledge-base</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cx-knowledge-base-server</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>cx-knowledge-base-common</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- Spring Cloud Begin -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.nacos</groupId>
+            <artifactId>nacos-client</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+
+        <!-- druid -->
+        <dependency>
+            <groupId>com.github.drtrang</groupId>
+            <artifactId>druid-spring-boot2-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 21 - 0
cx-knowledge-base/cx-knowledge-base-server/src/main/java/com/rongwei/KnowledgeBaseServerApplication.java

@@ -0,0 +1,21 @@
+package com.rongwei;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.scheduling.annotation.EnableAsync;
+
+@EnableAsync
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients
+@MapperScan("com.rongwei.*.*.dao")
+public class KnowledgeBaseServerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(KnowledgeBaseServerApplication.class, args);
+    }
+
+}

+ 13 - 0
cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap-dev.yml

@@ -0,0 +1,13 @@
+spring:
+  cloud:
+    nacos:
+      config:
+        file-extension: yaml
+        server-addr: 127.0.0.1:8848
+        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        ext-config[0]:
+          data-id: common-config.yaml
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+

+ 10 - 0
cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap-pro.yml

@@ -0,0 +1,10 @@
+spring:
+  cloud:
+    nacos:
+      config:
+        file-extension: yaml
+        server-addr: 127.0.0.1:8848
+        namespace: 75f91d9a-0dd2-4dd9-98f6-61a221d396f1
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: 75f91d9a-0dd2-4dd9-98f6-61a221d396f1

+ 54 - 0
cx-knowledge-base/cx-knowledge-base-server/src/main/resources/bootstrap.yml

@@ -0,0 +1,54 @@
+spring:
+  profiles:
+    active: dev
+  application:
+    name: rw-knowledge-base
+  jta:
+    atomikos:
+      properties:
+        log-base-name: rw-knowledge-base-log
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 1000MB
+server:
+  port: 9689
+  tomcat:
+    basedir: temp
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+feign:
+  client:
+    config:
+      default:
+        connectTimeout: 5000
+        readTimeout: 5000
+  sentinel:
+    enabled: true
+jwt:
+  token-header: Authorization
+  expire: 14400
+  rsa-secret: xx1WET12^%3^(WE45
+client:
+  id: ace-auth
+  secret: 123456
+  token-header: x-client-token
+  expire: 14400
+  rsa-secret: x2318^^(*WRYQWR(QW&T
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
+    map-underscore-to-camel-case: false
+  #basepackage: com.rongwei.rwadmin.system.dao
+  xmlLocation: classpath:mybatis/**/*Dao.xml
+  mapperLocations: "classpath:mybatis/**/*Dao.xml"
+  typeAliasesPackage: com.rongwei.bsentity.domain
+  global-config:
+    db-config:
+      logic-delete-value: 1
+      logic-not-delete-value: 0
+      column-like: true

+ 36 - 0
cx-knowledge-base/cx-knowledge-base-server/src/main/resources/logback-spring.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration  scan="true" scanPeriod="60 seconds" debug="false">
+    <contextName>logback</contextName>
+    <!--输出到控制台-->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <!--按天生成日志-->
+    <appender name="logFile"  class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>
+                icequipmentlog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
+            </FileNamePattern>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>
+                %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level -%msg%n
+            </Pattern>
+        </layout>
+    </appender>
+
+    <logger name="com.bootdo" additivity="false">
+        <appender-ref ref="console"/>
+        <appender-ref ref="logFile" />
+    </logger>
+
+    <root level="error">
+        <appender-ref ref="console"/>
+        <appender-ref ref="logFile" />
+    </root>
+
+</configuration>

+ 165 - 0
cx-knowledge-base/pom.xml

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.rongwei</groupId>
+    <artifactId>cx-knowledge-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <modules>
+        <module>cx-knowledge-base-server</module>
+        <module>cx-knowledge-base-common</module>
+        <module>cx-knowledge-base-entity</module>
+    </modules>
+
+    <!--<parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.2.RELEASE</version>
+    </parent>-->
+
+    <parent>
+        <artifactId>safe-produce</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <!--<docker.image.prefix>ag</docker.image.prefix>-->
+        <!--<docker.plugin.version>0.4.13</docker.plugin.version>-->
+        <mapper.version>3.4.0</mapper.version>
+        <maven.compile.source>1.8</maven.compile.source>
+        <maven.compile.target>1.8</maven.compile.target>
+        <fastjson.version>1.2.31</fastjson.version>
+        <!--<boot.admin.client>2.1.2</boot.admin.client>-->
+    </properties>
+
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.14</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>oss</id>
+            <name>oss</name>
+            <url>https://oss.sonatype.org/content/groups/public</url>
+        </repository>
+        <repository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>https://repo.spring.io/libs-milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+        </repository>
+    </repositories>
+
+    <!--依赖管理,用于管理spring-cloud的依赖,其中Camden.SR3是版本号-->
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Greenwich.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>1.2.33</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+                <version>0.2.1.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <distributionManagement>
+        <snapshotRepository>
+            <id>ossrh</id>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+        </snapshotRepository>
+        <repository>
+            <id>ossrh</id>
+            <name>Maven Central Staging Repository</name>
+            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+        </repository>
+    </distributionManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>versions-maven-plugin</artifactId>
+                <version>2.7</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven-compiler-plugin.version}</version>
+                <configuration>
+                    <source>${maven.compile.source}</source>
+                    <target>${maven.compile.target}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <version>2.8.2</version>
+            </plugin>
+            <!--<plugin>-->
+            <!--<groupId>org.apache.maven.plugins</groupId>-->
+            <!--<artifactId>maven-javadoc-plugin</artifactId>-->
+            <!--<version>2.10.3</version>-->
+            <!--<executions>-->
+            <!--<execution>-->
+            <!--<id>attach-javadocs</id>-->
+            <!--<goals>-->
+            <!--<goal>jar</goal>-->
+            <!--</goals>-->
+            <!--</execution>-->
+            <!--</executions>-->
+            <!--</plugin>-->
+        </plugins>
+    </build>
+</project>

+ 1 - 0
pom.xml

@@ -14,6 +14,7 @@
         <module>cx-file</module>
         <module>bs-common</module>
         <module>cx-equipment</module>
+        <module>cx-knowledge-base</module>
     </modules>
 
     <parent>