
/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName:腾风 病例
 */

import { request } from '../index'

// 添加病例-前置
const goutCreate = () => {
	return request({
		url: 'gout/result/create'
	})
}

// 添加病例
const goutAdd = (data) => {
	return request({
		url: 'gout/result',
        method: 'POST',
        data: data
	})
}

// 查看病例
const goutSee = (data) => {
    console.log(data)
	return request({
		url: 'gout/result',
        data:data
	})
}

// 添加病例-图片
const goutCover = (case_id, data) => {
	return request({
		url: 'gout/result/' + case_id + '/add_cover',
        method: 'POST',
        data: data
	})
}

// 查看尿酸
const lastLog = type => {
	return request({
		url: 'gout/result/last_log',
		data: {
			type
		}
	})
}

// 添加尿酸值
const AddlastLog = (user_case_id, data) => {
	return request({
		url: 'gout/result/' + user_case_id + '/logs',
        method: 'POST',
        data: data
	})
}

// 尿酸记录
const ListLog = (user_case_id, data) => {
	return request({
		url: 'gout/result/' + user_case_id + '/logs',
        data: data
	})
}

// 尿酸记录-详情
const DetLog = (user_case_id) => {
	return request({
		url: 'gout/result/logs/' + user_case_id
	})
}

// 删除尿酸记录
const DelLog = (user_case_id) => {
	return request({
		url: 'gout/result/logs/' + user_case_id,
        method: 'DELETE'
	})
}

// 病友记
const allLogs = (data) => {
	return request({
		url: 'gout/result/all_logs',
        data: data
	})
}


// 食物列表/嘌呤查询
const foodList = (data) => {
	return request({
		url: 'gout/food',
        data: data
	})
}

// 食物详情
const foodDet = (food_id) => {
	return request({
		url: 'gout/food/' + food_id
	}, true)
}

// 食物投票
const foodVote = (food_id, option_id) => {
	return request({
		url: 'gout/food/' + food_id + '/' +  option_id,
        method: 'POST'
	})
}

export {
    goutCreate,
    goutAdd,
    goutSee,
    goutCover,
    lastLog,
    AddlastLog,
    ListLog,
    DetLog,
    DelLog,
    allLogs,
    foodList,
    foodDet,
    foodVote
}
