import net from './request.js';

// import store from '../store';

const API = {
	/*
	 用户相关
	 */
    login: data => net.post('/user/login', data, false), // 登录
    getUserInfo: () => net.get('/user/info', {}, true), // 获取用户信息
    updateUserInfo: data => net.put('/user/update', data, true), // 更新用户信息
    upload: data => net.post('/user/upload', data, true), // 通用上传接口
    getUserInfoById: (id) => net.get(`/user/info/${id}`, {}, true), // 根据ID获取用户信息
    getLoverInfo: () => net.get('/user/lover', {}, true), // 获取情侣关系信息（包含 startDate 与 loverId）
	
    /* 
    纪念日相关
    */
    getMemorialDay: (id) => net.get(`/anniversary/${id}`, {}, true), // 获取纪念日详情
    getMemorialDayList: () => net.get('/anniversary/list', {}, true), // 获取纪念日列表
    addMemorialDay: data => net.post('/anniversary', data, true), // 添加纪念日
    updateMemorialDay: data => net.put('/anniversary', data, true), // 更新纪念日
    deleteMemorialDay: data => net.delete('/anniversary', data, true), // 删除纪念日

    /* 
       菜品菜谱相关接口
    */
   getFoodList: (params = {}) => net.get('/food/list', params, true), // 获取菜品菜谱列表（支持 page/pageSize）
   getFoodDetail: (id) => net.get(`/food/${id}`, {}, true), // 获取菜品菜谱详情
   addFood: data => net.post('/food', data, true), // 添加菜品菜谱
   updateFood: data => net.put('/food', data, true), // 更新菜品菜谱
   deleteFood: data => net.delete('/food', data, true), // 删除菜品菜谱
   createOrder: data => net.post('/order', data, true), // 创建订单
    // 菜品分类相关接口
    getFoodCategoryList: (params = {}) => net.get('/food/category/list', params, true), // 获取菜品分类列表（支持 page/pageSize）
    addFoodCategory: data => net.post('/food/category', data, true), // 添加菜品分类
    updateFoodCategory: data => net.put('/food/category', data, true), // 更新菜品分类
    deleteFoodCategory: data => net.delete('/food/category', data, true) // 删除菜品分类

};

export default API

