/** * 调理方案模块 API */ import http from '@/utils/http' /** * 获取调理方案列表(分页) * @param {Object} params - { modeType, page, size } * @param {string} params.modeType - 模式标识: PROFESSIONAL / CUSTOM / EXPERT * @param {number} [params.page=0] - 页码 * @param {number} [params.size=100] - 每页数量 * @returns {Promise<{records, total}>} */ export function getCareList(params = {}) { return http.post('/userCare/careList', { page: params.page || 0, size: params.size || 100, modeType: params.modeType || '' }) } /** * 获取当前用户的自定义方案列表 * 通过 Token 获取当前 APP 账号下创作人属于自己的自定义模式方案 * @returns {Promise>} */ export function getCustomPlanList() { return http.get('/app/custom-plan/list') } /** * 获取用户自定义方案详情 * @param {string|number} id - 方案ID * @returns {Promise} 方案详情含steps */ export function getCustomPlanDetail(id) { return http.get(`/app/custom-plan/${id}`) } /** * 获取调理方案详情 * @param {string|number} id - 方案ID * @returns {Promise<{steps: Array}>} */ export function getCareDetail(id) { return http.get('/userCare/careDetail', { data: { id } }) } /** * 获取专业模式方案列表 * 所有 APP 用户共享同一份方案,仅返回已发布方案 * @returns {Promise} */ export function getProfessionalPlanList() { return http.get('/app/professional-plan/list') } /** * 获取专业模式方案详情(含穴位步骤列表) * @param {string|number} id - 方案ID * @returns {Promise} */ export function getProfessionalPlanDetail(id) { return http.get(`/app/professional-plan/${id}`) } /** * 获取延年圣手模式方案列表 * 所有 APP 用户共享同一份方案,仅返回已发布方案 * @returns {Promise} */ export function getMasterPlanList() { return http.get('/app/master-plan/list') } /** * 获取延年圣手模式方案详情(含穴位步骤列表) * @param {string|number} id - 方案ID * @returns {Promise} */ export function getMasterPlanDetail(id) { return http.get(`/app/master-plan/${id}`) } /** * 新增用户自定义方案 * @param {Object} data - 方案数据 { name, symptoms, applicableGender, ageMin, ageMax, description, status, steps } * @returns {Promise} 新方案ID */ export function createCustomPlan(data) { return http.post('/app/custom-plan', data) } /** * 修改用户自定义方案 * @param {Object} data - 方案数据 { id, name, symptoms, applicableGender, ageMin, ageMax, description, status, steps } * @returns {Promise} */ export function updateCustomPlan(data) { return http.put('/app/custom-plan', data) } /** * 删除用户自定义方案 * @param {string|number} id - 方案ID * @returns {Promise} */ export function deleteCustomPlan(id) { return http.delete(`/app/custom-plan/${id}`) }