当前位置:首页>python>AI 大模型应用开发前置,:Python 类型注解全教程

AI 大模型应用开发前置,:Python 类型注解全教程

  • 2026-02-28 01:21:03
AI 大模型应用开发前置,:Python 类型注解全教程

前言

在 FastAPI、LangChain、LlamaIndex、RAG、大模型服务端 开发中,类型注解(Type Hints) 已经不是可选语法,而是:

1 代码可读性基础

1 多人协作规范

1 静态检查(mypy)依据

1 自动生成API文档的核心

1 避免80%运行时错误的保障

本文 100%全覆盖、系统、详细、无遗漏 讲解 Python 类型注解所有知识点,从基础到高级,从语法到工程实践,全部一次性讲清。



一、类型注解基础

1.1 什么是类型注解?

类型注解是 Python 3.5+ 引入的静态类型标记,用于:

1 标记变量类型

1 标记函数参数类型

1 标记函数返回值类型

特点:

1 不影响程序运行

1 仅用于提示、检查、文档

1 被 IDE / mypy / 框架识别

1.2 为什么大模型开发必须学?

1 函数参数极多(prompt、temperature、stream、tools…)

1 数据结构复杂(Document、Embedding、Message…)

1 嵌套深、逻辑复杂,无类型完全无法维护

1 FastAPI / LangChain 强制依赖类型注解



二、变量类型注解(完整)

2.1 基础类型

Python

# 数字

name: str = "大模型开发者"

age: int = 25

score: float = 98.5

is_active: bool = True

nothing: None = None

2.2 只声明不赋值

Python

prompt: str

temperature: float

max_tokens: int

stream: bool

2.3 常量注解 Final

Python

from typing import Final



API_KEY: Final[str] = "sk-xxxxxx"

MODEL_NAME: Final[str] = "gpt-3.5-turbo"



三、容器类型注解(list / dict / tuple / set)

Python 3.9+ 内置支持,无需从 typing 导入 List/Dict。

3.1 list 列表

Python

# 整数列表

ids: list[int] = [1001, 1002, 1003]



# 字符串列表

prompts: list[str] = ["介绍AI", "写Python代码"]



# 浮点向量(大模型Embedding必用)

embedding: list[float] = [0.12, 0.35, 0.66, 0.92]



# 嵌套列表

matrix: list[list[float]] = [[1.0, 2.0], [3.0, 4.0]]

3.2 dict 字典

格式:dict[键类型, 值类型]

Python

# 简单字典

config: dict[str, str] = {"model": "gpt-3.5", "version": "v1"}



# 混合值类型(常用)

model_kwargs: dict[str, int | float | bool] = {

    "temperature": 0.7,

    "max_tokens": 1024,

    "stream": True

}

3.3 tuple 元组

元组是固定结构、固定位置类型。

Python

# 固定结构:int + str

user: tuple[int, str] = (1001, "AI用户")



# 任意长度同类型

numbers: tuple[int, ...] = (1, 2, 3, 4, 5)



# 混合结构

message: tuple[str, str, bool] = ("user", "你好", True)

3.4 set 集合

Python

unique_ids: set[int] = {101, 102, 103}

vocab: set[str] = {"AI", "大模型", "RAG"}



四、函数类型注解(最高频、最重要)

4.1 函数参数注解

Python

def generate_response(

    prompt: str,

    temperature: float,

    max_tokens: int,

    stream: bool

) -> str:

    return f"生成结果:{prompt}"

4.2 返回值注解 -> 类型

Python

def get_embedding(text: str) -> list[float]:

    return [0.1, 0.2, 0.3]

4.3 无返回值 -> None

Python

def log_info(message: str) -> None:

    print(f"[日志] {message}")

4.4 默认参数注解

Python

def chat(

    prompt: str,

    model: str = "gpt-3.5-turbo",

    temperature: float = 0.7

) -> str:

    ...

4.5 可变参数 *args **kwargs

Python

def call_llm(*args: str, **kwargs: int | float) -> str:

    ...



五、联合类型 | Union(多种可能类型)

5.1 Python 3.10+ 简洁写法(推荐)

Python

# 可以是 int 或 str

user_id: int | str = 1001



# 可以是 float 或 None

score: float | None = None

5.2 旧版写法(兼容低版本)

Python

from typing import Union



user_id: Union[int, str] = 1001



六、可选类型 Optional(等于 X | None)

大模型项目90%可选参数都用它。

Python

from typing import Optional



# 等价于 system_prompt: str | None

system_prompt: Optional[str] = None



api_key: Optional[str] = None



七、Any 类型(任意类型)

Python

from typing import Any



# 可以是任何类型

data: Any = "字符串"

data: Any = 123

data: Any = [1, 2, 3]

⚠️ 工程规范:尽量不要用 Any,会完全失去类型安全意义。



八、迭代器与生成器类型(大模型流式输出必学)

8.1 Iterator 迭代器

Python

from typing import Iterator



def count_to_5() -> Iterator[int]:

    for i in range(5):

        yield i

8.2 Generator 生成器(流式输出标准)

格式:

Generator[产出类型, 发送类型, 返回类型]

Python

from typing import Generator



# 大模型流式输出标准写法

def llm_stream() -> Generator[str, None, None]:

    yield "我"

    yield "是"

    yield "AI"

    yield "大模型"

ChatGPT、文心、通义千问流式返回都用这个类型。



九、Callable 函数类型(回调函数)

用于函数作为参数传递的场景,如:

1 回调函数

1 事件处理

1 大模型插件系统

格式:

Callable[[参数类型...], 返回值类型]

Python

from typing import Callable



# 回调:接收 str,返回 bool

