import { getAuthHeaders } from '@/api/authHeaders';
|
import { request } from '@/api/request';
|
import type {
|
TenantCustomerDetailRequest,
|
TenantCustomerDetailResponse,
|
TenantCustomerFollowUpListRequest,
|
TenantCustomerFollowUpListResponse,
|
TenantCustomerPageQuery,
|
TenantCustomerPageResult,
|
} from './types';
|
|
/** 查询本租户客户列表(只读)。 */
|
export const getCustomerList = (params: TenantCustomerPageQuery) =>
|
request<TenantCustomerPageQuery, TenantCustomerPageResult>({
|
url: '/tenant/customers',
|
method: 'GET',
|
params,
|
headers: getAuthHeaders(),
|
});
|
|
/** 查询客户详情(只读)。 */
|
export const getCustomerDetail = ({ id }: TenantCustomerDetailRequest) =>
|
request<TenantCustomerDetailRequest, TenantCustomerDetailResponse>({
|
url: `/tenant/customers/${id}`,
|
method: 'GET',
|
headers: getAuthHeaders(),
|
});
|
|
/** 查询客户跟进历史(只读,按 followAt 倒序)。 */
|
export const getCustomerFollowUps = ({ id, ...params }: TenantCustomerFollowUpListRequest) =>
|
request<TenantCustomerFollowUpListRequest, TenantCustomerFollowUpListResponse>({
|
url: `/tenant/customers/${id}/follow-ups`,
|
method: 'GET',
|
params,
|
headers: getAuthHeaders(),
|
});
|