/*
 * @Description:vip健康食谱
 * @Author: Aimee·Zhang
 * @Date: 2022-01-12 17:48:28
 * @LastEditors: Aimee·Zhang
 * @LastEditTime: 2022-01-14 09:16:28
 */
import { request } from '../index'
/**
 * @description:称量体重模块首页
 */
const positions = (page) => {
	return request({
		url: 'health/recipe/positions',
		data: { page: page }
	})
}
/**
 * @description:饮食和运动首页信息
 * @params {日期}
 * @method {get}
 * @Date: 2022-01-13 08:55:04
 */
const plans = (date) => {
	return request({
		url: 'health/plans',
		data: {
			date: date
		}
	})
}

/**
 * @description:食品列表可翻页
 * @params {食品名称}
 * @return {}
 * @Date: 2022-01-13 09:37:26
 */

const healthFoods = (data) => {
	return request({
		url: 'health/foods',
		data: data
	})
}

/**
 * @description:添加食物
 * @Date: 2022-01-13 10:57:52
 */
const addHealthFoods = (data) => {
	return request({
		url: 'health/intakes',
		method: 'POST',
		data: data
	})
}

/**
 * @description:编辑食品
 * @Date: 2022-01-13 11:37:37
 */
const editHealthFoods = (data) => {
	return request({
		url: `health/intakes/${data.intake_id}`,
		method: 'PUT',
		data: data
	})
}
/**
 * @description:删除添加食品
 * @Date: 2022-01-14 09:15:38
 */
const delHealthFoods = (intake_id) => {
	return request({
		url: `health/intakes/${intake_id}`,
		method: 'DELETE'
	})
}

/**
 * @description:饮食运动日历
 * @params {日期}
 * @method {get}
 * @Date: 2022-02-07 15点18分
 */
const dateList = (data) => {
	return request({
		url: 'health/calendar/intake',
		data:data
	})
}
export {
	positions,
	plans,
	healthFoods,
	addHealthFoods,
	editHealthFoods,
	delHealthFoods,
    dateList
}
