先更新1版记录下

This commit is contained in:
2026-04-16 11:30:30 +08:00
parent ead8e2edd5
commit 2f2d796e30
40 changed files with 393714 additions and 4071 deletions

View File

@@ -1,77 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2026-04-14T10:41:00.000Z" agent="Oz" version="24.7.17">
<diagram id="ctx-er" name="ER图">
<mxGraphModel dx="1800" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1200" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="00 组织与权限上下文 - ER图" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=22;fontStyle=1;" parent="1" vertex="1">
<mxGeometry x="20" y="20" width="450" height="30" as="geometry"/>
</mxCell>
<mxCell id="3" value="统一隔离键adcode / tenant_id / tenant_path / dept_id / dept_path" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=13;fontColor=#666666;" parent="1" vertex="1">
<mxGeometry x="20" y="52" width="720" height="24" as="geometry"/>
</mxCell>
<mxCell id="10" value="tb_sys_tenant&lt;br&gt;PK tenant_id&lt;br&gt;FK parent_tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;tenant_name, tenant_type, status&lt;br&gt;adcode, tenant_path, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="40" y="120" width="280" height="140" as="geometry"/>
</mxCell>
<mxCell id="11" value="tb_sys_dept&lt;br&gt;PK dept_id&lt;br&gt;FK parent_dept_id -&gt; tb_sys_dept.dept_id&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;dept_name, dept_type&lt;br&gt;adcode, tenant_path, dept_path, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="360" y="120" width="300" height="150" as="geometry"/>
</mxCell>
<mxCell id="12" value="tb_sys_user&lt;br&gt;PK user_id, UK username&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;FK dept_id -&gt; tb_sys_dept.dept_id&lt;br&gt;display_name, password_hash, status&lt;br&gt;adcode, tenant_path, dept_path, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="700" y="120" width="320" height="150" as="geometry"/>
</mxCell>
<mxCell id="13" value="tb_sys_role&lt;br&gt;PK role_id, UK role_code&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;role_name&lt;br&gt;dept_id, dept_path, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="700" y="320" width="290" height="130" as="geometry"/>
</mxCell>
<mxCell id="14" value="tb_sys_permission&lt;br&gt;PK permission_id, UK permission_code&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;permission_name&lt;br&gt;dept_id, dept_path, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="1030" y="320" width="320" height="130" as="geometry"/>
</mxCell>
<mxCell id="15" value="rel_user_role&lt;br&gt;PK (user_id, role_id)&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;FK role_id -&gt; tb_sys_role.role_id&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="1030" y="120" width="290" height="130" as="geometry"/>
</mxCell>
<mxCell id="16" value="rel_role_permission&lt;br&gt;PK (role_id, permission_id)&lt;br&gt;FK role_id -&gt; tb_sys_role.role_id&lt;br&gt;FK permission_id -&gt; tb_sys_permission.permission_id&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="1360" y="120" width="320" height="130" as="geometry"/>
</mxCell>
<mxCell id="17" value="tb_auth_refresh_token&lt;br&gt;PK token_id&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;refresh_token, expire_at, revoked&lt;br&gt;tenant_id, dept_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="40" y="330" width="300" height="130" as="geometry"/>
</mxCell>
<mxCell id="18" value="tb_auth_login_audit&lt;br&gt;PK audit_id&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;username, login_ip, login_status&lt;br&gt;tenant_id, dept_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="360" y="330" width="300" height="130" as="geometry"/>
</mxCell>
<mxCell id="19" value="设计方法与原因&lt;br&gt;1) DDD上下文先行权限域作为业务域前置依赖&lt;br&gt;2) RBAC最小闭环用户-角色-权限拆分降低耦合&lt;br&gt;3) 多租户统一隔离键:保证后续业务表可水平扩展&lt;br&gt;4) 认证审计分离:令牌高频写与审计查询分流" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=12;" parent="1" vertex="1">
<mxGeometry x="1360" y="320" width="320" height="170" as="geometry"/>
</mxCell>
<mxCell id="100" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" parent="1" source="11" target="10" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="101" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" parent="1" source="12" target="10" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="102" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" parent="1" source="12" target="11" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="103" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#9673a6;" parent="1" source="13" target="10" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="104" value="M:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#d6b656;" parent="1" source="15" target="12" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="105" value="M:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#d6b656;" parent="1" source="15" target="13" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="106" value="M:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#d6b656;" parent="1" source="16" target="13" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="107" value="M:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#d6b656;" parent="1" source="16" target="14" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="108" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#b85450;" parent="1" source="17" target="12" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="109" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#b85450;" parent="1" source="18" target="12" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
<mxfile host="65bd71144e">
<diagram id="ctx-er-v2" name="ER图">
<mxGraphModel dx="1312" dy="773" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1200" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="00 组织与权限上下文 - ER图含班级模型" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=22;fontStyle=1;" parent="1" vertex="1">
<mxGeometry x="20" y="20" width="620" height="30" as="geometry"/>
</mxCell>
<mxCell id="3" value="全局技术栈对齐:业务主数据落 PostgreSQLAI知识检索能力由 Milvus + NebulaGraph/Neo4j 承担;同步调度统一采用 REST/JAR本模块仅维护组织权限" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=12;fontColor=#666666;" parent="1" vertex="1">
<mxGeometry x="20" y="52" width="1400" height="24" as="geometry"/>
</mxCell>
<mxCell id="10" value="upms.tb_sys_tenant&lt;br&gt;PK tenant_id&lt;br&gt;parent_tenant_id, tenant_name, tenant_type&lt;br&gt;adcode, tenant_path, status" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="40" y="90" width="280" height="120" as="geometry"/>
</mxCell>
<mxCell id="11" value="upms.tb_sys_dept&lt;br&gt;PK dept_id&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;parent_dept_id, dept_name, dept_type&lt;br&gt;adcode, tenant_path, dept_path" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="360" y="90" width="320" height="140" as="geometry"/>
</mxCell>
<mxCell id="12" value="upms.tb_sys_user&lt;br&gt;PK user_id, UK username&lt;br&gt;FK tenant_id -&gt; tb_sys_tenant.tenant_id&lt;br&gt;FK dept_id -&gt; tb_sys_dept.dept_id&lt;br&gt;display_name, status, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="730" y="90" width="340" height="140" as="geometry"/>
</mxCell>
<mxCell id="13" value="upms.tb_sys_role&lt;br&gt;PK role_id, UK role_code&lt;br&gt;tenant_id, role_name, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="1" vertex="1">
<mxGeometry x="1110" y="90" width="280" height="110" as="geometry"/>
</mxCell>
<mxCell id="14" value="upms.tb_sys_menu&lt;br&gt;PK route_id&lt;br&gt;parent_route_id, route_path, component_key&lt;br&gt;permission_code, hidden, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="1" vertex="1">
<mxGeometry x="1430" y="90" width="320" height="130" as="geometry"/>
</mxCell>
<mxCell id="15" value="upms.tb_sys_role_menu&lt;br&gt;PK (role_id, route_id)&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1430" y="260" width="300" height="100" as="geometry"/>
</mxCell>
<mxCell id="16" value="auth.tb_auth_refresh_token&lt;br&gt;PK token_id&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;refresh_token, expire_at, revoked" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
<mxGeometry x="40" y="290" width="320" height="120" as="geometry"/>
</mxCell>
<mxCell id="17" value="auth.tb_auth_login_audit&lt;br&gt;PK audit_id&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;username, login_ip, login_status" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
<mxGeometry x="400" y="290" width="320" height="120" as="geometry"/>
</mxCell>
<mxCell id="18" value="upms.tb_school_class&lt;br&gt;PK class_id&lt;br&gt;FK dept_id -&gt; tb_sys_dept.dept_id&lt;br&gt;class_name, grade_code, status&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="760" y="290" width="340" height="140" as="geometry"/>
</mxCell>
<mxCell id="19" value="upms.tb_school_class_member&lt;br&gt;PK (class_id, user_id)&lt;br&gt;FK class_id -&gt; tb_school_class.class_id&lt;br&gt;FK user_id -&gt; tb_sys_user.user_id&lt;br&gt;member_role, member_status, joined_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1140" y="450" width="350" height="150" as="geometry"/>
</mxCell>
<mxCell id="20" value="upms.tb_school_class_course_rel&lt;br&gt;PK (class_id, course_id)&lt;br&gt;FK class_id -&gt; tb_school_class.class_id&lt;br&gt;relation_status, tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1530" y="390" width="320" height="120" as="geometry"/>
</mxCell>
<mxCell id="30" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=1;exitY=0.35;entryX=0;entryY=0.35;" parent="1" source="10" target="11" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="31" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=1;exitY=0;entryX=0;entryY=0;" parent="1" source="10" target="12" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="700" y="70"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="32" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=0.6;exitY=1;entryX=0.4;entryY=0;" parent="1" source="13" target="15" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="33" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=0.4;exitY=1;entryX=0.6;entryY=0;" parent="1" source="14" target="15" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="34" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=0;exitY=0.7;entryX=1;entryY=0.35;" parent="1" source="12" target="16" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="35" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=0;exitY=0.85;entryX=1;entryY=0.45;" parent="1" source="12" target="17" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="36" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=1;exitY=0.8;entryX=0;entryY=0.4;" parent="1" source="11" target="18" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="37" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=1;exitY=0.6;entryX=0;entryY=0.4;" parent="1" source="18" target="19" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="38" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;exitPerimeter=1;entryPerimeter=1;exitX=1;exitY=0.85;entryX=0;entryY=0.2;" parent="1" source="18" target="20" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>