初始化 知识库
commit
9fa3cc16a4
|
@ -0,0 +1,47 @@
|
|||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
logs/
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
|
@ -0,0 +1,25 @@
|
|||
<?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>
|
||||
<parent>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-knowledge</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<version>3.6.6</version>
|
||||
<artifactId>health-knowledge-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-core</artifactId>
|
||||
<version>3.6.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
<?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>
|
||||
<parent>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-knowledge</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<version>3.6.3</version>
|
||||
<artifactId>health-knowledge-remote</artifactId>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>dragon-public</id>
|
||||
<name>dragon-maven</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>dragon-release</id>
|
||||
<name>dragon-releases</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>base-system-common</artifactId>
|
||||
<version>3.6.6</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,25 @@
|
|||
package com.health.knowledge.remote;
|
||||
|
||||
import com.health.knowledge.remote.factory.RemoteKnowledgeFallbackFactory;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
@FeignClient(contextId = "remoteKnowledgeService", value = "health-knowledge", fallbackFactory = RemoteKnowledgeFallbackFactory.class)
|
||||
public interface RemoteKnowledgeService {
|
||||
// /**
|
||||
// * 通过用户名查询用户信息
|
||||
// *
|
||||
// * @param username 用户名
|
||||
// * @param source 请求来源
|
||||
// * @return 结果
|
||||
// */
|
||||
// @GetMapping("/user/info/{username}")
|
||||
// public Result<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.health.knowledge.remote;
|
||||
|
||||
import com.health.common.core.constant.SecurityConstants;
|
||||
import com.health.common.core.constant.ServiceNameConstants;
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.knowledge.remote.factory.RemoteLogFallbackFactory;
|
||||
import com.health.system.common.domain.SysLogininfor;
|
||||
import com.health.system.common.domain.SysOperLog;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
/**
|
||||
* 日志服务
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
@FeignClient(contextId = "remoteLogService", value = "health-knowledge", fallbackFactory = RemoteLogFallbackFactory.class)
|
||||
public interface RemoteLogService {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.health.knowledge.remote.factory;
|
||||
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.knowledge.remote.RemoteKnowledgeService;
|
||||
import com.health.system.common.domain.SysUser;
|
||||
import com.health.system.common.domain.User;
|
||||
import com.health.system.common.domain.model.LoginUser;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
@Component
|
||||
public class RemoteKnowledgeFallbackFactory implements FallbackFactory<RemoteKnowledgeService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteKnowledgeFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteKnowledgeService create(Throwable throwable) {
|
||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteKnowledgeService() {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.health.knowledge.remote.factory;
|
||||
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.knowledge.remote.RemoteLogService;
|
||||
import com.health.system.common.domain.SysLogininfor;
|
||||
import com.health.system.common.domain.SysOperLog;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 日志服务降级处理
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
@Component
|
||||
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteLogService create(Throwable throwable) {
|
||||
log.error("日志服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteLogService() {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
<?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>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-knowledge</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>health-knowledge-server</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>dragon-public</id>
|
||||
<name>dragon-maven</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>dragon-release</id>
|
||||
<name>dragon-releases</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>base-file-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>base-file-remote</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>base-system-common</artifactId>
|
||||
<version>3.6.6</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-log</artifactId>
|
||||
</dependency>
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-core</artifactId>
|
||||
<version>3.6.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.health.knowledge.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author 冯凯
|
||||
* @version 1.0
|
||||
* @description: 知识库启动类
|
||||
* @date 2023/10/25 15:35
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class HealthKnowledgeApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HealthKnowledgeApplication.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
|
@ -0,0 +1,28 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 10009
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: health-knowledge
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.100.1.5:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.100.1.5:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/health-system" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.health" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bwie.mapper.UserMapper">
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,36 @@
|
|||
<?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>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>3.6.3</version>
|
||||
<artifactId>health-knowledge</artifactId>
|
||||
<modules>
|
||||
<module>health-knowledge-common</module>
|
||||
<module>health-knowledge-remote</module>
|
||||
<module>health-knowledge-server</module>
|
||||
</modules>
|
||||
|
||||
<description>健康知识库模块knowledge</description>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>dragon-public</id>
|
||||
<name>dragon-maven</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>dragon-release</id>
|
||||
<name>dragon-releases</name>
|
||||
<url>http://10.100.1.7:8081/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue