当前位置:首页>python>通过Python实现需求转为API测试脚本

通过Python实现需求转为API测试脚本

  • 2026-06-28 17:58:01
通过Python实现需求转为API测试脚本

上次介绍如何《通过Python实现需求转为playwright测试脚本》,这次介绍《通过Python实现需求转为API测试脚本》,相对而言转为API测试脚本比转为playwright测试脚本效率要高的很多,只要根据几次生成的结果,调理需求,基本上能生成100%通过的测试脚本,而playwright测试脚本的通过率也可以达到100%,但是概率很小,必须有人工参与调整。

目录

|——logs|     ||     ———test_run.log(运行后自动生成)|——outputs|     ||     ——— /test_history     (目录、运行后自动生成)|   test_api_current.py (运行后生成的测试程序)|   fix_report.json  (运行后自动生成)|   report.json   (运行后自动生成)||——skills|        ||———/test-orchestrator|     ||——————skill.md: 能力文件|   /scripts|   ||—————————executor.py :运行测试程序|        fixer.py:修复测试程序|        generator.py:生成测试程序|        orchestrator.py:调度者|——main.py  主程序|——req.txt  需求文档

实现代码

executor.py

import subprocessimport jsonimport refrom pathlib import Pathfrom typing import Dictclass ApiTestExecutor:    def __init__(self):        # 接口测试不需要 headless 参数        pass    def run(self, test_file: str) -> Dict:        """执行测试文件"""        test_path = Path(test_file)        if not test_path.exists():            return {"success": False, "error": "文件不存在", "exit_code": -1}        # 构建 pytest 命令        cmd = [            "pytest", str(test_path),             "-v", "--tb=short", "--color=no",            "--json-report", f"--json-report-file={test_path.parent}/report.json"        ]        try:            # 修复编码问题:设置 encoding='utf-8' 和 errors='replace'            result = subprocess.run(                cmd,                capture_output=True,                text=True,                timeout=60,                encoding='utf-8',  # 强制使用 UTF-8 编码                errors='replace',   # 替换无法解码的字符                env={**subprocess.os.environ, "PYTHONUNBUFFERED": "1", "PYTHONIOENCODING": "utf-8"}            )            # 修复 None 值问题:如果 stdout 或 stderr 为 None,替换为空字符串            stdout = result.stdout if result.stdout is not None else ""            stderr = result.stderr if result.stderr is not None else ""            # 解析结果            passed = []            failed = []            for line in stdout.split("\n"):                if "PASSED" in line:                    passed.append(line)                elif "FAILED" in line:                    failed.append(line)            error_msg = stdout + "\n" + stderr            # 尝试读取 json 报告获取更详细的错误            report_file = test_path.parent / "report.json"            if report_file.exists():                try:                    with open(report_file, 'r', encoding='utf-8') as f:                        report = json.load(f)                    # 提取具体的失败信息                    for test in report.get("tests", []):                        if test.get("outcome") == "failed":                            error_msg = test.get("call", {}).get("crash", {}).get("message", error_msg)                except Exception as e:                    error_msg += f"\n读取报告失败: {str(e)}"            return {                "success": result.returncode == 0,                "passed": passed,                "failed": failed,                "error": error_msg[:2000],                "exit_code": result.returncode            }        except subprocess.TimeoutExpired:            return {"success": False, "error": "执行超时", "exit_code": -2}        except UnicodeDecodeError as e:            return {"success": False, "error": f"编码错误: {str(e)}", "exit_code": -3}        except Exception as e:            return {"success": False, "error": f"执行异常: {str(e)}", "exit_code": -4}

fixer.py

