import request from "../request.js"

//上传血糖
export function savebg(data) {
	return request({
		url: `/fd/ps/bg/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//上传血压
export function savebp(data) {
	return request({
		url: `/fd/ps/bp/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//上传血脂
export function savebf(data) {
	return request({
		url: `/fd/ps/bf/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}
//上传体温
export function savetemp(data) {
	return request({
		url: `/fd/ps/temp/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//上传BMI
export function savebmi(data) {
	return request({
		url: `/fd/ps/bmi/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//上传血氧
export function savebo(data) {
	return request({
		url: `/fd/ps/bo/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//上传心率
export function savehr(data) {
	return request({
		url: `/fd/ps/hr/save`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//最后一次记录
export function recordlast(identity) {
	return request({
		url: `/fd/ps/record/last/${identity}`,
		method: 'get',
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//设备列表
export function bound(identity) {
	return request({
		url: `/fd/device/bound/${identity}`,
		method: 'get',
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}
//解绑
export function unbind(data) {
	return request({
		url: `/fd/device/unbind`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//添加设备
export function binding(data) {
	return request({
		url: `/fd/device/binding`,
		method: 'post',
		data,
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}

//获取血糖、血压、心率最后一次体征记录
export function recordlastV2(identity) {
	return request({
		url: `/fd/ps/record/lastV2/${identity}`,
		method: 'get',
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		}
	})
}