From 549c07210703ef77bb799ef7ca8c586cf6e4e530 Mon Sep 17 00:00:00 2001 From: lan Date: Fri, 23 Dec 2022 12:07:46 +0800 Subject: [PATCH] update:some change --- readme.md | 4 ++++ readme_en.md | 5 +++++ storage.py | 24 ++++++++++++++++++++++++ templates/index.html | 4 ++++ 4 files changed, 37 insertions(+) diff --git a/readme.md b/readme.md index 1eae890..a741409 100644 --- a/readme.md +++ b/readme.md @@ -172,6 +172,10 @@ STORAGE_ENGINE=filesystem ![Alt](https://repobeats.axiom.co/api/embed/7a6c92f1d96ee57e6fb67f0df371528397b0c9ac.svg "Repobeats analytics image") +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=vastsa/FileCodeBox&type=Date)](https://star-history.com/#vastsa/FileCodeBox&Date) + ## 赞赏 diff --git a/readme_en.md b/readme_en.md index 540e1f4..db398d2 100644 --- a/readme_en.md +++ b/readme_en.md @@ -35,6 +35,7 @@ docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --n ```bash docker run -d --restart=always -p 12345:12345 -v /Users/lan/soft/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:arm ``` + ### Update ```bash @@ -177,6 +178,10 @@ STORAGE_ENGINE=filesystem ![Alt](https://repobeats.axiom.co/api/embed/7a6c92f1d96ee57e6fb67f0df371528397b0c9ac.svg "Repobeats analytics image") +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=vastsa/FileCodeBox&type=Date)](https://star-history.com/#vastsa/FileCodeBox&Date) + ## Appreciate
diff --git a/storage.py b/storage.py index 40b4cdc..1d22a3f 100644 --- a/storage.py +++ b/storage.py @@ -9,6 +9,30 @@ from fastapi import UploadFile import settings +class TencentCOS: + def __init__(self, bucket: str, region: str, secret_id: str, secret_key: str): + self.bucket = bucket + self.region = region + self.secret_id = secret_id + self.secret_key = secret_key + + def upload(self, file: UploadFile, path: str) -> str: + # 上传文件 + pass + + def download(self, path: str) -> BinaryIO: + # 下载文件 + pass + + def delete(self, path: str) -> None: + # 删除文件 + pass + + def get_url(self, path: str) -> str: + # 获取文件访问链接 + pass + + class FileSystemStorage: DATA_ROOT = Path(settings.DATA_ROOT) STATIC_URL = settings.STATIC_URL diff --git a/templates/index.html b/templates/index.html index 776bd96..b39ae8f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -37,6 +37,10 @@ border-radius: 20px; } + .el-card { + border-radius: 20px; + } + @media (prefers-color-scheme: dark) { body {