45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import request from '@/utils/http'
|
||
|
||
type PageList<T> = {
|
||
list: T[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}
|
||
|
||
/** 查询列表(联查 sample_reception + sms_notification) */
|
||
export function fetchSampleSmsNotificationList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
acceptConclusion?: string
|
||
smsNotified?: string
|
||
receptionTimeStart?: string
|
||
receptionTimeEnd?: string
|
||
}) {
|
||
return request.get<PageList<Record<string, unknown>>>({
|
||
url: '/web/admin/sample-sms-notifications/list',
|
||
params
|
||
})
|
||
}
|
||
|
||
/** 切换通知状态 */
|
||
export function fetchToggleSmsNotified(
|
||
id: string,
|
||
data: { smsNotified: number; sampleReceptionId?: string }
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/sample-sms-notifications/${id}/toggle-status`,
|
||
data
|
||
})
|
||
}
|
||
|
||
/** 生成短信内容 */
|
||
export function fetchGenerateSms(id: string, sampleReceptionId?: string) {
|
||
return request.post<{ smsContent: string }>({
|
||
url: `/web/admin/sample-sms-notifications/${id}/generate-sms`,
|
||
params: sampleReceptionId ? { sampleReceptionId } : undefined
|
||
})
|
||
}
|