45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
|
|
import type { ApiResponse } from "@/lib/api"
|
|||
|
|
import type { UserItem, UserQueryParams } from "@/lib/models/user"
|
|||
|
|
import { callByUser } from "./base"
|
|||
|
|
|
|||
|
|
// ==================== 用户管理(.NET /api/baseinfo/v1/user/*) ====================
|
|||
|
|
|
|||
|
|
export async function fetchUserPage(
|
|||
|
|
params: UserQueryParams,
|
|||
|
|
): Promise<ApiResponse<UserItem[]>> {
|
|||
|
|
return await callByUser<UserItem[]>(
|
|||
|
|
"/api/baseinfo/v1/user/Page",
|
|||
|
|
params,
|
|||
|
|
"GET",
|
|||
|
|
)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export async function fetchUserSearch(
|
|||
|
|
params: UserQueryParams,
|
|||
|
|
): Promise<ApiResponse<UserItem[]>> {
|
|||
|
|
return await callByUser<UserItem[]>(
|
|||
|
|
"/api/baseinfo/v1/user/Search",
|
|||
|
|
params,
|
|||
|
|
"GET",
|
|||
|
|
)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export async function fetchAmountDetails(
|
|||
|
|
params: Record<string, unknown>,
|
|||
|
|
): Promise<ApiResponse<Record<string, unknown>>> {
|
|||
|
|
return await callByUser<Record<string, unknown>>(
|
|||
|
|
"/api/baseinfo/v1/user/AmountDetails",
|
|||
|
|
params,
|
|||
|
|
"GET",
|
|||
|
|
)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export async function updateUserProfile(
|
|||
|
|
data: Record<string, unknown>,
|
|||
|
|
): Promise<ApiResponse<undefined>> {
|
|||
|
|
return await callByUser<undefined>(
|
|||
|
|
"/api/baseinfo/v1/user/UpdateProfile",
|
|||
|
|
data,
|
|||
|
|
)
|
|||
|
|
}
|