import osimport reimport loggingfrom typing import Dict, Optionalfrom openai import OpenAIlogger = logging.getLogger(__name__)class ApiTestFixer:    def __init__(self):        self.client = OpenAI(            api_key=os.getenv("DASHSCOPE_API_KEY"),            base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"        )        self.model = os.getenv("QWEN_MODEL", "qwen-plus")        self.max_retries = 3    def _classify_error(self, error_msg: str) -> Dict:        """针对接口测试的错误分类"""        error_lower = error_msg.lower()        if "404" in error_msg:            return {"type": "Http404", "severity": "high"}        elif "500" in error_msg:            return {"type": "Http500", "severity": "critical"}        elif "401" in error_msg or "403" in error_msg:            return {"type": "AuthError", "severity": "high"}        elif "json" in error_lower and "decode" in error_lower:            return {"type": "JsonDecodeError", "severity": "medium"}        elif "assert" in error_lower:            return {"type": "BusinessLogicAssertion", "severity": "high"}        else:            return {"type": "Unknown", "severity": "low"}    def _extract_code(self, content: str) -> Optional[str]:        # 同之前的逻辑        if "```python" in content:            start = content.find("```python") + 9            end = content.find("```", start)            return content[start:end].strip()        return content.strip()    def fix(self, code: str, error_info: Dict, requirements: str) -> str:        error_detail = error_info.get("error", "")        error_type = self._classify_error(error_detail)        prompt = f"""        你是一个接口自动化测试专家。请修复以下基于 `requests` 的测试代码。        ## 错误分析        - 类型: {error_type['type']}        - 详情: {error_detail}        ## 需求        {requirements}        ## 失败代码        ```python        {code}        ```        ## 修复指南        1. **URL 检查**:如果是 404,检查 BASE_URL 和路由拼接是否正确。        2. **参数格式**:检查 `json=payload` 还是 `data=payload`,确保 Content-Type 匹配。        3. **依赖关系**:如果是 401/403,检查是否缺少 Token 或 Cookie,是否需要先调用登录接口。        4. **断言修复**:根据错误信息调整断言逻辑,确保标点符号与需求一致。        5. **JSON 解析**:如果报错 JSON decode,先打印 response.text 再尝试解析。        请输出修复后的完整代码。        """        for _ in range(self.max_retries):            try:                response = self.client.chat.completions.create(                    model=self.model,                    messages=[{"role": "user", "content": prompt}],                    temperature=0.1                )                content = response.choices[0].message.content                fixed_code = self._extract_code(content)                if fixed_code and "import requests" in fixed_code:                    return fixed_code            except Exception as e:                logger.error(f"修复失败: {e}")        return code # 失败返回原代码```

generator.py

import osimport reimport loggingfrom typing import Dict, Optionalfrom openai import OpenAIlogger = logging.getLogger(__name__)class ApiTestGenerator:    def __init__(self):        self.client = OpenAI(            api_key=os.getenv("DASHSCOPE_API_KEY"),            base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"        )        self.model = os.getenv("QWEN_MODEL", "qwen-plus")    def _extract_code(self, content: str) -> str:        """提取代码块"""        if "```python" in content:            start = content.find("```python") + 9            end = content.find("```", start)            return content[start:end].strip()        return content.strip()    def generate(self, requirements: str) -> str:        """生成基于 Requests 的接口测试代码"""        prompt = f"""        你是一个 Python 接口自动化测试专家。请根据以下产品需求,编写基于 `requests` 和 `pytest` 的测试代码。        ## 产品需求        {requirements}        ## 核心规范        1. **库的使用**:           - 必须使用 `import requests`。           - 使用 `pytest` 进行断言和组织。           - 使用 `parameterized` 进行数据驱动测试。        2. **会话管理**:           - 使用 `requests.Session()` 来保持 Cookie 或 Header。           - 在 `@pytest.fixture` 中初始化 Session。        3. **URL 管理**:           - 定义 `BASE_URL = "http://localhost:8080/api"` (根据需求推断)。        4. **断言策略**:           - 优先断言 HTTP 状态码:`assert response.status_code == 200`。           - 断言业务逻辑:`assert response.json().get("code") == 0` 或 `assert "success" in response.text`。           - **标点符号保护**:如果需求中规定了错误消息(如“用户名不存在!”),断言时必须包含标点符号。        5. **数据库清理**:           - 如果需要数据库验证,保留 pymysql 连接代码,但在测试结束后清理数据。        ## 代码模板参考        ```python        import pytest        import requests        from parameterized import parameterized        BASE_URL = "http://localhost:8080/api"        class TestUserAPI:            @pytest.fixture(autouse=True)            def setup(self):                self.session = requests.Session()                self.session.headers.update({{"Content-Type": "application/json"}})                yield                self.session.close()            @parameterized.expand([                ("正常登录", "admin", "123456", 200, "success"),                ("密码错误", "admin", "wrong", 401, "密码错误"),            ])            def test_login(self, name, user, pwd, exp_status, exp_msg):                url = f"{{BASE_URL}}/login"                payload = {{"username": user, "password": pwd}}                response = self.session.post(url, json=payload)                assert response.status_code == exp_status                json_data = response.json()                assert exp_msg in json_data.get("message", "")        ```        请输出完整的 Python 代码,不要解释。        """        response = self.client.chat.completions.create(            model=self.model,            messages=[{"role": "user", "content": prompt}],            temperature=0.1,            max_tokens=4000        )        code = self._extract_code(response.choices[0].message.content)        # 确保导入了必要的库        if "import requests" not in code:            code = "import requests\n" + code        if "from parameterized import parameterized" not in code:            code = "from parameterized import parameterized\n" + code        return code

orchestrator.py

import osimport sysimport jsonimport loggingfrom pathlib import Pathfrom typing import Dict, Tuple# 导入我们刚才定义的类from generator import ApiTestGeneratorfrom executor import ApiTestExecutorfrom fixer import ApiTestFixerlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')logger = logging.getLogger(__name__)class ApiTestOrchestrator:    def __init__(self, req_file="req.txt", max_retry=5, output_dir="outputs"):        self.req_file = Path(req_file)        self.max_retry = max_retry        self.output_dir = Path(output_dir)        self.output_dir.mkdir(exist_ok=True)        self.current_test_file = self.output_dir / "test_api_current.py"        # 初始化组件        self.generator = ApiTestGenerator()        self.executor = ApiTestExecutor()        self.fixer = ApiTestFixer()    def run(self) -> bool:        if not self.req_file.exists():            logger.error(f"需求文件不存在: {self.req_file}")            return False        # 读取需求时指定编码        requirements = self.req_file.read_text(encoding="utf-8")        logger.info(f"读取需求: {requirements[:50]}...")        code = None        success = False        last_result = None  # 初始化 last_result        for i in range(self.max_retry):            logger.info(f"\n--- 第 {i+1} 轮迭代 ---")            # 1. 生成或修复            if i == 0:                logger.info("正在生成接口测试代码...")                code = self.generator.generate(requirements)            else:                logger.info("正在修复代码...")                code = self.fixer.fix(code, last_result, requirements)            # 保存代码时指定 UTF-8 编码            self.current_test_file.write_text(code, encoding="utf-8")            logger.info(f"代码已保存至: {self.current_test_file}")            # 2. 执行            logger.info("正在执行测试...")            result = self.executor.run(str(self.current_test_file))            last_result = result            # 3. 检查结果            if result["success"]:                logger.info("测试全部通过!")                success = True                break            else:                logger.warning(f"测试失败: {result['error'][:200]}")        return successif __name__ == "__main__":    orchestrator = ApiTestOrchestrator()    success = orchestrator.run()    sys.exit(0 if success else 1)

SKILL.md与转为playwright测试脚本相同

---name: api-test-orchestratordescription: |  基于 Requests 的接口自动化测试编排器。  读取需求 → 生成 API 测试 → 执行 → 失败自动修复 → 重试,直至全部通过。version: 1.0.0author: AI Agent---# 接口测试编排技能## 能力概述本技能实现了一个轻量级、高效率的接口测试自动化闭环流程:1. **需求解析**:从 `req.txt` 读取产品需求文档2. **代码生成**:调用 LLM 基于 `requests` + `pytest` 生成接口测试代码(含 Session 管理、参数化)3. **自动执行**:在本地环境运行 Pytest4. **智能修复**:如果测试失败,分析 HTTP 状态码、JSON 响应及断言错误,调用 LLM 修复代码5. **闭环重试**:重复执行与修复步骤,直到所有用例通过或达到最大重试次数(默认 5 次)## 输入参数- `--req_file`: 需求文件路径,默认 `req.txt`- `--max_retry`: 最大修复重试次数,默认 `5`- `--verbose`: 详细日志输出,默认 `false`## 输出产物- `outputs/test_api_current.py`: 最终通过的接口测试代码- `outputs/fix_report.json`: 修复过程记录(包含错误类型、修复次数)- `logs/test_run.log`: 完整运行日志## 编排流程```mermaidgraph TD    A[读取 req.txt] --> B[LLM 生成 requests 代码]    B --> C[执行 Pytest]    C --> D{测试通过?}    D -- 是 --> E[完成!输出最终代码]    D -- 否 --> F[分析错误日志]    F --> G[LLM 修复代码]    G --> C    style E fill:#9f9,stroke:#333,stroke-width:2px    style C fill:#ff9,stroke:#333,stroke-width:2px##错误处理策略- HTTP 404/500:自动检查 URL 拼接、Header 设置及服务端异常处理- JSON 解析错误:自动添加 response.text 打印调试,并优化解析逻辑- 业务断言失败:根据需求文档修正断言字段及标点符号匹配##退出码- 0: 所有测试通过- 1: 达到最大重试次数仍有失败- 2: 需求文件不存在或格式错误

需求

注册需求

**基本需求**request.post(url,data,cookies)url = http://127.0.0.1:8080/ChatGPTEbusiness/jsp/RegisterPage.jspdata = { "csrftoken"=csrftoken,  "username"=username,  "password"=password,  "phone"=phone,  "email"=email }其中password经过SHA256散列cookies = {"csrftoken"=csrftoken}csrftoken来自id="csrftoken" input的value值,即<input type="hidden" id="csrftoken" name="csrftoken" value="DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE">中的"DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE**注意**:每一次请求都要获取一次csrftoken**信息**- 注册成功:登录页面- 账号(必填):文本框,长度为5-20位,可以包含大小写英文字符(必填)或数字(选填)正则表达式 "^[a-zA-Z0-9]{5,20}$"。错误信息:"账号必须是5-20位字母或数字"- 手机号(必填):手机框,需符合中国手机号码格式。正则表达式 "^1[3-9]\\d{9}$"。错误信息:"手机号必须符合中国手机号码格式"- Email(必填):需符合国际标准Email格式。正则表达式 "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"。错误信息:"Email格式不正确"- 密码没有进行SHA256散列错误信息:"密码应该哈希进行存储"- cookies中的csrftoken与data中的csrftoken不一致错误信息:"可能存在CSRF注入风险"**数据库信息**## 测试环境配置```DB_CONFIG = {    'host': 'localhost',    'user': 'root',    'password': '123456',    'database': 'chatgptebusiness'}```## user表格式``` CREATE TABLE IF NOT EXISTS user( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL, password VARCHAR(100) NOT NULL, phone VARCHAR(50) NOT NULL, email VARCHAR(50) NOT NULL); ``` - 请执行每个测试用例前,建立数据库连接,清除user表;执行每个测试用例后,请断开数据库连接- 注册用户成功,请进入数据库中进行检查,注册的数据是否正确存在数据库中

登录需求

**基本需求**request.post(url,data,cookies)url = http://127.0.0.1:8080/ChatGPTEbusiness/jsp/LoginPage.jspdata = { "csrftoken"=csrftoken,  "username"=username,  "password"=password }其中password经过SHA256散列cookies = {"csrftoken"=csrftoken}csrftoken来自id="csrftoken" input的value值,即<input type="hidden" id="csrftoken" name="csrftoken" value="DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE">中的"DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE**注意**:每一次请求都要获取一次csrftoken**信息**- 登录成功:系统欢迎您- 账号(必填):文本框,长度为5-20位,可以包含大小写英文字符(必填)或数字(选填)正则表达式 "^[a-zA-Z0-9]{5,20}$"。错误信息:"账号必须是5-20位字母或数字"- 密码没有进行SHA256散列错误信息:"密码应该哈希进行存储"- cookies中的csrftoken与data中的csrftoken不一致错误信息:"可能存在CSRF注入风险"**数据库信息**## 测试环境配置```DB_CONFIG = {    'host': 'localhost',    'user': 'root',    'password': '123456',    'database': 'chatgptebusiness'}```## user表格式``` CREATE TABLE IF NOT EXISTS user( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL, password VARCHAR(100) NOT NULL, phone VARCHAR(50) NOT NULL, email VARCHAR(50) NOT NULL); ``` - 请执行每个测试用例前,建立数据库连接,建立准备登录的user表信息;执行每个测试用例后,请断开数据库连接,删除建立的user表信息

找回密码需求

**基本需求*****输入phone或Email***- request.post(url,data,cookies)- url = http://127.0.0.1:8080/ChatGPTEbusiness/jsp/VeriCodePage.jsp- data = {"csrftoken"=csrftoken,       "contact"=contact}- cookies = {"csrftoken"=csrftoken}- csrftoken来自VeriCodePage.jsp的id="csrftoken" input的value值,即<input type="hidden" id="csrftoken" name="csrftoken" value="DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE">中的"DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE**注意**:- 每一次请求都要获取一次csrftoken- contact均使用一个有效的Email地址: xianggu625@126.com***找回密码***- request.post(url,data,cookies)- url = http://127.0.0.1:8080/ChatGPTEbusiness/jsp/RecoverPage.jsp- data = {"csrftoken"=csrftoken,      "identifyingCode"=identifyingCode,      "newPassword"=newPassword}newPassword需要SHA256散列- cookies = {"csrftoken"=csrftoken}- csrftoken来自RecoverPage.jsp的id="csrftoken" input的value值,即<input type="hidden" id="csrftoken" name="csrftoken" value="DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE">中的"DlFaArVGOOMBgmPFENFH8s7mD7v2c8rtNfiOBosjUC5QCqkPcVBSlgeyhGFqSFEDUlaGHmx5FiL8uA4hnMNX0NvgZDpuSocr2wqE**注意**:-  每一次请求都要获取一次csrftoken-  操作RecoverPage.jsp前必须先操作VeriCodePage.jsp,不能一上来就操作RecoverPage.jsp-  identifyingCode必须从数据库表code获取,然后在data中进行传输,不得在测试程序中向数据库中插入数据。**信息**- 输入phone或Email成功:"找回密码"。- 重置密码:"登录页面"。- 手机号或Email在user表中查不到:"您输入的手机号或Email不存在,请重新输入!"(这个测试仅在VeriCodePage.jsp页面测试即可,不用在RecoverPage.jsp)- 输入的验证码与code表中的验证码不一致:"验证码错误,请重新输入!"。- 新密码以前使用过:"这个密码以前设置过,请用一个新密码!"。- 新密码没有SHA56散列:"密码需要HASH散列"**数据库信息**```    DB_CONFIG = {    'host': 'localhost',    'user': 'root',    'password': '123456',    'database': 'chatgptebusiness'}```***user表格式***``` CREATE TABLE IF NOT EXISTS user( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL, password VARCHAR(100) NOT NULL, phone VARCHAR(50) NOT NULL, email VARCHAR(50) NOT NULL); ```  ***code表格式*** ``` CREATE TABLE code( id INT AUTO_INCREMENT PRIMARY KEY, uid INT NOT NULL, code CHAR(6) NOT NULL, FOREIGN KEY(uid) REFERENCES user(id));```***password表格式***```CREATE TABLE password( id INT AUTO_INCREMENT PRIMARY KEY, uid INT NOT NULL, password VARCHAR(100) NOT NULL, FOREIGN KEY(uid) REFERENCES user(id));```- 完成每个测试用例前请删除user表、code表和password表.- 执行每一个用例前建立一个user信息{"jerrygu","Zxcv@123","13681732596","xianggu625@126.com"}**URL**- 输入phone或Email:http://127.0.0.1:8080/ChatGPTEbusiness/jsp/VeriCodePage.jsp- 重置密码:http://127.0.0.1:8080/ChatGPTEbusiness/jsp/RecoverPage.jsp

注意

  • 执行main.py的时候将注册需求、登录需求、找回密码需求,定义在名为req.txt文件中

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 05:31:21 HTTP/2.0 GET : https://f.mffb.com.cn/a/489269.html
  2. 运行时间 : 0.107725s [ 吞吐率:9.28req/s ] 内存消耗:4,958.98kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=2b7ac21e67f07cfe6ad8e90fab5a71f5
  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.000647s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000948s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000326s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000274s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000655s ]
  6. SELECT * FROM `set` [ RunTime:0.000253s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000736s ]
  8. SELECT * FROM `article` WHERE `id` = 489269 LIMIT 1 [ RunTime:0.001563s ]
  9. UPDATE `article` SET `lasttime` = 1783114281 WHERE `id` = 489269 [ RunTime:0.007057s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000330s ]
  11. SELECT * FROM `article` WHERE `id` < 489269 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000846s ]
  12. SELECT * FROM `article` WHERE `id` > 489269 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000486s ]
  13. SELECT * FROM `article` WHERE `id` < 489269 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002502s ]
  14. SELECT * FROM `article` WHERE `id` < 489269 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.008375s ]
  15. SELECT * FROM `article` WHERE `id` < 489269 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.016299s ]
0.109260s