添加chapter和lesson

This commit is contained in:
CakeCN
2025-08-29 21:41:20 +08:00
parent 5c0187bc4b
commit f9d8b3d092
19 changed files with 736 additions and 53 deletions

View File

@@ -0,0 +1,10 @@
from flask import current_app
def upload_file(rb_file, file_name):
cos_client = current_app.extensions["cos_client"]
cos_client.put_object(
Bucket=current_app.config["TENCENT_COS"]["bucket"],
Body=rb_file,
Key=file_name,
)
return f"https://{current_app.config['TENCENT_COS']['bucket']}.cos.{current_app.config['TENCENT_COS']['region']}.myqcloud.com/{file_name}"