chore: 项目环境升级为 JDK25,Spring 4.1,项目重构为多模块

This commit is contained in:
2026-09-08 15:02:18 +08:00
parent d392436620
commit 81a0d81f11
168 changed files with 2785 additions and 1375 deletions

30
sandbox/docx-example.cjs Normal file
View File

@@ -0,0 +1,30 @@
// 使用 Runtime 实际安装的 docx API可作为表格与原生批注的最小验证脚本。
const fs = require('node:fs');
const path = require('node:path');
const assert = require('node:assert/strict');
const { Document, Paragraph, TextRun, Table, TableRow, TableCell, Packer,
CommentRangeStart, CommentRangeEnd, CommentReference } = require('docx');
async function main() {
const output = process.argv[2];
assert(output, '用法node docx-example.cjs <输出.docx>');
const document = new Document({
comments: { children: [{ id: 0, author: '材料评审', date: new Date(),
children: [new Paragraph({ children: [new TextRun('请企业确认设备数量。')] })] }] },
sections: [{ children: [
new Paragraph({ children: [
new CommentRangeStart(0), new TextRun('待企业提供设备数量。'),
new CommentRangeEnd(0), new TextRun({ children: [new CommentReference(0)] })
] }),
new Table({ rows: [new TableRow({ children: ['项目', '待确认'].map(text =>
new TableCell({ children: [new Paragraph({ children: [new TextRun(text)] })] })) })] })
] }]
});
const buffer = await Packer.toBuffer(document);
assert.equal(buffer.subarray(0, 2).toString(), 'PK');
fs.mkdirSync(path.dirname(output), { recursive: true });
fs.writeFileSync(output, buffer);
console.log(`DOCX API 验证通过:${buffer.length} 字节`);
}
main().catch(error => { console.error(error); process.exitCode = 1; });