luoweijian
|
96230913ae
|
refactor: SystemController IO to DTOs (ADR-0017 ticket 07)
- new DeptDTO (extends BaseDTO, children tree, fromEntity/toEntity)
- new AssignDeptDTO (plain POJO, no key semantics)
- rename UserStatsVO -> UserStatsDTO
- menuTree returns List<ResourceNodeDTO>; PermissionResolver.visibleMenuTree maps entity->DTO before tree build
- deptTree returns List<DeptDTO>; saveDept takes DeptDTO; assignUserDepts takes AssignDeptDTO
- userPage drops @RequestBody -> form binding (aligns with documented form-urlencoded convention)
- sync role-management doc RoleDetailVO -> RoleDTO
- DataScopeIntegrationTest updated for ResourceNodeDTO
|
4 weeks ago |
luoweijian
|
f989b566cc
|
refactor: rename ResourceNode to ResourceNodeDTO extending BaseDTO (ADR-0017 ticket 05)
|
4 weeks ago |
luoweijian
|
b50002f47f
|
commit
|
4 weeks ago |
luoweijian
|
ae103a1f1c
|
refactor: BaseDTO 重构为 abstract 基类 + IBaseService 清理死代码 (ADR-0017 ticket 01)
- BaseDTO 改为 abstract,仅保留 id/createTime/updateTime(均加 @JsonInclude NON_NULL)
- 移除 creatorId/updaterId/deleted 字段及默认值——防止出参侧泄露
- 移除泛型 toEntity(Supplier) 方法——转换方法下沉到各 DTO 类
- IBaseService 删除 saveDTO/updateDTO 死代码(零调用方)
- BeanCopyUtils javadoc 同步更新(移除 BaseDTO.toEntity 引用)
- README §3/§4/§10 同步更新 BaseDTO 和 IBaseService 说明
- 修复 ResourceController/RoleController 预存 UTF-8 BOM 问题
- 新增 ADR-0017、spec.md、7 个 implementation tickets
Refs: ADR-0017, .scratch/controller-io-conventions/
|
4 weeks ago |
luoweijian
|
51b7e2a749
|
feat(auth,dict,base): extract PermissionSeeder seam to replace shadow entities (ADR-0016)
- Add PermissionSeeder interface + PermissionModuleDescriptor/ButtonSeed records in crm-base
- Implement PermissionSeederImpl in crm-auth with find-or-create idempotent seeding
- Refactor DataInitializer to use seam (3 seedModule calls) + @Order(1)
- Refactor DictPermissionInitializer to use seam (1 seedModule call) + @Order(10)
- Delete 6 shadow entity/mapper files from crm-dict (SysMenuSeed, SysRoleSeed, SysRoleMenuSeed + mappers)
- Rewrite DictPermissionInitializerTest to mock PermissionSeeder (no more H2 auth tables)
- Add PermissionSeederImplTest (H2 integration test covering idempotency, catalog sharing, role-not-found)
- Add ADR-0016 documenting the decision, rationale, alternatives, and consequences
- Create crm-base/CONTEXT.md with PermissionSeeder domain glossary
- Update CONTEXT-MAP.md to link crm-base/CONTEXT.md
Eliminates schema leakage: crm-dict no longer knows sys_menu's physical schema.
Runtime dependency accepted: crm-dict needs crm-auth's PermissionSeederImpl at runtime (via crm-app classpath aggregation).
|
4 weeks ago |
luoweijian
|
3d55eeb196
|
feat(dict): data dictionary module — two-level flat model, CRUD/default/cache/permission/seed (ADR-0015)
- 4 tables (dict_group/dict_item/dict_group_default/dict_ref_count), delete_key soft-delete reuse
- DictGroup/DictItem full CRUD + force-delete + status toggle + enabled-list
- DictReferenceService: increment/decrement/batchApply/isReferenced, same-tx ref_count, no cache
- DictQueryService: Caffeine 10s cache + 2s negative cache for empty results, group.status join
- Default item: INSERT ON DUPLICATE KEY UPDATE, hibernate on group disable, auto-restore
- Permission seeds: 10 perm codes → sys_menu tree, bound to ROLE_ADMIN, no crm-auth import
- Built-in dict initializer: idempotent upsert, builtin=false never touched (US-41), value not overwritten
- 48 tests pass; full project compiles
|
1 month ago |
luoweijian
|
50f79a884d
|
commit
|
1 month ago |
luoweijian
|
3499353b28
|
feat(file): thumbnail preview - async generation + sync fallback, PDFBox/LibreOffice renderers, retry (ADR-0013)
|
1 month ago |
luoweijian
|
a263f1736c
|
feat(auth): role management — ancestor completion, CRUD, permission assignment, cascade delete (ADR-0012)
Implements ADR-0005 (backend ancestor completion) and ADR-0012 (role management
architecture) across 5 tracer-bullet tickets:
- ISysMenuService.getAncestorIds: batch query full table, in-memory parentId
traversal, returns complete ancestor set (ADR-0005)
- SysRole.builtin field + DataInitializer idempotent refactor + 5 button
permission seeds (crm:role:list/detail/save/delete/assign) bound to ADMIN
- RoleController (/api/roles/*): page, saveOrUpdate, detail, assign-resources,
delete — pure hasAuthority, POST + action suffix, form params
- SysRoleServiceImpl.saveRole: roleCode uniqueness, builtin protection,
dataScope 1-4 range, create can't set builtin=true
- assignResources: calls getAncestorIds for ancestor completion, then
full replacement (delete + insert) of sys_role_menu
- getRoleDetail: returns RoleDetailVO with basic info + resourceIds
- deleteRoleCascade: cleans sys_role_menu + sys_user_role, builtin rejection,
three-table transaction
- SystemController: all role endpoints removed, unused deps cleaned
- Dead code removed: assignMenus, getMenuIdsByRoleId (superseded by
assignResources, getRoleDetail)
- H2 test schemas updated with builtin column
- 150 tests pass (16 new in SysRoleServiceImplTest, 7 in SysMenuServiceImplTest)
|
1 month ago |
luoweijian
|
ae038a1398
|
feat: /api/resources/list 后端组树返回 — TreeUtils.buildTree + sort
- ResourceNode 新增 children 字段
- listAll() 改用 TreeUtils.buildTree 组树,按 sort 排序
- 前端无需自行组树,直接渲染 data
- 测试适配树结构,前端文档同步更新
|
1 month ago |
luoweijian
|
170c16b226
|
refactor: ResourceController 对齐全局接口契约 — POST + 动作后缀 + 表单参数
- GET /api/resources → GET /api/resources/list
- POST /api/resources + @RequestBody → POST /api/resources/saveOrUpdate + 表单字段
- DELETE /api/resources/{id} → POST /api/resources/delete + @RequestParam
- 前端对接文档同步更新
|
1 month ago |
luoweijian
|
73304b7734
|
commit
|
1 month ago |
luoweijian
|
6329a6ba74
|
first-commit
|
1 month ago |