fix: 解决md不允许上传的问题
This commit is contained in:
parent
b3cf9f98a7
commit
345fd05a2b
|
|
@ -20,7 +20,7 @@ class Settings(BaseSettings):
|
||||||
UPLOAD_FOLDER: Path = BASE_DIR / "storage" / "uploads"
|
UPLOAD_FOLDER: Path = BASE_DIR / "storage" / "uploads"
|
||||||
PROCESSED_FOLDER: Path = BASE_DIR / "storage" / "processed"
|
PROCESSED_FOLDER: Path = BASE_DIR / "storage" / "processed"
|
||||||
MAX_FILE_SIZE: int = 50 * 1024 * 1024 # 50MB
|
MAX_FILE_SIZE: int = 50 * 1024 * 1024 # 50MB
|
||||||
ALLOWED_EXTENSIONS: set = {"pdf", "docx", "doc"}
|
ALLOWED_EXTENSIONS: set = {"pdf", "docx", "doc", "md"}
|
||||||
|
|
||||||
# Celery
|
# Celery
|
||||||
CELERY_BROKER_URL: str = "redis://redis:6379/0"
|
CELERY_BROKER_URL: str = "redis://redis:6379/0"
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ from ..services.ollama_client import OllamaClient
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class DocumentService:
|
class DocumentService:
|
||||||
def __init__(self, ollama_client: OllamaClient):
|
def __init__(self):
|
||||||
self.ollama_client = ollama_client
|
pass
|
||||||
|
|
||||||
def process_document(self, input_path: str, output_path: str) -> bool:
|
def process_document(self, input_path: str, output_path: str) -> bool:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage:/app/storage
|
- ./storage:/app/storage
|
||||||
- ./legal_doc_masker.db:/app/legal_doc_masker.db
|
- ./legal_doc_masker.db:/app/legal_doc_masker.db
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||||
|
|
@ -20,6 +22,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage:/app/storage
|
- ./storage:/app/storage
|
||||||
- ./legal_doc_masker.db:/app/legal_doc_masker.db
|
- ./legal_doc_masker.db:/app/legal_doc_masker.db
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
- CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ const FileUpload: React.FC<FileUploadProps> = ({ onUploadComplete }) => {
|
||||||
'application/pdf': ['.pdf'],
|
'application/pdf': ['.pdf'],
|
||||||
'application/msword': ['.doc'],
|
'application/msword': ['.doc'],
|
||||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx'],
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx'],
|
||||||
|
'text/markdown': ['.md'],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue