task-42(账号/权限页面): 实现用户列表查询适配

新增 users-model.ts 纯解析(Java AdminUserItemVo snake_case→camelCase、
缺 id 行过滤、分页字段归一、success=false 抛后端 message)与 users.ts
adapter(fetchUserList:normalize+GET /api/admin/users+parse);UsersPage
改用 adapter,去掉模板内联 http.get+unwrap。task-41 依赖断言改指数据层。
8 用例全过,299 单测 + build 绿。
This commit is contained in:
2026-09-05 14:31:32 +08:00
parent 60fa5a818b
commit d760838e71
5 changed files with 170 additions and 10 deletions
+5 -3
View File
@@ -63,10 +63,12 @@ test('test_task_041_users_dto_invalid_input_rejected', () => {
})
test('test_task_041_users_dto_dependency_failure_returns_actionable_message', () => {
// 依赖失败:DTO 纯模块不依赖 axios/http供页面与后续 adapter 引用。
// 依赖失败:DTO 纯模块不依赖 axios/http由查询适配层引用。
const dto = readSource('src/api/users-dto.ts')
assert.equal(/axios|from '\.\/http'/.test(dto), false, 'DTO 模块保持纯逻辑')
assert.match(dto, /export interface UserPageResult/)
const page = readSource('src/pages/account/UsersPage.vue')
assert.match(page, /users-dto|UserListParams|UserPageResult/)
const adapter = readSource('src/api/users.ts')
assert.match(adapter, /users-dto/, '查询适配复用 DTO/参数归一')
const model = readSource('src/api/users-model.ts')
assert.match(model, /users-dto/, '解析模型复用 DTO 默认值')
})