mm_dao 1.9.1 → 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/index.js +3 -17
- 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 +17 -34
- package/lib/script.tpl.js +4 -4
- package/package.json +10 -3
- package/tool/dao/index.js +173 -4
- package/tool/dao/tool.json +56 -5
- 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/lib/tools/dao/index.js +0 -73
- package/lib/tools/index.js +0 -16
- 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/lib/tools/dao/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* dao —— DAO 登记与表结构工具
|
|
4
|
-
* 清单来自管理器 getInfos,表结构来自模块 Dao 类的 getModel,能力层只做投影。
|
|
5
|
-
*/
|
|
6
|
-
const { daoAdmin, Dao } = require('../../../index.js');
|
|
7
|
-
|
|
8
|
-
/** 登记项投影字段:DAO 关注表名与脚本目录 */
|
|
9
|
-
const FIELDS = ['name', 'title', 'table', 'dir', 'desc'];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 投影登记项
|
|
13
|
-
* @param {object} cfg 登记配置
|
|
14
|
-
* @returns {object} 投影
|
|
15
|
-
*/
|
|
16
|
-
function project(cfg) {
|
|
17
|
-
const out = {};
|
|
18
|
-
for (const k of FIELDS) out[k] = cfg[k] === undefined ? '' : cfg[k];
|
|
19
|
-
out.fields = Array.isArray(cfg.fields) ? cfg.fields.length : 0;
|
|
20
|
-
return out;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 取实例配置:优先显式 config,其次按 name 取登记项
|
|
25
|
-
* @param {object} mgr 管理器
|
|
26
|
-
* @param {object} p 参数
|
|
27
|
-
* @returns {object} 配置
|
|
28
|
-
*/
|
|
29
|
-
function resolveConfig(mgr, p) {
|
|
30
|
-
if (p.config && typeof p.config === 'object') return p.config;
|
|
31
|
-
if (p.name) {
|
|
32
|
-
const cfg = typeof mgr.getInfo === 'function' ? mgr.getInfo(p.name) : null;
|
|
33
|
-
if (cfg) return cfg;
|
|
34
|
-
}
|
|
35
|
-
throw new TypeError('schema 需要 config 或已登记的 name');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function main(params, ctx, options) {
|
|
39
|
-
void options;
|
|
40
|
-
const p = params || {};
|
|
41
|
-
const action = p.action || 'list';
|
|
42
|
-
const write = (data) => { ctx.output = data; return data; };
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const mgr = daoAdmin(p.scope || 'os');
|
|
46
|
-
|
|
47
|
-
if (action === 'list') {
|
|
48
|
-
const rows = typeof mgr.getInfos === 'function' ? mgr.getInfos() : [];
|
|
49
|
-
const list = rows.map(project);
|
|
50
|
-
return write({ code: 0, msg: list.length ? '成功' : '当前作用域没有已登记的 DAO', count: list.length, list });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (action === 'schema') {
|
|
54
|
-
const cfg = resolveConfig(mgr, p);
|
|
55
|
-
const inst = new Dao(cfg);
|
|
56
|
-
const model = typeof inst.getModel === 'function' ? inst.getModel() : null;
|
|
57
|
-
if (!model) return write({ code: 10002, msg: '该 DAO 配置无法生成模型', name: cfg.name || '' });
|
|
58
|
-
return write({ code: 0, msg: '成功', name: cfg.name || '', table: model.table || '', schema: model });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (action === 'mods') {
|
|
62
|
-
const mods = typeof mgr.getMods === 'function' ? mgr.getMods() : {};
|
|
63
|
-
const keys = Array.isArray(mods) ? mods.map((o) => (o && (o.name || o.config && o.config.name)) || '') : Object.keys(mods || {});
|
|
64
|
-
return write({ code: 0, msg: '成功', count: keys.length, mods: keys.filter(Boolean) });
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return write({ code: 10001, msg: '不支持的操作: ' + action });
|
|
68
|
-
} catch (error) {
|
|
69
|
-
return write({ code: 10000, msg: '执行失败:' + error.message, error: { name: error.name, message: error.message } });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
module.exports = { main };
|
package/lib/tools/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
/** 模块能力层:懒加载工具实现,避免模块入口被 require 时加载全部实现 */
|
|
5
|
-
module.exports = new Proxy({}, {
|
|
6
|
-
get(_t, key) {
|
|
7
|
-
if (typeof key !== 'string') return undefined;
|
|
8
|
-
if (!fs.existsSync(path.join(__dirname, key, 'index.js'))) return undefined;
|
|
9
|
-
return require('./' + key);
|
|
10
|
-
},
|
|
11
|
-
has(_t, key) {
|
|
12
|
-
return typeof key === 'string' && fs.existsSync(path.join(__dirname, key, 'index.js'));
|
|
13
|
-
},
|
|
14
|
-
ownKeys() { return fs.readdirSync(__dirname, { withFileTypes: true }).filter(e => e.isDirectory()).map(e => e.name); },
|
|
15
|
-
getOwnPropertyDescriptor(_t, key) { return this.has(_t, key) ? { enumerable: true, configurable: true } : undefined; }
|
|
16
|
-
});
|
|
@@ -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
|
-
}
|