diff --git a/src/api/health/medicationRecord.js b/src/api/health/medicationRecord.js new file mode 100644 index 0000000..36af2f2 --- /dev/null +++ b/src/api/health/medicationRecord.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' + +// 查询服药记录列表 +export function listMedicationRecord(query) { + return request({ + url: '/health/medicationRecord/list', + method: 'get', + params: query + }) +} + +// 查询今日待服药记录 +export function getTodayRecords() { + return request({ + url: '/health/medicationRecord/today', + method: 'get' + }) +} + +// 根据计划ID和日期查询服药记录 +export function getRecordsByPlanAndDate(planId, recordDate) { + return request({ + url: '/health/medicationRecord/byPlanDate', + method: 'get', + params: { planId, recordDate } + }) +} + +// 确认服药 +export function takeMedication(id, dosage, actualTime) { + return request({ + url: '/health/medicationRecord/take/' + id, + method: 'put', + params: { dosage, actualTime } + }) +} + +// 跳过服药 +export function skipMedication(id, reason) { + return request({ + url: '/health/medicationRecord/skip/' + id, + method: 'put', + params: { reason } + }) +}