fix(issue-14): 修复文档管理与系统管理6类代码质量问题
A. Entity-DDL表名不一致(致命): 3个文档实体@TableName('doc_*')但DDL定义'sys_document*'
- DDL: sys_document→doc_document, sys_document_category→doc_category, sys_document_version→doc_version
B. Entity-DDL列名不一致(致命): 多个字段名不匹配
- doc_document: file_path→storage_path, creator_id→uploader_id, 新增original_name/description/current_version/download_count/permission_level/deleted
- doc_category: sort→sort_order, 新增description/deleted/updated_time
- doc_version: doc_id→document_id, version_no→version, remark→description, file_path→storage_path, 新增file_size/operator_id
- 3个实体: createdAt→createdTime, updatedAt→updatedTime (对齐camelCase映射)
C. DocService编译错误(致命):
- setFilePath()→setStoragePath() (Document实体无filePath字段)
- DocumentVersion::getDocId→getDocumentId (实体无docId字段)
- DocumentVersion::getVersionNo→getVersion
- listDocs categoryId参数String→Long (对齐实体Long类型)
D. 密码明文存储(高): SysService.createUser直接setPassword(明文)
- 引入BCryptPasswordEncoder, 密码BCrypt加密存储
- 新增verifyPassword方法, updateUser支持密码修改(加密)
- pom.xml添加spring-security-crypto依赖
E. 缺测试(中): 新增2个测试类共45个测试方法
- DocServiceTest: 20个测试(文档CRUD/列表搜索/分类管理/版本管理)
- SysServiceTest: 25个测试(角色CRUD/用户CRUD+密码加密验证/菜单管理/部门CRUD/日志CRUD)
F. DDL缺列(致命): 修复V1__system_manage.sql
- 3个文档表完全重写, 列名对齐实体字段
- 添加种子数据: 5级角色预设/3个默认部门/4个文档分类
G. 补充功能: 新增MyBatisPlusConfig(分页+自动填充)
- 新增DocController端点: 下载计数/分类创建/版本创建
- 新增SysController端点: 角色更新删除/用户更新/菜单创建/部门更新/日志创建