refactor(health): H5端适配后端API重构
- 新增 medicationTask.js 替代 medicationRecord.js - 更新 medicationAdherence.js 参数名 personId -> memberId
This commit is contained in:
@@ -19,11 +19,11 @@ export function getDailyAdherence(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取日历视图数据
|
// 获取日历视图数据
|
||||||
export function getCalendarData(personId, yearMonth) {
|
export function getCalendarData(memberId, yearMonth) {
|
||||||
return request({
|
return request({
|
||||||
url: '/health/adherence/calendar',
|
url: '/health/adherence/calendar',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { personId, yearMonth }
|
params: { memberId, yearMonth }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,10 +37,10 @@ export function getTimeSlotAdherence(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取仪表盘概览数据
|
// 获取仪表盘概览数据
|
||||||
export function getDashboard(personId) {
|
export function getDashboard(memberId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/health/adherence/dashboard',
|
url: '/health/adherence/dashboard',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { personId }
|
params: { memberId }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询用药记录列表
|
|
||||||
export function listMedicationRecord(query) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询今日用药记录
|
|
||||||
export function getTodayRecords(personId) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/today',
|
|
||||||
method: 'get',
|
|
||||||
params: { personId }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询某计划某天的用药记录
|
|
||||||
export function getRecordsByPlanAndDate(planId, date) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/plan/' + planId + '/date/' + date,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询用药记录详细
|
|
||||||
export function getMedicationRecord(id) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增用药记录
|
|
||||||
export function addMedicationRecord(data) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改用药记录
|
|
||||||
export function updateMedicationRecord(data) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord',
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除用药记录
|
|
||||||
export function delMedicationRecord(id) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 服药(标记为已服用)
|
|
||||||
export function takeMedication(id, dosage, remark) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/take/' + id,
|
|
||||||
method: 'put',
|
|
||||||
params: { dosage, remark }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 跳过服药
|
|
||||||
export function skipMedication(id, remark) {
|
|
||||||
return request({
|
|
||||||
url: '/health/medicationRecord/skip/' + id,
|
|
||||||
method: 'put',
|
|
||||||
params: { remark }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
28
src/api/health/medicationTask.js
Normal file
28
src/api/health/medicationTask.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询服药任务列表
|
||||||
|
export function listMedicationTask(query) {
|
||||||
|
return request({
|
||||||
|
url: '/health/medicationTask/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认服药
|
||||||
|
export function confirmMedication(id, confirmType) {
|
||||||
|
return request({
|
||||||
|
url: '/health/medicationTask/confirm/' + id,
|
||||||
|
method: 'put',
|
||||||
|
params: { confirmType }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳过服药
|
||||||
|
export function skipMedication(id, notes) {
|
||||||
|
return request({
|
||||||
|
url: '/health/medicationTask/skip/' + id,
|
||||||
|
method: 'put',
|
||||||
|
params: { notes }
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user