Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
[![GitHub](https://img.shields.io/github/license/fastapi-practices/fastapi_best_architecture)](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE)
[![Static Badge](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)

> [!TIP]
> You are viewing the pydantic-v1 branch, which is locked and no longer provides updates and fixes

English | [简体中文](./README.zh-CN.md)

FastAPI framework based on the front-end and back-end separation of the middle and back-end solutions, follow
Expand Down Expand Up @@ -49,10 +52,6 @@ See a preview of some of the screenshots
- [x] Docker / Docker-compose deployment
- [x] Pytest Unit Testing

TODO:

1. [ ] Pydantic 2.0

## Built-in features

1. [x] User management: system user role management, permission assignment
Expand All @@ -67,14 +66,6 @@ TODO:
10. [x] Scheduled tasks: automated tasks, asynchronous tasks, and function invocation are supported
11. [x] Interface Documentation: Automatically generate online interactive API interface documentation.

TODO:

1. [ ] Dynamic Configuration: Dynamic configuration of the system environment (site title, logo, filing, footer...)
2. [ ] code generation: according to the table structure, visualize the generation of additions, deletions,
modifications and checks of the business code.
3. [ ] File Upload: Docking cloud OSS and local backup.
4. [ ] System Notification: proactively send timed task notifications, resource warnings, service anomaly warnings...

## Local development

* Python: 3.10+
Expand Down
14 changes: 3 additions & 11 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
[![GitHub](https://img.shields.io/github/license/fastapi-practices/fastapi_best_architecture)](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE)
[![Static Badge](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)

> [!TIP]
> 你正在查看 pydantic-v1 分支,此分支已被锁定,不再提供更新和修复

简体中文 | [English](./README.md)

基于 FastAPI 框架的前后端分离中后台解决方案,遵循[伪三层架构](#伪三层架构)设计, 支持 **python3.10** 及以上版本
Expand Down Expand Up @@ -44,10 +47,6 @@ mvc 架构作为常规设计模式,在 python web 中也很常见,但是三
- [x] Docker / Docker-compose 部署
- [x] Pytest 单元测试

TODO:

1. [ ] Pydantic 2.0

## 内置功能

1. [x] 用户管理:系统用户角色管理,权限分配
Expand All @@ -62,13 +61,6 @@ TODO:
10. [x] 定时任务:自动化任务,异步任务,支持函数调用
11. [x] 接口文档:自动生成在线交互式 API 接口文档

TODO:

1. [ ] 动态配置:对系统环境进行动态配置(网站标题,LOGO,备案,页脚...)
2. [ ] 代码生成:根据表结构,可视化生成增删改查业务代码
3. [ ] 文件上传:对接云OSS加本地备份
4. [ ] 系统通知:主动发送定时任务通知,资源警告,服务异常预警...

## 本地开发

* Python 3.10+
Expand Down
16 changes: 7 additions & 9 deletions backend/app/api/v1/mixed/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from fastapi import APIRouter, File, Form, UploadFile
from fastapi import APIRouter

from backend.app.common.response.response_schema import response_base
from backend.app.tasks import task_demo_async

router = APIRouter(prefix='/tests')
Expand All @@ -10,13 +11,10 @@
@router.post('/send', summary='测试异步任务')
async def task_send():
result = task_demo_async.delay()
return {'msg': 'Success', 'data': result.id}
return await response_base.success(data=result.id)


@router.post('/files', summary='测试文件上传')
async def create_file(file: bytes = File(), fileb: UploadFile = File(), token: str = Form()):
return {
'file_size': len(file),
'token': token,
'fileb_content_type': fileb.content_type,
}
@router.post('/send', summary='异步任务演示')
async def send_task():
result = task_demo_async.delay()
return await response_base.success(data=result.id)