Compare commits
2 Commits
bbe5b6ccab
...
e132958d1b
| Author | SHA1 | Date | |
|---|---|---|---|
| e132958d1b | |||
| 51eea73f98 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,3 +35,4 @@ build/
|
|||||||
|
|
||||||
### Mac OS ###
|
### Mac OS ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/knowledge-base-server-log/
|
||||||
|
|||||||
85
config/mysql/init.txt
Normal file
85
config/mysql/init.txt
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
CREATE DATABASE IF NOT EXISTS kbase DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
USE kbase;
|
||||||
|
|
||||||
|
|
||||||
|
-- 1. 用户基础表
|
||||||
|
CREATE TABLE IF NOT EXISTS user (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '用户ID,主键',
|
||||||
|
username VARCHAR(64) NOT NULL UNIQUE COMMENT '登录用户名,唯一',
|
||||||
|
password VARCHAR(128) NOT NULL COMMENT '用户密码(建议加密存储)',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||||
|
) COMMENT='用户基础表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 2. 角色表
|
||||||
|
CREATE TABLE IF NOT EXISTS role (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '角色ID',
|
||||||
|
role_code VARCHAR(64) NOT NULL UNIQUE COMMENT '角色编码(如 admin/user/guest)',
|
||||||
|
role_name VARCHAR(64) NOT NULL COMMENT '角色名称',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||||
|
) COMMENT='系统角色表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 3. 用户-角色关联表
|
||||||
|
CREATE TABLE IF NOT EXISTS user_role (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',
|
||||||
|
user_id BIGINT NOT NULL COMMENT '用户ID',
|
||||||
|
role_id BIGINT NOT NULL COMMENT '角色ID',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
INDEX idx_user_id(user_id),
|
||||||
|
INDEX idx_role_id(role_id)
|
||||||
|
) COMMENT='用户与角色关联表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 4. 文件表
|
||||||
|
CREATE TABLE IF NOT EXISTS file (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '文件ID',
|
||||||
|
file_name VARCHAR(255) NOT NULL COMMENT '文件名或路径',
|
||||||
|
file_path VARCHAR(512) NOT NULL COMMENT '存储路径',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||||
|
) COMMENT='知识库文件表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 5. 角色-文件可见规则表(适合批量规则分配权限)
|
||||||
|
CREATE TABLE IF NOT EXISTS role_file_rule (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',
|
||||||
|
role_id BIGINT NOT NULL COMMENT '角色ID',
|
||||||
|
file_pattern VARCHAR(255) NOT NULL COMMENT '可访问文件名/路径模式(如前缀、正则)',
|
||||||
|
remark VARCHAR(255) COMMENT '规则说明',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
INDEX idx_role_id(role_id)
|
||||||
|
) COMMENT='角色-文件可访问规则表';
|
||||||
|
|
||||||
|
-- 6. 用户token表
|
||||||
|
CREATE TABLE IF NOT EXISTS user_token (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键,自增',
|
||||||
|
user_id BIGINT NOT NULL COMMENT '用户ID,业务逻辑关联user表',
|
||||||
|
token VARCHAR(128) NOT NULL UNIQUE COMMENT '用户登录token',
|
||||||
|
login_at BIGINT NOT NULL COMMENT '登录时间(毫秒时间戳)',
|
||||||
|
expired_at BIGINT NOT NULL COMMENT '过期时间(毫秒时间戳)',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
INDEX idx_user_id(user_id),
|
||||||
|
INDEX idx_token(token)
|
||||||
|
) COMMENT='用户登录Token表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 7. 用户-文件直接授权关联表
|
||||||
|
CREATE TABLE IF NOT EXISTS user_file (
|
||||||
|
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',
|
||||||
|
user_id BIGINT NOT NULL COMMENT '用户ID',
|
||||||
|
file_id BIGINT NOT NULL COMMENT '文件ID',
|
||||||
|
add_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
|
||||||
|
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
INDEX idx_user_id(user_id),
|
||||||
|
INDEX idx_file_id(file_id),
|
||||||
|
UNIQUE INDEX uniq_user_file(user_id, file_id)
|
||||||
|
) COMMENT='用户-文件直接授权关联表(用于特殊文件个别授权)';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6
pom.xml
6
pom.xml
@ -4,9 +4,9 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>luke.micro.saas</groupId>
|
<groupId>luke.micro.saas</groupId>
|
||||||
<artifactId>doc-parser-server</artifactId>
|
<artifactId>knowledge-base-server</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<name>doc-parser-server</name>
|
<name>knowledge-base-server</name>
|
||||||
<description>文档资源解析服务</description>
|
<description>文档资源解析服务</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -329,7 +329,7 @@
|
|||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>${spring-boot.version}</version>
|
<version>${spring-boot.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<mainClass>com.doc.parser.DocParserApplication</mainClass>
|
<mainClass>com.knowledge.base.KnowledgeBaseApplication</mainClass>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser;
|
package com.knowledge.base;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@ -9,10 +9,10 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
*/
|
*/
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class DocParserApplication {
|
public class KnowledgeBaseApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(DocParserApplication.class, args);
|
SpringApplication.run(KnowledgeBaseApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.anno;
|
package com.knowledge.base.application.anno;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.aspect;
|
package com.knowledge.base.application.aspect;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
@ -21,7 +21,7 @@ import java.lang.reflect.Method;
|
|||||||
public class OperationLogAspect {
|
public class OperationLogAspect {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(OperationLogAspect.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(OperationLogAspect.class);
|
||||||
|
|
||||||
@Around("@annotation(com.doc.parser.application.anno.OperationLog)")
|
@Around("@annotation(com.knowledge.base.application.anno.OperationLog)")
|
||||||
public Object logOperation(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object logOperation(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
Method method = signature.getMethod();
|
Method method = signature.getMethod();
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.enums;
|
package com.knowledge.base.application.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: luke ye
|
* @Author: luke ye
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.enums;
|
package com.knowledge.base.application.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.enums;
|
package com.knowledge.base.application.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.exceptions;
|
package com.knowledge.base.application.exceptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.doc.parser.application.filter;
|
package com.knowledge.base.application.filter;
|
||||||
|
|
||||||
import com.doc.parser.infrastructure.north.controller.UserController;
|
import com.knowledge.base.infrastructure.north.controller.UserController;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.servlet.*;
|
import javax.servlet.*;
|
||||||
@ -1,9 +1,9 @@
|
|||||||
package com.doc.parser.application.filter;
|
package com.knowledge.base.application.filter;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.doc.parser.application.enums.MDCKeyEnum;
|
import com.knowledge.base.application.enums.MDCKeyEnum;
|
||||||
import com.doc.parser.infrastructure.config.DynamicConfig;
|
import com.knowledge.base.infrastructure.config.DynamicConfig;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.application.filter;
|
package com.knowledge.base.application.filter;
|
||||||
import javax.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import javax.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
import javax.servlet.FilterConfig;
|
import javax.servlet.FilterConfig;
|
||||||
@ -8,7 +8,7 @@ import javax.servlet.ServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.doc.parser.application.enums.MDCKeyEnum;
|
import com.knowledge.base.application.enums.MDCKeyEnum;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.ThreadContext;
|
import org.apache.logging.log4j.ThreadContext;
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.domain.enums;
|
package com.knowledge.base.domain.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,4 +1,6 @@
|
|||||||
package com.doc.parser.domain.iface;
|
package com.knowledge.base.domain.iface;
|
||||||
|
|
||||||
|
import com.knowledge.base.domain.enums.DocTypeEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -8,7 +10,7 @@ public interface DocumentImporter {
|
|||||||
void importDocuments() throws Exception;
|
void importDocuments() throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link com.doc.parser.domain.enums.DocTypeEnum}
|
* {@link DocTypeEnum}
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getType();
|
String getType();
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.doc.parser.domain.impl;
|
package com.knowledge.base.domain.impl;
|
||||||
|
|
||||||
import com.doc.parser.domain.iface.DocumentImporter;
|
import com.knowledge.base.domain.iface.DocumentImporter;
|
||||||
import com.doc.parser.infrastructure.util.LocalCacheUtil;
|
import com.knowledge.base.infrastructure.util.LocalCacheUtil;
|
||||||
import org.elasticsearch.action.delete.DeleteRequest;
|
import org.elasticsearch.action.delete.DeleteRequest;
|
||||||
import org.elasticsearch.action.get.GetRequest;
|
import org.elasticsearch.action.get.GetRequest;
|
||||||
import org.elasticsearch.action.get.GetResponse;
|
import org.elasticsearch.action.get.GetResponse;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.domain.impl;
|
package com.knowledge.base.domain.impl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,22 +1,12 @@
|
|||||||
package com.doc.parser.domain.impl;
|
package com.knowledge.base.domain.impl;
|
||||||
|
|
||||||
import com.doc.parser.domain.enums.DocTypeEnum;
|
import com.knowledge.base.domain.enums.DocTypeEnum;
|
||||||
import com.doc.parser.domain.iface.DocumentImporter;
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
|
||||||
import org.elasticsearch.action.index.IndexRequest;
|
|
||||||
import org.elasticsearch.client.RequestOptions;
|
|
||||||
import org.elasticsearch.client.RestHighLevelClient;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,22 +1,14 @@
|
|||||||
package com.doc.parser.domain.impl;
|
package com.knowledge.base.domain.impl;
|
||||||
|
|
||||||
import com.doc.parser.domain.enums.DocTypeEnum;
|
import com.knowledge.base.domain.enums.DocTypeEnum;
|
||||||
import com.doc.parser.domain.iface.DocumentImporter;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import org.apache.pdfbox.text.PDFTextStripper;
|
import org.apache.pdfbox.text.PDFTextStripper;
|
||||||
import org.elasticsearch.action.index.IndexRequest;
|
|
||||||
import org.elasticsearch.client.RequestOptions;
|
|
||||||
import org.elasticsearch.client.RestHighLevelClient;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.doc.parser.domain.impl;
|
package com.knowledge.base.domain.impl;
|
||||||
|
|
||||||
import com.doc.parser.domain.enums.DocTypeEnum;
|
import com.knowledge.base.domain.enums.DocTypeEnum;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.doc.parser.domain.schedule;
|
package com.knowledge.base.domain.schedule;
|
||||||
|
|
||||||
import com.doc.parser.domain.iface.DocumentImporter;
|
import com.knowledge.base.domain.iface.DocumentImporter;
|
||||||
import com.doc.parser.infrastructure.config.DynamicConfig;
|
import com.knowledge.base.infrastructure.config.DynamicConfig;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.config;
|
package com.knowledge.base.infrastructure.config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luke.ye
|
* @author Luke.ye
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.config;
|
package com.knowledge.base.infrastructure.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.config;
|
package com.knowledge.base.infrastructure.config;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.config;
|
package com.knowledge.base.infrastructure.config;
|
||||||
|
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
import org.elasticsearch.client.RestClient;
|
import org.elasticsearch.client.RestClient;
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.doc.parser.infrastructure.north.controller;
|
package com.knowledge.base.infrastructure.north.controller;
|
||||||
|
|
||||||
import com.doc.parser.domain.iface.DocumentImporter;
|
import com.knowledge.base.domain.iface.DocumentImporter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -1,9 +1,9 @@
|
|||||||
package com.doc.parser.infrastructure.north.controller;
|
package com.knowledge.base.infrastructure.north.controller;
|
||||||
|
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.doc.parser.infrastructure.north.dto.SearchReq;
|
import com.knowledge.base.infrastructure.north.dto.SearchReq;
|
||||||
import com.doc.parser.infrastructure.util.LocalCacheUtil;
|
import com.knowledge.base.infrastructure.util.LocalCacheUtil;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.elasticsearch.action.search.SearchRequest;
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
@ -14,7 +14,6 @@ import org.elasticsearch.index.query.QueryBuilder;
|
|||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
|
|
||||||
import org.elasticsearch.search.sort.SortOrder;
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -1,8 +1,8 @@
|
|||||||
package com.doc.parser.infrastructure.north.controller;
|
package com.knowledge.base.infrastructure.north.controller;
|
||||||
|
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.doc.parser.infrastructure.config.ConstantConfig;
|
import com.knowledge.base.infrastructure.config.ConstantConfig;
|
||||||
import com.doc.parser.infrastructure.config.DynamicConfig;
|
import com.knowledge.base.infrastructure.config.DynamicConfig;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.doc.parser.infrastructure.north.dto;
|
package com.knowledge.base.infrastructure.north.dto;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.doc.parser.application.enums.ErrorCodeEnum;
|
import com.knowledge.base.application.enums.ErrorCodeEnum;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.north.dto;
|
package com.knowledge.base.infrastructure.north.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.doc.parser.infrastructure.util;
|
package com.knowledge.base.infrastructure.util;
|
||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
@ -2,8 +2,8 @@
|
|||||||
<Configuration status="INFO">
|
<Configuration status="INFO">
|
||||||
<!-- 使用相对路径指定日志目录 -->
|
<!-- 使用相对路径指定日志目录 -->
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="logDir">doc-parser-server-log</Property>
|
<Property name="logDir">knowledge-base-server-log</Property>
|
||||||
<Property name="appName">doc-parser-server</Property>
|
<Property name="appName">knowledge-base-server</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
<!-- 文件日志输出(滚动策略)-->
|
<!-- 文件日志输出(滚动策略)-->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user