| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- /**
- * 调理方案模块 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<Array<{id, planCode, name, modeType, symptoms, applicableGender, ageMin, ageMax, description, authorId, authorName, authorType, useCount, avgRating, lastUseTime, status, createTime, updateTime}>>}
- */
- export function getCustomPlanList() {
- return http.get('/app/custom-plan/list')
- }
- /**
- * 获取用户自定义方案详情
- * @param {string|number} id - 方案ID
- * @returns {Promise<Object>} 方案详情含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<Array>}
- */
- export function getProfessionalPlanList() {
- return http.get('/app/professional-plan/list')
- }
- /**
- * 获取专业模式方案详情(含穴位步骤列表)
- * @param {string|number} id - 方案ID
- * @returns {Promise<Object>}
- */
- export function getProfessionalPlanDetail(id) {
- return http.get(`/app/professional-plan/${id}`)
- }
- /**
- * 获取延年圣手模式方案列表
- * 所有 APP 用户共享同一份方案,仅返回已发布方案
- * @returns {Promise<Array>}
- */
- export function getMasterPlanList() {
- return http.get('/app/master-plan/list')
- }
- /**
- * 获取延年圣手模式方案详情(含穴位步骤列表)
- * @param {string|number} id - 方案ID
- * @returns {Promise<Object>}
- */
- export function getMasterPlanDetail(id) {
- return http.get(`/app/master-plan/${id}`)
- }
- /**
- * 新增用户自定义方案
- * @param {Object} data - 方案数据 { name, symptoms, applicableGender, ageMin, ageMax, description, status, steps }
- * @returns {Promise<number>} 新方案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}`)
- }
|