mm_dao 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/index.js +3 -13
- package/lib/admin.js +24 -0
- package/lib/dao.js +38 -1219
- package/lib/dao_crud.js +379 -0
- package/lib/dao_fields.js +145 -0
- package/lib/dao_query.js +238 -0
- package/lib/dao_scope.js +203 -0
- package/lib/dao_stats.js +129 -0
- package/lib/dao_transfer.js +358 -0
- package/lib/manager.js +40 -18
- package/lib/script.tpl.js +4 -4
- package/package.json +70 -63
- package/tool/dao/index.js +176 -0
- package/tool/dao/tool.json +121 -0
- package/tool/dao_admin/index.js +36 -0
- package/tool/dao_admin/tool.json +11 -0
- package/db/mm/user_account/_meta.json +0 -54
- package/db/mm.db +0 -0
- package/eslint.config.js +0 -235
- package/example/index.js +0 -78
- package/test_db/dao_test_1785991977965/account/1.json +0 -6
- package/test_db/dao_test_1785991977965/account/2.json +0 -6
- package/test_db/dao_test_1785991977965/account/_meta.json +0 -18
- package/test_db/dao_test_1785991977965/role/1.json +0 -7
- package/test_db/dao_test_1785991977965/role/2.json +0 -7
- package/test_db/dao_test_1785991977965/role/3.json +0 -7
- package/test_db/dao_test_1785991977965/role/_meta.json +0 -18
- package/test_db/dao_test_1785991977965/tool/_meta.json +0 -18
- package/test_db/dao_test_1785991977965/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785991977965/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785991977965/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785991977965/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785991977965/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785993793800/account/1.json +0 -58
- package/test_db/dao_test_1785993793800/account/2.json +0 -25
- package/test_db/dao_test_1785993793800/account/_meta.json +0 -18
- package/test_db/dao_test_1785993793800/role/1.json +0 -7
- package/test_db/dao_test_1785993793800/role/2.json +0 -7
- package/test_db/dao_test_1785993793800/role/3.json +0 -7
- package/test_db/dao_test_1785993793800/role/_meta.json +0 -18
- package/test_db/dao_test_1785993793800/tool/_meta.json +0 -18
- package/test_db/dao_test_1785993793800/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785993793800/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785993793800/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785993793800/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785993793800/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785993841615/account/1.json +0 -58
- package/test_db/dao_test_1785993841615/account/2.json +0 -25
- package/test_db/dao_test_1785993841615/account/_meta.json +0 -18
- package/test_db/dao_test_1785993841615/role/1.json +0 -7
- package/test_db/dao_test_1785993841615/role/2.json +0 -7
- package/test_db/dao_test_1785993841615/role/3.json +0 -7
- package/test_db/dao_test_1785993841615/role/_meta.json +0 -18
- package/test_db/dao_test_1785993841615/tool/_meta.json +0 -18
- package/test_db/dao_test_1785993841615/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785993841615/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785993841615/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785993841615/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785993841615/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785998204124/account/1.json +0 -58
- package/test_db/dao_test_1785998204124/account/2.json +0 -25
- package/test_db/dao_test_1785998204124/account/_meta.json +0 -18
- package/test_db/dao_test_1785998204124/role/1.json +0 -7
- package/test_db/dao_test_1785998204124/role/2.json +0 -7
- package/test_db/dao_test_1785998204124/role/3.json +0 -7
- package/test_db/dao_test_1785998204124/role/_meta.json +0 -18
- package/test_db/dao_test_1785998204124/tool/_meta.json +0 -18
- package/test_db/dao_test_1785998204124/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785998204124/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785998204124/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785998204124/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785998204124/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785998207460/account/1.json +0 -58
- package/test_db/dao_test_1785998207460/account/2.json +0 -25
- package/test_db/dao_test_1785998207460/account/_meta.json +0 -18
- package/test_db/dao_test_1785998207460/role/1.json +0 -7
- package/test_db/dao_test_1785998207460/role/2.json +0 -7
- package/test_db/dao_test_1785998207460/role/3.json +0 -7
- package/test_db/dao_test_1785998207460/role/_meta.json +0 -18
- package/test_db/dao_test_1785998207460/tool/_meta.json +0 -18
- package/test_db/dao_test_1785998207460/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785998207460/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785998207460/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785998207460/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785998207460/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785998210638/account/1.json +0 -58
- package/test_db/dao_test_1785998210638/account/2.json +0 -25
- package/test_db/dao_test_1785998210638/account/_meta.json +0 -18
- package/test_db/dao_test_1785998210638/role/1.json +0 -7
- package/test_db/dao_test_1785998210638/role/2.json +0 -7
- package/test_db/dao_test_1785998210638/role/3.json +0 -7
- package/test_db/dao_test_1785998210638/role/_meta.json +0 -18
- package/test_db/dao_test_1785998210638/tool/_meta.json +0 -18
- package/test_db/dao_test_1785998210638/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785998210638/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785998210638/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785998210638/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785998210638/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785998213852/account/1.json +0 -58
- package/test_db/dao_test_1785998213852/account/2.json +0 -25
- package/test_db/dao_test_1785998213852/account/_meta.json +0 -18
- package/test_db/dao_test_1785998213852/role/1.json +0 -7
- package/test_db/dao_test_1785998213852/role/2.json +0 -7
- package/test_db/dao_test_1785998213852/role/3.json +0 -7
- package/test_db/dao_test_1785998213852/role/_meta.json +0 -18
- package/test_db/dao_test_1785998213852/tool/_meta.json +0 -18
- package/test_db/dao_test_1785998213852/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785998213852/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785998213852/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785998213852/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785998213852/tool/sword_001.json +0 -8
- package/test_db/dao_test_1785998217094/account/1.json +0 -58
- package/test_db/dao_test_1785998217094/account/2.json +0 -25
- package/test_db/dao_test_1785998217094/account/_meta.json +0 -18
- package/test_db/dao_test_1785998217094/role/1.json +0 -7
- package/test_db/dao_test_1785998217094/role/2.json +0 -7
- package/test_db/dao_test_1785998217094/role/3.json +0 -7
- package/test_db/dao_test_1785998217094/role/_meta.json +0 -18
- package/test_db/dao_test_1785998217094/tool/_meta.json +0 -18
- package/test_db/dao_test_1785998217094/tool/bow_001.json +0 -8
- package/test_db/dao_test_1785998217094/tool/robe_001.json +0 -8
- package/test_db/dao_test_1785998217094/tool/shield_001.json +0 -8
- package/test_db/dao_test_1785998217094/tool/staff_001.json +0 -8
- package/test_db/dao_test_1785998217094/tool/sword_001.json +0 -8
- package/test_db/dao_test_1786000291805/account/1.json +0 -58
- package/test_db/dao_test_1786000291805/account/2.json +0 -25
- package/test_db/dao_test_1786000291805/account/_meta.json +0 -18
- package/test_db/dao_test_1786000291805/role/1.json +0 -7
- package/test_db/dao_test_1786000291805/role/2.json +0 -7
- package/test_db/dao_test_1786000291805/role/3.json +0 -7
- package/test_db/dao_test_1786000291805/role/_meta.json +0 -18
- package/test_db/dao_test_1786000291805/tool/_meta.json +0 -18
- package/test_db/dao_test_1786000291805/tool/bow_001.json +0 -8
- package/test_db/dao_test_1786000291805/tool/robe_001.json +0 -8
- package/test_db/dao_test_1786000291805/tool/shield_001.json +0 -8
- package/test_db/dao_test_1786000291805/tool/staff_001.json +0 -8
- package/test_db/dao_test_1786000291805/tool/sword_001.json +0 -8
- package/test_db/dao_test_1786001183999/account/1.json +0 -58
- package/test_db/dao_test_1786001183999/account/2.json +0 -25
- package/test_db/dao_test_1786001183999/account/_meta.json +0 -18
- package/test_db/dao_test_1786001183999/role/1.json +0 -7
- package/test_db/dao_test_1786001183999/role/2.json +0 -7
- package/test_db/dao_test_1786001183999/role/3.json +0 -7
- package/test_db/dao_test_1786001183999/role/_meta.json +0 -18
- package/test_db/dao_test_1786001183999/tool/_meta.json +0 -18
- package/test_db/dao_test_1786001183999/tool/bow_001.json +0 -8
- package/test_db/dao_test_1786001183999/tool/robe_001.json +0 -8
- package/test_db/dao_test_1786001183999/tool/shield_001.json +0 -8
- package/test_db/dao_test_1786001183999/tool/staff_001.json +0 -8
- package/test_db/dao_test_1786001183999/tool/sword_001.json +0 -8
- package/test_db/dao_test_1786001297521/account/1.json +0 -58
- package/test_db/dao_test_1786001297521/account/2.json +0 -25
- package/test_db/dao_test_1786001297521/account/_meta.json +0 -18
- package/test_db/dao_test_1786001297521/role/1.json +0 -7
- package/test_db/dao_test_1786001297521/role/2.json +0 -7
- package/test_db/dao_test_1786001297521/role/3.json +0 -7
- package/test_db/dao_test_1786001297521/role/_meta.json +0 -18
- package/test_db/dao_test_1786001297521/tool/_meta.json +0 -18
- package/test_db/dao_test_1786001297521/tool/bow_001.json +0 -8
- package/test_db/dao_test_1786001297521/tool/robe_001.json +0 -8
- package/test_db/dao_test_1786001297521/tool/shield_001.json +0 -8
- package/test_db/dao_test_1786001297521/tool/staff_001.json +0 -8
- package/test_db/dao_test_1786001297521/tool/sword_001.json +0 -8
- package/test_db/debug_dao_1785992422444/account/1.json +0 -24
- package/test_db/debug_dao_1785992422444/account/_meta.json +0 -18
- package/test_db/debug_dao_1785992422444/role/1.json +0 -7
- package/test_db/debug_dao_1785992422444/role/2.json +0 -7
- package/test_db/debug_dao_1785992422444/role/_meta.json +0 -18
- package/test_db/debug_dao_1785992422444/tool/_meta.json +0 -18
- package/test_db/debug_dao_1785992422444/tool/shield_001.json +0 -7
- package/test_db/debug_dao_1785992422444/tool/staff_001.json +0 -7
- package/test_db/debug_dao_1785992422444/tool/sword_001.json +0 -7
- package/test_db/debug_dao_1785993785567/account/1.json +0 -47
- package/test_db/debug_dao_1785993785567/account/_meta.json +0 -18
- package/test_db/debug_dao_1785993785567/role/1.json +0 -7
- package/test_db/debug_dao_1785993785567/role/2.json +0 -7
- package/test_db/debug_dao_1785993785567/role/_meta.json +0 -18
- package/test_db/debug_dao_1785993785567/tool/_meta.json +0 -18
- package/test_db/debug_dao_1785993785567/tool/shield_001.json +0 -7
- package/test_db/debug_dao_1785993785567/tool/staff_001.json +0 -7
- package/test_db/debug_dao_1785993785567/tool/sword_001.json +0 -7
- package/test_db/debug_dao_check/tool/_meta.json +0 -18
- package/test_db/debug_dao_check/tool/sword_001.json +0 -6
- package/test_db/test_1785973671479/users/1.json +0 -5
- package/test_db/test_1785973671479/users/_meta.json +0 -20
- package/tests/dao_test.js +0 -213
- package/tests/debug_error_test.js +0 -165
- package/tests/debug_test.js +0 -35
- package/tests/debug_test2.js +0 -45
- package/tests/debug_test3.js +0 -54
- package/tests/detailed_error_test.js +0 -171
- package/tests/main.test.js +0 -261
- package/tests/query.test.js +0 -142
- package/tests/scope.test.js +0 -72
- package/tests/test.js +0 -325
- package/tests/test2.js +0 -64
package/example/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* mm_dao SQL 帮助模块示例
|
|
5
|
-
* 演示:获取 SQL 模板管理器、创建 Dao 驱动,并在内存中构建查询条件(无需连接数据库)。
|
|
6
|
-
* 注:管理器 add() 存在未定义 Drive 的缺陷,此处直接实例化 Dao 驱动演示核心 API。
|
|
7
|
-
* 运行:node example/index.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const { daoAdmin, Dao } = require('../index.js');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 创建一个纯内存的模拟数据库(仅实现 SQL 模板拼接,不连接真实数据库)
|
|
14
|
-
* @returns {object} 模拟数据库实例
|
|
15
|
-
*/
|
|
16
|
-
function createMockDb() {
|
|
17
|
-
return {
|
|
18
|
-
config: { filter: {} },
|
|
19
|
-
size: 30,
|
|
20
|
-
page: 0,
|
|
21
|
-
/**
|
|
22
|
-
* 过滤参数(无操作)
|
|
23
|
-
*/
|
|
24
|
-
filter() {},
|
|
25
|
-
/**
|
|
26
|
-
* 模板查询拼接
|
|
27
|
-
* @param {object} param 参数对象
|
|
28
|
-
* @param {object} sql_tpl 模板对象
|
|
29
|
-
* @returns {string} 拼接结果
|
|
30
|
-
*/
|
|
31
|
-
tplQuery(param, sql_tpl) {
|
|
32
|
-
const segments = [];
|
|
33
|
-
for (const key in param) {
|
|
34
|
-
const seg = sql_tpl[key]
|
|
35
|
-
? sql_tpl[key].replace(/\{0\}/g, param[key])
|
|
36
|
-
: '`' + key + "` = '" + param[key] + "'";
|
|
37
|
-
segments.push(seg);
|
|
38
|
-
}
|
|
39
|
-
return segments.join(' AND ');
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 主函数
|
|
46
|
-
* @returns {Promise<void>} 无返回值
|
|
47
|
-
*/
|
|
48
|
-
async function main() {
|
|
49
|
-
// 1. 获取 SQL 管理器(同 scope 复用实例)
|
|
50
|
-
const manager = daoAdmin('demo', { title: '示例SQL管理器' });
|
|
51
|
-
const manager2 = daoAdmin('demo');
|
|
52
|
-
console.log('管理器实例复用:', manager === manager2);
|
|
53
|
-
|
|
54
|
-
// 2. 创建 Dao 驱动(模板化增删改查)
|
|
55
|
-
const dao = new Dao(
|
|
56
|
-
{
|
|
57
|
-
name: 'user',
|
|
58
|
-
title: '用户表',
|
|
59
|
-
table: 'user_account',
|
|
60
|
-
key: 'user_id',
|
|
61
|
-
query: { name: "`name` like '%{0}%'", uid: '`uid` = {0}' }
|
|
62
|
-
},
|
|
63
|
-
manager
|
|
64
|
-
);
|
|
65
|
-
console.log('驱动类型:', dao instanceof Dao);
|
|
66
|
-
|
|
67
|
-
// 3. 构建查询条件(纯内存,无需数据库连接)
|
|
68
|
-
const where = dao.toWhere(createMockDb(), { name: '张三', uid: 1 }, 'get');
|
|
69
|
-
console.log('生成的WHERE条件:', where);
|
|
70
|
-
|
|
71
|
-
// 4. 驱动配置模型
|
|
72
|
-
console.log('驱动模型名称:', dao.getModel().name);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
main().catch((err) => {
|
|
76
|
-
console.error('示例执行失败:', err);
|
|
77
|
-
process.exit(1);
|
|
78
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "account",
|
|
3
|
-
"key": "username",
|
|
4
|
-
"auto_increment": 2,
|
|
5
|
-
"created_at": "2026-08-06T04:52:58.218Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "username",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "账户表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "role",
|
|
3
|
-
"key": "name",
|
|
4
|
-
"auto_increment": 3,
|
|
5
|
-
"created_at": "2026-08-06T04:52:58.249Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "name",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "角色表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "tool",
|
|
3
|
-
"key": "id",
|
|
4
|
-
"auto_increment": 0,
|
|
5
|
-
"created_at": "2026-08-06T04:52:58.259Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "id",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "道具表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"username": "player1",
|
|
3
|
-
"password": "123",
|
|
4
|
-
"email": "new_email@test.com",
|
|
5
|
-
"id": 1,
|
|
6
|
-
"role": {
|
|
7
|
-
"战士": {
|
|
8
|
-
"name": "战士",
|
|
9
|
-
"account_id": "player1",
|
|
10
|
-
"level": 10,
|
|
11
|
-
"exp": 500,
|
|
12
|
-
"id": 1,
|
|
13
|
-
"tool": {
|
|
14
|
-
"shield_001": {
|
|
15
|
-
"id": "shield_001",
|
|
16
|
-
"role_id": "战士",
|
|
17
|
-
"name": "铁盾",
|
|
18
|
-
"atk": 0,
|
|
19
|
-
"def": 30,
|
|
20
|
-
"type": "armor"
|
|
21
|
-
},
|
|
22
|
-
"sword_001": {
|
|
23
|
-
"id": "sword_001",
|
|
24
|
-
"role_id": "战士",
|
|
25
|
-
"name": "勇者之剑",
|
|
26
|
-
"atk": 100,
|
|
27
|
-
"def": 0,
|
|
28
|
-
"type": "weapon"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"法师": {
|
|
33
|
-
"name": "法师",
|
|
34
|
-
"account_id": "player1",
|
|
35
|
-
"level": 8,
|
|
36
|
-
"exp": 300,
|
|
37
|
-
"id": 2,
|
|
38
|
-
"tool": {
|
|
39
|
-
"robe_001": {
|
|
40
|
-
"id": "robe_001",
|
|
41
|
-
"role_id": "法师",
|
|
42
|
-
"name": "法师长袍",
|
|
43
|
-
"atk": 0,
|
|
44
|
-
"def": 20,
|
|
45
|
-
"type": "armor"
|
|
46
|
-
},
|
|
47
|
-
"staff_001": {
|
|
48
|
-
"id": "staff_001",
|
|
49
|
-
"role_id": "法师",
|
|
50
|
-
"name": "魔法杖",
|
|
51
|
-
"atk": 40,
|
|
52
|
-
"def": 0,
|
|
53
|
-
"type": "weapon"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"username": "player2",
|
|
3
|
-
"password": "456",
|
|
4
|
-
"email": "p2@test.com",
|
|
5
|
-
"id": 2,
|
|
6
|
-
"role": {
|
|
7
|
-
"弓箭手": {
|
|
8
|
-
"name": "弓箭手",
|
|
9
|
-
"account_id": "player2",
|
|
10
|
-
"level": 5,
|
|
11
|
-
"exp": 100,
|
|
12
|
-
"id": 3,
|
|
13
|
-
"tool": {
|
|
14
|
-
"bow_001": {
|
|
15
|
-
"id": "bow_001",
|
|
16
|
-
"role_id": "弓箭手",
|
|
17
|
-
"name": "精灵之弓",
|
|
18
|
-
"atk": 35,
|
|
19
|
-
"def": 0,
|
|
20
|
-
"type": "weapon"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "account",
|
|
3
|
-
"key": "username",
|
|
4
|
-
"auto_increment": 2,
|
|
5
|
-
"created_at": "2026-08-06T05:23:13.992Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "username",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "账户表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "role",
|
|
3
|
-
"key": "name",
|
|
4
|
-
"auto_increment": 3,
|
|
5
|
-
"created_at": "2026-08-06T05:23:14.016Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "name",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "角色表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "tool",
|
|
3
|
-
"key": "id",
|
|
4
|
-
"auto_increment": 0,
|
|
5
|
-
"created_at": "2026-08-06T05:23:14.029Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "id",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "道具表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"username": "player1",
|
|
3
|
-
"password": "123",
|
|
4
|
-
"email": "new_email@test.com",
|
|
5
|
-
"id": 1,
|
|
6
|
-
"role": {
|
|
7
|
-
"战士": {
|
|
8
|
-
"name": "战士",
|
|
9
|
-
"account_id": "player1",
|
|
10
|
-
"level": 15,
|
|
11
|
-
"exp": 500,
|
|
12
|
-
"id": 1,
|
|
13
|
-
"tool": {
|
|
14
|
-
"shield_001": {
|
|
15
|
-
"id": "shield_001",
|
|
16
|
-
"role_id": "战士",
|
|
17
|
-
"name": "铁盾",
|
|
18
|
-
"atk": 0,
|
|
19
|
-
"def": 30,
|
|
20
|
-
"type": "armor"
|
|
21
|
-
},
|
|
22
|
-
"sword_001": {
|
|
23
|
-
"id": "sword_001",
|
|
24
|
-
"role_id": "战士",
|
|
25
|
-
"name": "勇者之剑",
|
|
26
|
-
"atk": 100,
|
|
27
|
-
"def": 0,
|
|
28
|
-
"type": "weapon"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"法师": {
|
|
33
|
-
"name": "法师",
|
|
34
|
-
"account_id": "player1",
|
|
35
|
-
"level": 8,
|
|
36
|
-
"exp": 300,
|
|
37
|
-
"id": 2,
|
|
38
|
-
"tool": {
|
|
39
|
-
"robe_001": {
|
|
40
|
-
"id": "robe_001",
|
|
41
|
-
"role_id": "法师",
|
|
42
|
-
"name": "法师长袍",
|
|
43
|
-
"atk": 0,
|
|
44
|
-
"def": 20,
|
|
45
|
-
"type": "armor"
|
|
46
|
-
},
|
|
47
|
-
"staff_001": {
|
|
48
|
-
"id": "staff_001",
|
|
49
|
-
"role_id": "法师",
|
|
50
|
-
"name": "魔法杖",
|
|
51
|
-
"atk": 80,
|
|
52
|
-
"def": 0,
|
|
53
|
-
"type": "weapon"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"username": "player2",
|
|
3
|
-
"password": "456",
|
|
4
|
-
"email": "p2@test.com",
|
|
5
|
-
"id": 2,
|
|
6
|
-
"role": {
|
|
7
|
-
"弓箭手": {
|
|
8
|
-
"name": "弓箭手",
|
|
9
|
-
"account_id": "player2",
|
|
10
|
-
"level": 5,
|
|
11
|
-
"exp": 100,
|
|
12
|
-
"id": 3,
|
|
13
|
-
"tool": {
|
|
14
|
-
"bow_001": {
|
|
15
|
-
"id": "bow_001",
|
|
16
|
-
"role_id": "弓箭手",
|
|
17
|
-
"name": "精灵之弓",
|
|
18
|
-
"atk": 35,
|
|
19
|
-
"def": 0,
|
|
20
|
-
"type": "weapon"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "account",
|
|
3
|
-
"key": "username",
|
|
4
|
-
"auto_increment": 2,
|
|
5
|
-
"created_at": "2026-08-06T05:24:01.838Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "username",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "账户表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "role",
|
|
3
|
-
"key": "name",
|
|
4
|
-
"auto_increment": 3,
|
|
5
|
-
"created_at": "2026-08-06T05:24:01.849Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "name",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "角色表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"table": "tool",
|
|
3
|
-
"key": "id",
|
|
4
|
-
"auto_increment": 0,
|
|
5
|
-
"created_at": "2026-08-06T05:24:01.860Z",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "id",
|
|
9
|
-
"type": "varchar",
|
|
10
|
-
"not_null": true,
|
|
11
|
-
"auto": false,
|
|
12
|
-
"pk": true,
|
|
13
|
-
"default_value": null,
|
|
14
|
-
"note": "道具表"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"indexes": []
|
|
18
|
-
}
|