task-88(店铺中心): 实现店铺列表加载
新增 shop-manage-model.ts(ShopManagePageVo camel 解析,仅保留密码掩码) 与 shop-manage-api.ts(GET /api/admin/shop-manages 加载适配)。 TDD: task-88.test.ts 8 用例先 RED 后 GREEN。
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/** 店铺列表加载适配(任务 88):GET /api/admin/shop-manages + 分页/筛选归一与解析。 */
|
||||
import { http } from '@/api/http'
|
||||
import { parseShopManagePage } from './shop-manage-model.ts'
|
||||
import {
|
||||
normalizeShopListParams,
|
||||
toShopManagePageQuery,
|
||||
type ShopManageListParams,
|
||||
type ShopPageResult,
|
||||
} from './shop-dto.ts'
|
||||
|
||||
export const SHOP_MANAGE_ENDPOINT = '/api/admin/shop-manages'
|
||||
|
||||
export async function fetchShopManageList(params: Partial<ShopManageListParams> = {}): Promise<ShopPageResult> {
|
||||
const normalized = normalizeShopListParams(params)
|
||||
const { data } = await http.get<unknown>(SHOP_MANAGE_ENDPOINT, { params: toShopManagePageQuery(normalized) })
|
||||
return parseShopManagePage(data)
|
||||
}
|
||||
Reference in New Issue
Block a user