CallbackFunc = Callable[[str], bool]



def process_result(

    result: str,

    callback: CallbackFunc

) -> None:

    callback(result)



十、Type Alias 类型别名(工程化必备)

用于简化复杂类型,统一项目规范。

Python

# 向量别名

Embedding = list[float]



# 文档别名

Document = dict[str, str | Embedding]



# 消息列表

MessageList = list[dict[str, str]]



# 使用

emb: Embedding = [0.1, 0.2, 0.3]

doc: Document = {"content": "你好", "embedding": emb}



十一、Literal 字面量类型(大模型配置神器)

限定变量只能是几个固定值,传错直接报错。

Python

from typing import Literal



# 模型名称只能是这三种

ModelType = Literal["gpt-3.5", "gpt-4", "qwen", "ernie"]



# 设备类型

Device = Literal["cpu", "cuda", "mps"]



def run_llm(

    model: ModelType,

    device: Device = "cpu"

) -> None:

    ...



十二、TypedDict 结构化字典(AI 项目核心)

用于注解结构固定的字典,如:

1 大模型请求/返回体

1 RAG 文档结构

1 对话消息格式

Python

from typing import TypedDict



class ChatMessage(TypedDict):

    role: str          # user / assistant / system

    content: str

    name: Optional[str]



# 必须严格按结构写,少字段/错类型都会报错

msg: ChatMessage = {

    "role": "user",

    "content": "你好"

}

可选字段 TypedDict

Python

class LLMConfig(TypedDict, total=False):

    model: str

    temperature: float

    max_tokens: int



十三、Class 类与对象注解

13.1 实例属性注解

Python

class LLMModel:

    # 类属性注解

    model_name: str

    temperature: float



    def __init__(self, model_name: str, temperature: float = 0.7):

        self.model_name = model_name

        self.temperature = temperature

13.2 Self 自身类型(链式调用)

Python 3.11+

Python

from typing import Self



class LLMBuilder:

    def set_prompt(self, prompt: str) -> Self:

        self.prompt = prompt

        return self



    def set_temperature(self, t: float) -> Self:

        self.temp = t

        return self

13.3 类本身类型 type

Python

class BaseLLM:

    pass



def create_llm(llm_class: type[BaseLLM]) -> BaseLLM:

    return llm_class()



十四、异步函数类型注解

async 函数直接注解最终返回值即可。

Python

import asyncio



async def async_llm_call(prompt: str) -> str:

    await asyncio.sleep(1)

    return f"异步回复:{prompt}"



十五、NoReturn 永不返回

用于永远抛出异常、永远不结束的函数。

Python

from typing import NoReturn



def raise_error() -> NoReturn:

    raise RuntimeError("大模型调用失败")



十六、Protocol 接口类型(高级)

用于定义接口规范,类似 Java/TypeScript 接口。

Python

from typing import Protocol



class EmbeddingModel(Protocol):

    def encode(self, text: str) -> list[float]:

        ...

任何实现 encode 方法的类都被视为 EmbeddingModel。



十七、类型注解在大模型项目中的实战综合示例

Python

from typing import (

    Optional,

    Literal,

    TypedDict,

    Generator,

)



ModelName = Literal["gpt-3.5", "gpt-4", "qwen"]



class ChatMessage(TypedDict):

    role: str

    content: str

    name: Optional[str]



def chat_completion(

    messages: list[ChatMessage],

    model: ModelName = "gpt-3.5",

    temperature: float = 0.7,

    stream: bool = False

) -> Generator[str, None, None] | str:

    if stream:

        yield "回复"

    else:

        return "完整回复"



十八、静态检查工具 mypy(企业级必备)

安装:

Plain Text

pip install mypy

运行检查:

Plain Text

mypy your_code.py --strict

作用:

1 运行前发现类型错误

1 保证大项目质量

1 企业级AI工程标配



十九、类型注解最全总结(无遗漏)

基础

1 str int float bool None

1 变量:name: str

1 函数:def fn(a: int) -> str

容器

1 list[T]

1 dict[K, V]

1 tuple[T1, T2, ...]

1 set[T]

组合类型

1 可选:T | None / Optional[T]

1 联合:T1 | T2

1 任意:Any

高级(AI 必用)

1 生成器:Generator[Yield, Send, Return]

1 回调:Callable[[P], R]

1 结构:TypedDict

1 枚举:Literal

1 接口:Protocol

1 异步:直接注解返回值

工程规范

1 不用 Any

1 全部函数加注解

1 复杂结构用 TypedDict

1 配置项用 Literal

1 使用 mypy 检查

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 16:09:59 HTTP/2.0 GET : https://f.mffb.com.cn/a/476175.html
  2. 运行时间 : 0.227418s [ 吞吐率:4.40req/s ] 内存消耗:4,933.91kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c8d4281edcf1605e6e13d43d852e1db5
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000326s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000517s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000239s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.010715s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000532s ]
  6. SELECT * FROM `set` [ RunTime:0.003573s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000553s ]
  8. SELECT * FROM `article` WHERE `id` = 476175 LIMIT 1 [ RunTime:0.003751s ]
  9. UPDATE `article` SET `lasttime` = 1772266199 WHERE `id` = 476175 [ RunTime:0.009803s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.005912s ]
  11. SELECT * FROM `article` WHERE `id` < 476175 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003834s ]
  12. SELECT * FROM `article` WHERE `id` > 476175 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.023037s ]
  13. SELECT * FROM `article` WHERE `id` < 476175 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009450s ]
  14. SELECT * FROM `article` WHERE `id` < 476175 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.029240s ]
  15. SELECT * FROM `article` WHERE `id` < 476175 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.057205s ]
0.228904s