Files
hotime/example/tpt/swagger/app/api-spec.json
T

3117 lines
92 KiB
JSON
Raw Normal View History

2026-03-20 10:46:51 +08:00
{
"endpoints": [
{
"cases": [
{
"expect": {
"result": {
"cache_mode": "sample",
"cleanup": "sample",
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "缓存全部测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"cache_mode": "compatible",
"cleanup": "已清理所有测试缓存数据",
"name": "数据库缓存测试",
"success": true,
"tests": [
{
"cached_value": {
"active": true,
"count": 123,
"name": "测试数据"
},
"name": "1. 基础 set/get 测试",
"result": true
},
{
"after_exists": false,
"before_exists": true,
"name": "2. delete 删除缓存测试",
"result": true
},
{
"immediate_exists": true,
"name": "3. 过期时间测试(短超时)",
"note": "设置了2秒过期,可等待后再次访问验证过期",
"result": true
},
{
"name": "4. 不存在的 key 读取测试",
"result": true,
"value": null
},
{
"first": "第一次值",
"name": "5. 重复 set 同一个 key 测试",
"result": true,
"second": "第二次值",
"third": {
"version": 3
}
},
{
"after": {
"a": false,
"b": false,
"c": false
},
"before": {
"a": true,
"b": true,
"c": true
},
"name": "6. 通配删除测试 (key*)",
"result": true
},
{
"bool": true,
"float": 3.14159,
"int": 12345,
"map": {
"key": "value",
"num": 100
},
"name": "7. 不同数据类型存储测试",
"result": true,
"slice": [
1,
2,
3,
"four",
{
"five": 5
}
],
"string": "字符串值"
},
{
"name": "8. 自定义超时时间参数测试",
"result": true,
"value": "长期数据"
},
{
"name": "9. 缓存表状态查询",
"new_table_count": 0,
"new_table_name": "hotime_cache",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "cache",
"method": "GET",
"params": [],
"path": "/app/cache/all",
"project": "app",
"summary": "缓存全部测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"message": "sample"
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "批量缓存测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"message": "批量缓存测试完成,请查看控制台输出和日志文件"
},
"status": 0
}
}
],
"ctr": "cache",
"method": "GET",
"params": [],
"path": "/app/cache/batch",
"project": "app",
"summary": "批量缓存测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"success": true,
"test_name": "sample",
"tests": [
{
"name": "sample",
"result": true
}
],
"timestamp": "sample"
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "兼容模式测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"success": true,
"test_name": "兼容模式白盒测试",
"tests": [
{
"mode": "compatible",
"name": "1. 查询当前缓存模式",
"result": true
},
{
"count": 0,
"data": [],
"legacy_table": "cached",
"name": "2. 查询老表cached现有数据",
"result": true
},
{
"count": 0,
"data": [],
"name": "3. 查询新表hotime_cache现有数据",
"new_table": "hotime_cache",
"result": true
},
{
"cache_api_result": null,
"key_in_new_table": false,
"name": "4. 测试兼容模式老表回退读取",
"result": false,
"test_key": "test_compat_fallback_1774804199747243800"
2026-03-20 10:46:51 +08:00
},
{
"name": "5. 测试兼容模式写新删老",
"result": false,
"step1_legacy_before": true,
"step2_new_after": false,
"step3_legacy_after_deleted": false
},
{
"after_legacy_deleted": false,
"after_new_deleted": false,
"before_legacy": true,
"before_new": true,
"name": "6. 测试兼容模式删除(删除两表)",
"result": false
}
],
"timestamp": "2026-03-30 01:09:59"
2026-03-20 10:46:51 +08:00
},
"status": 0
}
}
],
"ctr": "cache",
"method": "GET",
"params": [],
"path": "/app/cache/compat",
"project": "app",
"summary": "缓存兼容模式测试",
"tested": true
},
{
"cases": [
{
"expect": {
"error": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"result": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"status": 1
},
"method": "GET",
"name": "不传table参数",
"passed": true,
"response": {
"error": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"result": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"status": 1
}
},
{
"expect": {
"result": {
"columns": [
{
"name": "sample",
"type": "sample"
}
],
"sample_data": [],
"table": "sample"
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "USER_TAB_COLUMNS 查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"query": {
"table": "admin"
},
"response": {
"result": {
"columns": [
{
"label": "ID",
"must": "N",
"name": "id",
"type": "INT"
},
{
"label": "ID",
"must": "N",
"name": "id",
"type": "INT"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "N",
"name": "id",
"type": "INT"
},
{
"label": null,
"must": "N",
"name": "id",
"type": "INT"
},
{
"label": "用户名",
"must": "Y",
"name": "name",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "name",
"type": "VARCHAR"
},
{
"label": "用户名",
"must": "Y",
"name": "name",
"type": "VARCHAR"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "Y",
"name": "name",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "phone",
"type": "VARCHAR"
},
{
"label": "密码",
"must": "Y",
"name": "password",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "password",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "create_time",
"type": "TIMESTAMP"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "Y",
"name": "state",
"type": "INT"
},
{
"label": "创建时间",
"must": "Y",
"name": "create_time",
"type": "TIMESTAMP"
},
{
"label": "状态:0-正常,1-异常",
"must": "Y",
"name": "state",
"type": "INT"
},
{
"label": null,
"must": "Y",
"name": "modify_time",
"type": "TIMESTAMP"
},
{
"label": "变更时间",
"must": "Y",
"name": "modify_time",
"type": "TIMESTAMP"
},
{
"label": "密码",
"must": "Y",
"name": "password",
"type": "VARCHAR"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "Y",
"name": "password",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "state",
"type": "INT"
},
{
"label": "状态:0-正常,1-异常",
"must": "Y",
"name": "state",
"type": "INT"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "Y",
"name": "role_id",
"type": "INT"
},
{
"label": null,
"must": "Y",
"name": "title",
"type": "VARCHAR"
},
{
"label": null,
"must": "Y",
"name": "create_time",
"type": "TIMESTAMP"
},
{
"label": "创建时间",
"must": "Y",
"name": "create_time",
"type": "TIMESTAMP"
},
2026-03-20 10:46:51 +08:00
{
"label": null,
"must": "Y",
"name": "modify_time",
"type": "TIMESTAMP"
},
{
"label": "变更时间",
"must": "Y",
"name": "modify_time",
"type": "TIMESTAMP"
2026-03-20 10:46:51 +08:00
}
],
"sample_data": [
{
"create_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"id": 1,
"modify_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"name": "超级管理员",
"password": "admin123",
"phone": "13800000001",
"role_id": 1,
"state": 1,
"title": "系统管理员"
},
{
"create_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"id": 2,
"modify_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"name": "编辑员",
"password": "editor123",
"phone": "13800000002",
"role_id": 2,
"state": 1,
"title": "内容编辑"
},
{
"create_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"id": 3,
"modify_time": "2026-03-20 10:28:27",
2026-03-20 10:46:51 +08:00
"name": "审核员",
"password": "review123",
"phone": "13800000003",
"role_id": 3,
"state": 1,
"title": "内容审核"
}
],
"table": "admin"
},
"status": 0
}
}
],
"ctr": "dmdb",
"method": "GET",
"params": [
{
"in": "query",
2026-03-20 10:46:51 +08:00
"name": "table",
"required": false,
"type": "string"
2026-03-20 10:46:51 +08:00
}
],
"path": "/app/dmdb/describe",
"project": "app",
"summary": "查询达梦表结构",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "达梦原生SQL",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "达梦原生SQL测试",
"success": true,
"tests": [
{
"count": 5,
"name": "Query 原生查询 (双引号)",
"result": true
},
{
"affected": 1,
2026-03-20 10:46:51 +08:00
"name": "Exec 原生执行 (双引号)",
"result": true
},
{
"count": 47,
2026-03-20 10:46:51 +08:00
"name": "USER_TABLES 查询",
"result": true
},
{
"columns": [
{
"COLUMN_NAME": "id",
"DATA_TYPE": "INT"
},
{
"COLUMN_NAME": "id",
"DATA_TYPE": "INT"
},
{
"COLUMN_NAME": "name",
"DATA_TYPE": "VARCHAR"
},
{
"COLUMN_NAME": "name",
"DATA_TYPE": "VARCHAR"
},
{
"COLUMN_NAME": "password",
"DATA_TYPE": "VARCHAR"
},
{
"COLUMN_NAME": "phone",
"DATA_TYPE": "VARCHAR"
},
{
"COLUMN_NAME": "create_time",
"DATA_TYPE": "TIMESTAMP"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "state",
"DATA_TYPE": "INT"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "modify_time",
"DATA_TYPE": "TIMESTAMP"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "password",
"DATA_TYPE": "VARCHAR"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "state",
"DATA_TYPE": "INT"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "role_id",
"DATA_TYPE": "INT"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "title",
"DATA_TYPE": "VARCHAR"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "create_time",
"DATA_TYPE": "TIMESTAMP"
2026-03-20 10:46:51 +08:00
},
{
"COLUMN_NAME": "modify_time",
"DATA_TYPE": "TIMESTAMP"
2026-03-20 10:46:51 +08:00
}
],
"count": 15,
2026-03-20 10:46:51 +08:00
"name": "USER_TAB_COLUMNS 查询",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "dmdb",
"method": "GET",
"params": [],
"path": "/app/dmdb/rawsql",
"project": "app",
"summary": "达梦原生 SQL 测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"tables": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "USER_TABLES 查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"tables": [
{
"label": null,
"name": "##HISTOGRAMS_TABLE"
},
{
"label": null,
"name": "SYSALERTHISTORIES"
},
{
"label": null,
"name": "SYSALERTNOTIFICATIONS"
},
{
"label": null,
"name": "SYSALERTS"
},
{
"label": null,
"name": "SYSJOBHISTORIES"
},
{
"label": null,
"name": "SYSJOBHISTORIES2"
},
{
"label": null,
"name": "SYSJOBS"
},
{
"label": null,
"name": "SYSJOBSCHEDULES"
},
{
"label": null,
"name": "SYSJOBSTEPS"
},
{
"label": null,
"name": "SYSMAILINFO"
},
{
"label": null,
"name": "SYSOPERATORS"
},
{
"label": null,
"name": "SYSSTEPHISTORIES2"
},
{
"label": null,
"name": "admin"
},
{
"label": null,
"name": "article"
},
{
"label": null,
"name": "cached"
},
{
"label": null,
"name": "ctg"
},
{
"label": null,
"name": "hotime_cache"
},
{
"label": null,
"name": "test_batch"
},
{
"label": "管理员",
"name": "admin"
},
{
"label": "应用表",
"name": "app"
},
{
"label": "应用分类表",
"name": "app_category"
},
{
"label": "应用凭证表",
"name": "app_credential"
},
{
"label": "应用评分表",
"name": "app_rating"
},
{
"label": "应用评分附件表",
"name": "app_rating_file"
},
{
"label": "开发者表",
"name": "developer"
},
{
"label": "意见反馈表",
"name": "feedback"
},
{
"label": "反馈附件表",
"name": "feedback_file"
},
{
"label": "帮助分类表",
"name": "help_category"
},
{
"label": "帮助问题表",
"name": "help_question"
},
{
"label": null,
"name": "hotime_cache"
},
{
"label": "登录日志表",
"name": "login_log"
},
{
"label": "消息主表",
"name": "message"
},
{
"label": "消息回调日志表",
"name": "message_callback_log"
},
{
"label": "新闻公告表",
"name": "news"
},
{
"label": "新闻分类表",
"name": "news_category"
},
{
"label": "OAuth授权码表",
"name": "oauth_code"
},
{
"label": "组织部门表",
"name": "org"
},
{
"label": "组织应用关联表",
"name": "org_app"
},
{
"label": "职务岗位表",
"name": "position"
},
{
"label": "角色表",
"name": "role"
},
{
"label": "用户表",
"name": "user"
},
{
"label": "用户应用关联表",
"name": "user_app"
},
{
"label": "用户认证表",
"name": "user_auth"
},
{
"label": "用户设备表",
"name": "user_device"
},
{
"label": "用户钉钉关联表",
"name": "user_dingtalk"
},
{
"label": "用户消息关联表",
"name": "user_message"
},
{
"label": "用户组织关联表",
"name": "user_org"
2026-03-20 10:46:51 +08:00
}
]
},
"status": 0
}
}
],
"ctr": "dmdb",
"method": "GET",
"params": [],
"path": "/app/dmdb/tables",
"project": "app",
"summary": "查询达梦所有表",
"tested": true
},
{
"cases": [
{
"expect": {
"result": true,
"status": 0
},
"method": "GET",
"name": "result是布尔",
"passed": true,
"response": {
"result": true,
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/bool_result",
"project": "app",
"summary": "返回布尔-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"error": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"result": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"status": 3
},
"form": {
"name": ""
},
"method": "POST",
"name": "名称为空-缺少必填字段",
"passed": true,
"response": {
"error": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"result": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"status": 3
}
},
{
"expect": {
"result": {
"created": true,
"id": 1,
"name": "sample"
},
"status": 0
},
"form": {
"name": "测试商品"
},
"method": "POST",
"name": "名称正确-结构+值校验",
"passed": true,
"response": {
"result": {
"created": true,
"id": 1,
"name": "测试商品"
},
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "POST",
"params": [
{
"in": "form",
"name": "name",
"required": false,
"type": "string"
}
],
"path": "/app/expect_demo/error_demo",
"project": "app",
"summary": "错误先行+正确请求完整校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": 1,
"status": 0
},
"method": "GET",
"name": "result是小数",
"passed": true,
"response": {
"result": 3.14,
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/float_result",
"project": "app",
"summary": "返回小数-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"id": 1,
"in_stock": true,
"name": "sample",
"price": 1
},
"status": 0
},
"method": "GET",
"name": "result是Map-校验字段名+类型+值",
"passed": true,
"response": {
"result": {
"id": 1,
"in_stock": true,
"name": "示例商品",
"price": 19.9
},
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/map_result",
"project": "app",
"summary": "返回对象-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"customer": {
"id": 1,
"name": "sample",
"phone": "sample"
},
"extra": {
"delivery": {
"address": "sample",
"fee": 1
}
},
"id": 1,
"items": [
{
"goods_name": "sample",
"id": 1,
"price": 1,
"quantity": 1
}
],
"title": "sample"
},
"status": 0
},
"method": "GET",
"name": "深层嵌套Map+Slice+Map",
"passed": true,
"response": {
"result": {
"customer": {
"id": 1,
"name": "张三",
"phone": "13800138000"
},
"extra": {
"delivery": {
"address": "XX路1号",
"fee": 5
}
},
"id": 100,
"items": [
{
"goods_name": "苹果",
"id": 1,
"price": 3.5,
"quantity": 5
},
{
"goods_name": "香蕉",
"id": 2,
"price": 2,
"quantity": 10
}
],
"title": "测试订单"
},
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/nested_result",
"project": "app",
"summary": "返回嵌套对象-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"data": "sample",
"id": 1
},
"status": 0
},
"method": "GET",
"name": "有Verify值断言",
"passed": true,
"response": {
"result": {
"data": "无预期校验",
"id": 1
},
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/no_expect",
"project": "app",
"summary": "最小正确用例-仍需值断言",
"tested": true
},
{
"cases": [
{
"expect": {
"result": 1,
"status": 0
},
"method": "GET",
"name": "result是整数",
"passed": true,
"response": {
"result": 42,
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/number_result",
"project": "app",
"summary": "返回整数-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": [
{
"id": 1,
"name": "sample"
}
],
"status": 0
},
"method": "GET",
"name": "result直接是Slice",
"passed": true,
"response": {
"result": [
{
"id": 1,
"name": "标签A"
},
{
"id": 2,
"name": "标签B"
}
],
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/slice_result",
"project": "app",
"summary": "返回数组-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"result": "样本",
"status": 0
},
"method": "GET",
"name": "result是字符串",
"passed": true,
"response": {
"result": "操作成功",
"status": 0
}
}
],
"ctr": "expect_demo",
"method": "GET",
"params": [],
"path": "/app/expect_demo/string_result",
"project": "app",
"summary": "返回字符串-结构+值校验",
"tested": true
},
{
"cases": [
{
"expect": {
"error": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"result": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"status": 3
},
"form": {
"name": ""
},
"method": "POST",
"name": "名称为空",
"passed": true,
"response": {
"error": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"result": {
"msg": "名称不能为空",
"type": "请求参数异常"
},
"status": 3
}
},
{
"expect": {
"result": {
"id": 1,
"name": "sample"
},
"status": 0
},
"form": {
"name": "verify_test"
},
"method": "POST",
"name": "写入并校验DB+响应",
"passed": true,
"response": {
"result": {
"id": 196,
"name": "verify_test"
},
"status": 0
}
},
{
"expect": {
"result": {
"id": 1,
"name": "sample"
},
"status": 0
},
"form": {
"name": "verify_fail"
},
"method": "POST",
"name": "写入并校验DB-故意失败",
"passed": false,
"response": {
"result": {
"id": 197,
"name": "verify_fail"
},
"status": 0
},
"verifyError": "test_batch.state 期望 99, 实际 0(接口写入 0,故意校验 99 演示失败效果)"
}
],
"ctr": "expect_demo",
"method": "POST",
"params": [
{
"in": "form",
"name": "name",
"required": false,
"type": "string"
}
],
"path": "/app/expect_demo/verify_demo",
"project": "app",
"summary": "Verify完整范式演示",
"tested": true
},
2026-03-20 10:46:51 +08:00
{
"cases": [
{
"name": "不传table参数",
"method": "GET",
"passed": true,
"response": {
"error": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"result": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"status": 1
},
"expect": {
"error": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"result": {
"msg": "请提供 table 参数",
"type": "内部系统异常"
},
"status": 1
}
},
2026-03-20 10:46:51 +08:00
{
"name": "DESCRIBE admin",
"method": "GET",
"passed": true,
"query": {
"table": "admin"
},
"response": {
"result": {
"columns": [
{
"Default": null,
"Extra": "auto_increment",
"Field": "id",
"Key": "PRI",
"Null": "NO",
"Type": "int(11) unsigned"
},
{
"Default": null,
"Extra": "",
"Field": "name",
"Key": "",
"Null": "YES",
"Type": "varchar(100)"
},
{
"Default": null,
"Extra": "",
"Field": "phone",
"Key": "UNI",
"Null": "YES",
"Type": "varchar(20)"
},
{
"Default": "0",
"Extra": "",
"Field": "state",
"Key": "",
"Null": "YES",
"Type": "int(2)"
},
{
"Default": null,
"Extra": "",
"Field": "password",
"Key": "",
"Null": "YES",
"Type": "varchar(100)"
},
{
"Default": "0",
"Extra": "",
"Field": "role_id",
"Key": "",
"Null": "YES",
"Type": "int(11)"
},
{
"Default": null,
"Extra": "",
"Field": "title",
"Key": "",
"Null": "YES",
"Type": "varchar(100)"
},
{
"Default": null,
"Extra": "",
"Field": "create_time",
"Key": "",
"Null": "YES",
"Type": "datetime"
},
{
"Default": null,
"Extra": "",
"Field": "modify_time",
"Key": "",
"Null": "YES",
"Type": "datetime"
}
],
"sample_data": [
{
"create_time": "2026-03-20 02:32:47",
"id": 1,
"modify_time": "2026-03-20 02:32:47",
"name": "超级管理员",
"password": "admin123",
"phone": "13800000001",
"role_id": 1,
"state": 1,
"title": "系统管理员"
},
{
"create_time": "2026-03-20 02:32:47",
"id": 2,
"modify_time": "2026-03-20 02:32:47",
"name": "编辑员",
"password": "editor123",
"phone": "13800000002",
"role_id": 2,
"state": 1,
"title": "内容编辑"
},
{
"create_time": "2026-03-20 02:32:47",
"id": 3,
"modify_time": "2026-03-20 02:32:47",
"name": "审核员",
"password": "review123",
"phone": "13800000003",
"role_id": 3,
"state": 1,
"title": "内容审核"
},
{
"create_time": "2026-03-20 02:43:03",
"id": 6,
"modify_time": "2026-03-20 02:43:03",
"name": "测试管理员_1773974584",
"password": "test123456",
"phone": "13873974584",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-20 02:43:09",
"id": 9,
"modify_time": "2026-03-20 02:43:09",
"name": "测试管理员_1773974590",
"password": "test123456",
"phone": "13873974590",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-20 02:50:47",
"id": 12,
"modify_time": "2026-03-20 02:50:47",
"name": "测试管理员_1773975048",
"password": "test123456",
"phone": "13873975048",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-20 02:57:19",
"id": 18,
"modify_time": "2026-03-20 02:57:19",
"name": "测试管理员_1773975440",
"password": "test123456",
"phone": "13873975440",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-29 16:47:48",
"id": 22,
"modify_time": "2026-03-29 16:47:48",
"name": "测试管理员_1774802868",
"password": "test123456",
"phone": "13874802868",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-29 16:47:49",
"id": 25,
"modify_time": "2026-03-29 16:47:50",
"name": "测试管理员_1774802869",
"password": "test123456",
"phone": "13874802869",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
},
{
"create_time": "2026-03-29 16:54:20",
"id": 28,
"modify_time": "2026-03-29 16:54:20",
"name": "测试管理员_1774803260",
"password": "test123456",
"phone": "13874803260",
"role_id": 1,
"state": 1,
"title": "更新后的职位"
}
],
"table": "admin"
2026-03-20 10:46:51 +08:00
},
"status": 0
},
"expect": {
"result": {
"columns": [],
"sample_data": [],
"table": "sample"
},
"status": 0
2026-03-20 10:46:51 +08:00
}
}
],
"ctr": "mysql",
"method": "GET",
"params": [
{
"name": "table",
"required": false,
"type": "string",
"in": "query"
}
],
"path": "/app/mysql/describe",
"project": "app",
"summary": "查询 MySQL 表结构",
"tested": true
},
{
"cases": [
{
"name": "MySQL原生SQL",
"method": "GET",
"passed": true,
"response": {
"result": {
"name": "MySQL原生SQL测试",
"success": true,
"tests": [
{
"count": 5,
"name": "Query 原生查询 (反引号)",
"result": true
},
{
"affected": 1,
"name": "Exec 原生执行 (反引号)",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT id, title FROM `article` WHERE id IN (?, ?, ?, ?, ?) LIMIT 10",
"name": "IN (?) 非空数组展开",
"result": true
},
{
"count": 0,
"lastQuery": "SELECT id, title FROM `article` WHERE 1=0 LIMIT 10",
"name": "IN (?) 空数组替换为1=0",
"result": true
},
{
"count": 10,
"lastQuery": "SELECT id, title FROM `article` WHERE 1=1 LIMIT 10",
"name": "NOT IN (?) 空数组替换为1=1",
"result": true
}
]
2026-03-20 10:46:51 +08:00
},
"status": 0
},
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"status": 0
2026-03-20 10:46:51 +08:00
}
}
],
"ctr": "mysql",
"method": "GET",
"params": [],
"path": "/app/mysql/rawsql",
"project": "app",
"summary": "MySQL 原生 SQL 测试",
"tested": true
},
{
"cases": [
{
"name": "SHOW TABLES",
"method": "GET",
"passed": true,
"response": {
"result": {
"tables": [
{
"Tables_in_test": "体育"
},
{
"Tables_in_test": "军事"
},
{
"Tables_in_test": "历史"
},
{
"Tables_in_test": "地理"
},
{
"Tables_in_test": "外语"
},
{
"Tables_in_test": "天文"
},
{
"Tables_in_test": "影音"
},
{
"Tables_in_test": "数学"
},
{
"Tables_in_test": "数学1"
},
{
"Tables_in_test": "文学"
},
{
"Tables_in_test": "生物"
},
{
"Tables_in_test": "综合"
},
{
"Tables_in_test": "admin"
},
{
"Tables_in_test": "article"
},
{
"Tables_in_test": "auth_role"
},
{
"Tables_in_test": "auth_user"
},
{
"Tables_in_test": "cached"
},
{
"Tables_in_test": "ctg"
},
{
"Tables_in_test": "history"
},
{
"Tables_in_test": "hotime_cache"
},
{
"Tables_in_test": "ibang0420_iqiyi"
},
{
"Tables_in_test": "question"
},
{
"Tables_in_test": "role"
},
{
"Tables_in_test": "role_user"
},
{
"Tables_in_test": "stroage"
},
{
"Tables_in_test": "test_batch"
},
{
"Tables_in_test": "user"
},
{
"Tables_in_test": "version"
}
]
2026-03-20 10:46:51 +08:00
},
"status": 0
},
"expect": {
"result": {
"tables": []
},
"status": 0
2026-03-20 10:46:51 +08:00
}
}
],
"ctr": "mysql",
"method": "GET",
"params": [],
"path": "/app/mysql/tables",
"project": "app",
"summary": "查询 MySQL 所有表",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "聚合函数",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "聚合函数测试",
"success": true,
"tests": [
{
"count": 99,
2026-03-20 10:46:51 +08:00
"name": "Count 总数统计",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "Count 条件统计",
"result": true
},
{
"lastQuery": "SELECT SUM(click_num) FROM \"article\" WHERE \"state\" =? ;",
"name": "Sum 求和 (单字段名)",
"result": true,
"sum": 110799
2026-03-20 10:46:51 +08:00
},
{
"avg": 1367.888889,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT AVG(click_num) FROM \"article\" WHERE \"state\" =? ;",
"name": "Avg 平均值 (单字段名)",
"result": true
},
{
"lastQuery": "SELECT MAX(click_num) FROM \"article\" WHERE \"state\" =? ;",
"max": 9999,
2026-03-20 10:46:51 +08:00
"name": "Max 最大值 (单字段名)",
"result": true
},
{
"lastQuery": "SELECT MIN(sort) FROM \"article\" WHERE \"state\" =? ;",
"min": 1,
2026-03-20 10:46:51 +08:00
"name": "Min 最小值 (单字段名)",
"result": true
},
{
"name": "GROUP BY 分组统计",
"result": true,
"stats": [
{
"article_count": 36,
2026-03-20 10:46:51 +08:00
"avg_clicks": "450",
"ctg_id": 2,
"total_clicks": 16200
2026-03-20 10:46:51 +08:00
},
{
"article_count": 27,
2026-03-20 10:46:51 +08:00
"avg_clicks": "3461",
"ctg_id": 1,
"total_clicks": 93447
2026-03-20 10:46:51 +08:00
},
{
"article_count": 9,
2026-03-20 10:46:51 +08:00
"avg_clicks": "32",
"ctg_id": 3,
"total_clicks": 288
2026-03-20 10:46:51 +08:00
},
{
"article_count": 9,
2026-03-20 10:46:51 +08:00
"avg_clicks": "96",
"ctg_id": 4,
"total_clicks": 864
2026-03-20 10:46:51 +08:00
}
]
},
{
"lastQuery": "SELECT SUM(\"article\".\"click_num\") FROM \"article\" WHERE \"state\" =? ;",
"match_single_field": false,
2026-03-20 10:46:51 +08:00
"name": "Sum 求和 (table.column 格式)",
"result": true,
"sum": 0
},
{
"name": "聚合函数一致性验证",
"result": false,
"summary": "Sum: 110799=0, Avg: 1367.888889=0, Max: 9999=0, Min: 1=0"
2026-03-20 10:46:51 +08:00
},
{
"lastQuery": "SELECT SUM(\"article\".\"click_num\") FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? ;",
"name": "Sum 带 JOIN (table.column 格式)",
"result": true,
"sum": 0
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT COUNT(*) FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? ;",
"name": "Count 带 JOIN",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/aggregate",
"project": "app",
"summary": "聚合函数测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"1_basic_crud": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"2_condition_syntax": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"3_chain_query": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"4_join_query": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"5_aggregate": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"6_pagination": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"7_batch_insert": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"8_upsert": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"9_transaction": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
}
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "全部测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"1_basic_crud": {
"name": "基础CRUD测试",
"success": true,
"tests": [
{
"adminId": 97,
"lastQuery": "INSERT INTO \"admin\" (\"create_time\",\"modify_time\",\"name\",\"phone\",\"state\",\"password\",\"role_id\",\"title\") VALUES (NOW(),NOW(),?,?,?,?,?,?);",
2026-03-20 10:46:51 +08:00
"name": "Insert 插入测试 (admin表)",
"result": true
},
{
"admin": {
"create_time": "2026-03-30 01:10:06",
"id": 97,
"modify_time": "2026-03-30 01:10:06",
"name": "测试管理员_1774804206",
2026-03-20 10:46:51 +08:00
"password": "test123456",
"phone": "13874804206",
2026-03-20 10:46:51 +08:00
"role_id": 1,
"state": 1,
"title": "测试职位"
},
"name": "Get 获取单条记录测试",
"result": true
2026-03-20 10:46:51 +08:00
},
{
"count": 4,
"name": "Select 单条件查询测试",
"result": true
},
{
"count": 4,
"lastQuery": "SELECT * FROM \"admin\" WHERE \"role_id\" \u003e? AND \"state\" =? ORDER BY id DESC LIMIT 5 ;",
"name": "Select 多条件自动AND测试",
"result": true
},
{
"affected": 1,
"name": "Update 更新测试",
"result": true
},
{
"affected": 1,
"name": "Delete 删除测试",
"result": true
}
]
},
"2_condition_syntax": {
"name": "条件查询语法测试",
"success": true,
"tests": [
{
"count": 3,
"name": "等于条件 (=)",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,state FROM \"article\" WHERE \"state\" !=? LIMIT 3 ;",
"name": "不等于条件 ([!])",
"result": true
},
{
"count": 3,
"name": "大于小于条件 ([\u003e], [\u003c])",
"result": true
},
{
"count": 3,
"name": "大于等于小于等于条件 ([\u003e=], [\u003c=])",
"result": true
},
{
"count": 3,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT id,title FROM \"article\" WHERE \"title\" LIKE ? LIMIT 3 ;",
"name": "LIKE 模糊查询 ([~])",
"result": true
},
{
"count": 0,
"name": "右模糊查询 ([~!])",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,click_num FROM \"article\" WHERE \"click_num\" BETWEEN ? AND ? LIMIT 3 ;",
"name": "BETWEEN 区间查询 ([\u003c\u003e])",
"result": true
},
{
"count": 3,
"name": "NOT BETWEEN 查询 ([\u003e\u003c])",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT id,title FROM \"article\" WHERE (\"id\" BETWEEN ? AND ? ) LIMIT 5 ;",
"name": "IN 查询",
"result": true
},
{
"count": 5,
"name": "NOT IN 查询 ([!])",
"result": true
},
{
"count": 3,
"name": "IS NULL 查询",
"result": true
},
{
"count": 3,
"name": "IS NOT NULL 查询 ([!])",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,create_time FROM \"article\" WHERE \"create_time\" \u003e DATEADD(DAY, -365, NOW()) LIMIT 3 ;",
"name": "直接 SQL 片段查询 ([##])",
"result": true
},
{
"count": 3,
"name": "显式 AND 条件",
"result": true
},
{
"count": 5,
"name": "OR 条件",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT id,title,sort,state FROM \"article\" WHERE (( \"click_num\" \u003e? OR \"sort\" \u003e=? ) AND \"state\" =?) LIMIT 5 ;",
"name": "嵌套 AND/OR 条件",
"result": true
}
]
},
"3_chain_query": {
"name": "链式查询测试",
"success": true,
"tests": [
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "基本链式查询 Table().Where().Select()",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 And 条件",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 Or 条件",
"result": true
},
{
"count": 5,
"name": "链式 Order 排序",
"result": true
},
{
"count": 3,
"name": "链式 Limit 限制",
"result": true
},
{
"article": {
"author": "管理员",
"id": 1,
"title": "数据库入门指南"
},
"name": "链式 Get 获取单条",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 Count 统计",
"result": true
},
{
"count": 5,
"name": "链式 Page 分页",
"result": true
},
{
"name": "链式 Group 分组",
"result": true,
"stats": [
{
"cnt": 27,
2026-03-20 10:46:51 +08:00
"ctg_id": 1
},
{
"cnt": 36,
2026-03-20 10:46:51 +08:00
"ctg_id": 2
},
{
"cnt": 9,
2026-03-20 10:46:51 +08:00
"ctg_id": 3
},
{
"cnt": 9,
2026-03-20 10:46:51 +08:00
"ctg_id": 4
}
]
},
{
"affected": 1,
2026-03-20 10:46:51 +08:00
"name": "链式 Update 更新",
"result": true
}
]
},
"4_join_query": {
"name": "JOIN查询测试",
"success": true,
"tests": [
{
"count": 5,
"data": [
{
"ctg_name": "新闻资讯",
"id": 1,
"title": "数据库入门指南"
},
{
"ctg_name": "新闻资讯",
"id": 2,
"title": "新闻发布系统上线公告"
},
{
"ctg_name": "技术文档",
"id": 3,
"title": "Go语言最佳实践"
},
{
"ctg_name": "技术文档",
"id": 4,
"title": "API接口设计规范"
},
{
"ctg_name": "公告通知",
"id": 5,
"title": "系统维护通知"
}
],
"name": "LEFT JOIN 链式查询",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT \"article\".\"id\", \"article\".\"title\", \"ctg\".\"name\" as ctg_name FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? LIMIT 5 ;",
"name": "传统 JOIN 语法",
"result": true
},
{
"count": 5,
"data": [
{
"admin_name": "超级管理员",
"ctg_name": "新闻资讯",
"id": 1,
"title": "数据库入门指南"
},
{
"admin_name": "编辑员",
"ctg_name": "新闻资讯",
"id": 2,
"title": "新闻发布系统上线公告"
},
{
"admin_name": "超级管理员",
"ctg_name": "技术文档",
"id": 3,
"title": "Go语言最佳实践"
},
{
"admin_name": "审核员",
"ctg_name": "技术文档",
"id": 4,
"title": "API接口设计规范"
},
{
"admin_name": "超级管理员",
"ctg_name": "公告通知",
"id": 5,
"title": "系统维护通知"
}
],
"name": "多表 JOIN",
"result": true
},
{
"count": 5,
"name": "INNER JOIN",
"result": true
}
]
},
"5_aggregate": {
"name": "聚合函数测试",
"success": true,
"tests": [
{
"count": 99,
2026-03-20 10:46:51 +08:00
"name": "Count 总数统计",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "Count 条件统计",
"result": true
},
{
"lastQuery": "SELECT SUM(click_num) FROM \"article\" WHERE \"state\" =? ;",
"name": "Sum 求和 (单字段名)",
"result": true,
"sum": 110799
2026-03-20 10:46:51 +08:00
},
{
"avg": 1367.888889,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT AVG(click_num) FROM \"article\" WHERE \"state\" =? ;",
"name": "Avg 平均值 (单字段名)",
"result": true
},
{
"lastQuery": "SELECT MAX(click_num) FROM \"article\" WHERE \"state\" =? ;",
"max": 9999,
2026-03-20 10:46:51 +08:00
"name": "Max 最大值 (单字段名)",
"result": true
},
{
"lastQuery": "SELECT MIN(sort) FROM \"article\" WHERE \"state\" =? ;",
"min": 1,
2026-03-20 10:46:51 +08:00
"name": "Min 最小值 (单字段名)",
"result": true
},
{
"name": "GROUP BY 分组统计",
"result": true,
"stats": [
{
"article_count": 36,
2026-03-20 10:46:51 +08:00
"avg_clicks": "450",
"ctg_id": 2,
"total_clicks": 16200
2026-03-20 10:46:51 +08:00
},
{
"article_count": 27,
2026-03-20 10:46:51 +08:00
"avg_clicks": "3461",
"ctg_id": 1,
"total_clicks": 93447
2026-03-20 10:46:51 +08:00
},
{
"article_count": 9,
2026-03-20 10:46:51 +08:00
"avg_clicks": "32",
"ctg_id": 3,
"total_clicks": 288
2026-03-20 10:46:51 +08:00
},
{
"article_count": 9,
2026-03-20 10:46:51 +08:00
"avg_clicks": "96",
"ctg_id": 4,
"total_clicks": 864
2026-03-20 10:46:51 +08:00
}
]
},
{
"lastQuery": "SELECT SUM(\"article\".\"click_num\") FROM \"article\" WHERE \"state\" =? ;",
"match_single_field": false,
2026-03-20 10:46:51 +08:00
"name": "Sum 求和 (table.column 格式)",
"result": true,
"sum": 0
},
{
"name": "聚合函数一致性验证",
"result": false,
"summary": "Sum: 110799=0, Avg: 1367.888889=0, Max: 9999=0, Min: 1=0"
2026-03-20 10:46:51 +08:00
},
{
"lastQuery": "SELECT SUM(\"article\".\"click_num\") FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? ;",
"name": "Sum 带 JOIN (table.column 格式)",
"result": true,
"sum": 0
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT COUNT(*) FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? ;",
"name": "Count 带 JOIN",
"result": true
}
]
},
"6_pagination": {
"name": "分页查询测试",
"success": true,
"tests": [
{
"count": 5,
"name": "PageSelect 分页查询",
"result": true
},
{
"count": 5,
2026-03-20 10:46:51 +08:00
"name": "PageSelect 第二页",
"result": true
},
{
"count": 3,
"name": "链式 Page 分页",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title FROM \"article\" WHERE (\"state\" =?) LIMIT 3 OFFSET 2 ;",
"name": "Offset 偏移查询",
"result": true
}
]
},
"7_batch_insert": {
"name": "批量插入测试",
"success": true,
"tests": [
{
"affected": 3,
"lastQuery": "INSERT INTO \"test_batch\" (\"name\", \"state\", \"title\") VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?)",
"name": "Inserts 批量插入",
"result": true
},
{
"affected": 2,
"name": "Inserts 带 [#] 标记",
"result": true
}
]
},
"8_upsert": {
"name": "Upsert测试",
"success": true,
"tests": [
{
"affected": 1,
"lastQuery": "MERGE INTO \"admin\" USING (SELECT ? AS \"title\", NOW() AS \"create_time\", NOW() AS \"modify_time\", ? AS \"name\", ? AS \"phone\", ? AS \"state\", ? AS \"password\", ? AS \"role_id\") src ON (\"admin\".\"phone\" = src.\"phone\") WHEN MATCHED THEN UPDATE SET \"name\" = src.\"name\", \"state\" = src.\"state\", \"title\" = src.\"title\", \"modify_time\" = NOW() WHEN NOT MATCHED THEN INSERT (\"title\", \"create_time\", \"modify_time\", \"name\", \"phone\", \"state\", \"password\", \"role_id\") VALUES (src.\"title\", src.\"create_time\", src.\"modify_time\", src.\"name\", src.\"phone\", src.\"state\", src.\"password\", src.\"role_id\")",
2026-03-20 10:46:51 +08:00
"name": "Upsert 插入新记录 (admin表)",
"result": true
},
{
"affected": 1,
"name": "Upsert 更新已存在记录",
"result": true,
"updatedAdmin": {
"create_time": "2026-03-30 01:10:10",
"id": 98,
"modify_time": "2026-03-30 01:10:10",
2026-03-20 10:46:51 +08:00
"name": "Upsert更新后管理员",
"password": "test123",
"phone": "19974804210",
2026-03-20 10:46:51 +08:00
"role_id": 2,
"state": 1,
"title": "更新后职位"
}
}
]
},
"9_transaction": {
"name": "事务测试",
"success": true,
"tests": [
{
"name": "事务成功提交",
"recordExists": true,
"result": true
},
{
"name": "事务回滚",
"recordRolledBack": true,
"result": true
}
]
}
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/all",
"project": "app",
"summary": "运行全部通用测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "批量插入",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "批量插入测试",
"success": true,
"tests": [
{
"affected": 3,
"lastQuery": "INSERT INTO \"test_batch\" (\"name\", \"state\", \"title\") VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?)",
"name": "Inserts 批量插入",
"result": true
},
{
"affected": 2,
"name": "Inserts 带 [#] 标记",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/batch",
"project": "app",
"summary": "批量插入测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "链式查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "链式查询测试",
"success": true,
"tests": [
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "基本链式查询 Table().Where().Select()",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 And 条件",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 Or 条件",
"result": true
},
{
"count": 5,
"name": "链式 Order 排序",
"result": true
},
{
"count": 3,
"name": "链式 Limit 限制",
"result": true
},
{
"article": {
"author": "管理员",
"id": 1,
"title": "数据库入门指南"
},
"name": "链式 Get 获取单条",
"result": true
},
{
"count": 81,
2026-03-20 10:46:51 +08:00
"name": "链式 Count 统计",
"result": true
},
{
"count": 5,
"name": "链式 Page 分页",
"result": true
},
{
"name": "链式 Group 分组",
"result": true,
"stats": [
{
"cnt": 27,
2026-03-20 10:46:51 +08:00
"ctg_id": 1
},
{
"cnt": 36,
2026-03-20 10:46:51 +08:00
"ctg_id": 2
},
{
"cnt": 9,
2026-03-20 10:46:51 +08:00
"ctg_id": 3
},
{
"cnt": 9,
2026-03-20 10:46:51 +08:00
"ctg_id": 4
}
]
},
{
"affected": 1,
2026-03-20 10:46:51 +08:00
"name": "链式 Update 更新",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/chain",
"project": "app",
"summary": "链式查询测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "条件查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "条件查询语法测试",
"success": true,
"tests": [
{
"count": 3,
"name": "等于条件 (=)",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,state FROM \"article\" WHERE \"state\" !=? LIMIT 3 ;",
"name": "不等于条件 ([!])",
"result": true
},
{
"count": 3,
"name": "大于小于条件 ([\u003e], [\u003c])",
"result": true
},
{
"count": 3,
"name": "大于等于小于等于条件 ([\u003e=], [\u003c=])",
"result": true
},
{
"count": 3,
2026-03-20 10:46:51 +08:00
"lastQuery": "SELECT id,title FROM \"article\" WHERE \"title\" LIKE ? LIMIT 3 ;",
"name": "LIKE 模糊查询 ([~])",
"result": true
},
{
"count": 0,
"name": "右模糊查询 ([~!])",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,click_num FROM \"article\" WHERE \"click_num\" BETWEEN ? AND ? LIMIT 3 ;",
"name": "BETWEEN 区间查询 ([\u003c\u003e])",
"result": true
},
{
"count": 3,
"name": "NOT BETWEEN 查询 ([\u003e\u003c])",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT id,title FROM \"article\" WHERE (\"id\" BETWEEN ? AND ? ) LIMIT 5 ;",
"name": "IN 查询",
"result": true
},
{
"count": 5,
"name": "NOT IN 查询 ([!])",
"result": true
},
{
"count": 3,
"name": "IS NULL 查询",
"result": true
},
{
"count": 3,
"name": "IS NOT NULL 查询 ([!])",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title,create_time FROM \"article\" WHERE \"create_time\" \u003e DATEADD(DAY, -365, NOW()) LIMIT 3 ;",
"name": "直接 SQL 片段查询 ([##])",
"result": true
},
{
"count": 3,
"name": "显式 AND 条件",
"result": true
},
{
"count": 5,
"name": "OR 条件",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT id,title,sort,state FROM \"article\" WHERE (( \"click_num\" \u003e? OR \"sort\" \u003e=? ) AND \"state\" =?) LIMIT 5 ;",
"name": "嵌套 AND/OR 条件",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/condition",
"project": "app",
"summary": "条件查询语法测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample",
"result": true
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "CRUD测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "基础CRUD测试",
"success": true,
"tests": [
{
"adminId": 99,
"lastQuery": "INSERT INTO \"admin\" (\"title\",\"create_time\",\"modify_time\",\"name\",\"phone\",\"state\",\"password\",\"role_id\") VALUES (?,NOW(),NOW(),?,?,?,?,?);",
2026-03-20 10:46:51 +08:00
"name": "Insert 插入测试 (admin表)",
"result": true
},
{
"admin": {
"create_time": "2026-03-30 01:10:11",
"id": 99,
"modify_time": "2026-03-30 01:10:11",
"name": "测试管理员_1774804211",
2026-03-20 10:46:51 +08:00
"password": "test123456",
"phone": "13874804211",
2026-03-20 10:46:51 +08:00
"role_id": 1,
"state": 1,
"title": "测试职位"
},
"name": "Get 获取单条记录测试",
"result": true
2026-03-20 10:46:51 +08:00
},
{
"count": 4,
"name": "Select 单条件查询测试",
"result": true
},
{
"count": 4,
"lastQuery": "SELECT * FROM \"admin\" WHERE \"role_id\" \u003e? AND \"state\" =? ORDER BY id DESC LIMIT 5 ;",
"name": "Select 多条件自动AND测试",
"result": true
},
{
"affected": 1,
"name": "Update 更新测试",
"result": true
},
{
"affected": 1,
"name": "Delete 删除测试",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/crud",
"project": "app",
"summary": "基础 CRUD 测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "JOIN查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "JOIN查询测试",
"success": true,
"tests": [
{
"count": 5,
"data": [
{
"ctg_name": "新闻资讯",
"id": 1,
"title": "数据库入门指南"
},
{
"ctg_name": "新闻资讯",
"id": 2,
"title": "新闻发布系统上线公告"
},
{
"ctg_name": "技术文档",
"id": 3,
"title": "Go语言最佳实践"
},
{
"ctg_name": "技术文档",
"id": 4,
"title": "API接口设计规范"
},
{
"ctg_name": "公告通知",
"id": 5,
"title": "系统维护通知"
}
],
"name": "LEFT JOIN 链式查询",
"result": true
},
{
"count": 5,
"lastQuery": "SELECT \"article\".\"id\", \"article\".\"title\", \"ctg\".\"name\" as ctg_name FROM \"article\" LEFT JOIN \"ctg\" ON \"article\".\"ctg_id\" = \"ctg\".\"id\" WHERE \"article\".\"state\" =? LIMIT 5 ;",
"name": "传统 JOIN 语法",
"result": true
},
{
"count": 5,
"data": [
{
"admin_name": "超级管理员",
"ctg_name": "新闻资讯",
"id": 1,
"title": "数据库入门指南"
},
{
"admin_name": "编辑员",
"ctg_name": "新闻资讯",
"id": 2,
"title": "新闻发布系统上线公告"
},
{
"admin_name": "超级管理员",
"ctg_name": "技术文档",
"id": 3,
"title": "Go语言最佳实践"
},
{
"admin_name": "审核员",
"ctg_name": "技术文档",
"id": 4,
"title": "API接口设计规范"
},
{
"admin_name": "超级管理员",
"ctg_name": "公告通知",
"id": 5,
"title": "系统维护通知"
}
],
"name": "多表 JOIN",
"result": true
},
{
"count": 5,
"name": "INNER JOIN",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/join",
"project": "app",
"summary": "JOIN 查询测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "分页查询",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "分页查询测试",
"success": true,
"tests": [
{
"count": 5,
"name": "PageSelect 分页查询",
"result": true
},
{
"count": 5,
2026-03-20 10:46:51 +08:00
"name": "PageSelect 第二页",
"result": true
},
{
"count": 3,
"name": "链式 Page 分页",
"result": true
},
{
"count": 3,
"lastQuery": "SELECT id,title FROM \"article\" WHERE (\"state\" =?) LIMIT 3 OFFSET 2 ;",
"name": "Offset 偏移查询",
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/pagination",
"project": "app",
"summary": "分页查询测试",
"tested": true
},
{
"cases": [
{
"expect": {
"error": {
"msg": "dsadasd",
"type": "访问权限异常"
},
"result": {
"msg": "dsadasd",
"type": "访问权限异常"
},
"status": 2
},
"method": "GET",
"name": "固定返回错误码2",
"passed": true,
"response": {
"error": {
"msg": "dsadasd",
"type": "访问权限异常"
},
"result": {
"msg": "dsadasd",
"type": "访问权限异常"
},
"status": 2
}
}
],
2026-03-20 10:46:51 +08:00
"ctr": "test",
"method": "GET",
2026-03-20 10:46:51 +08:00
"params": [],
"path": "/app/test/test",
"project": "app",
"summary": "固定错误返回",
"tested": true
2026-03-20 10:46:51 +08:00
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "事务测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "事务测试",
"success": true,
"tests": [
{
"name": "事务成功提交",
"recordExists": true,
"result": true
},
{
"name": "事务回滚",
"recordRolledBack": true,
"result": true
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/transaction",
"project": "app",
"summary": "事务测试",
"tested": true
},
{
"cases": [
{
"expect": {
"result": {
"name": "sample",
"success": true,
"tests": [
{
"name": "sample"
}
]
},
"status": 0
},
2026-03-20 10:46:51 +08:00
"method": "GET",
"name": "Upsert测试",
2026-03-20 10:46:51 +08:00
"passed": true,
"response": {
"result": {
"name": "Upsert测试",
"success": true,
"tests": [
{
"affected": 1,
"lastQuery": "MERGE INTO \"admin\" USING (SELECT ? AS \"title\", NOW() AS \"create_time\", NOW() AS \"modify_time\", ? AS \"name\", ? AS \"phone\", ? AS \"state\", ? AS \"password\", ? AS \"role_id\") src ON (\"admin\".\"phone\" = src.\"phone\") WHEN MATCHED THEN UPDATE SET \"name\" = src.\"name\", \"state\" = src.\"state\", \"title\" = src.\"title\", \"modify_time\" = NOW() WHEN NOT MATCHED THEN INSERT (\"title\", \"create_time\", \"modify_time\", \"name\", \"phone\", \"state\", \"password\", \"role_id\") VALUES (src.\"title\", src.\"create_time\", src.\"modify_time\", src.\"name\", src.\"phone\", src.\"state\", src.\"password\", src.\"role_id\")",
2026-03-20 10:46:51 +08:00
"name": "Upsert 插入新记录 (admin表)",
"result": true
},
{
"affected": 1,
"name": "Upsert 更新已存在记录",
"result": true,
"updatedAdmin": {
"create_time": "2026-03-30 01:10:03",
"id": 96,
"modify_time": "2026-03-30 01:10:03",
2026-03-20 10:46:51 +08:00
"name": "Upsert更新后管理员",
"password": "test123",
"phone": "19974804203",
2026-03-20 10:46:51 +08:00
"role_id": 2,
"state": 1,
"title": "更新后职位"
}
}
]
},
"status": 0
}
}
],
"ctr": "test",
"method": "GET",
"params": [],
"path": "/app/test/upsert",
"project": "app",
"summary": "Upsert 测试",
"tested": true
}
],
"title": "My API",
"version": "1.0.0"
}