Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for __component (0.2 sec)

  1. docs/zh/docs/tutorial/dependencies/index.md

    通过依赖注入系统,只要告诉 **FastAPI** *路径操作函数* 还要「依赖」其他在*路径操作函数*之前执行的内容,**FastAPI** 就会执行函数代码,并「注入」函数返回的结果。
    
    其他与「依赖注入」概念相同的术语为:
    
    * 资源(Resource)
    * 提供方(Provider)
    * 服务(Service)
    * 可注入(Injectable)
    * 组件(Component)
    
    ## **FastAPI** 插件
    
    **依赖注入**系统支持构建集成和「插件」。但实际上,FastAPI 根本**不需要创建「插件」**,因为使用依赖项可以声明不限数量的、可用于*路径操作函数*的集成与交互。
    
    创建依赖项非常简单、直观,并且还支持导入 Python 包。毫不夸张地说,只要几行代码就可以把需要的 Python 包与 API 函数集成在一起。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jun 24 14:47:15 GMT 2023
    - 7K bytes
    - Viewed (0)
Back to top