package com.sky.ioc.controller.life;

import com.sky.ioc.entity.params.IocParam;
import com.sky.ioc.service.canteen.RestaurantService;
import com.sky.ioc.service.space.BuildingService;
import com.sky.ioc.tool.ReturnMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @author LunCe
 * 智慧餐厅
 */

@Api(tags ="智享生活----智慧餐厅")
@Slf4j
@RestController
@RequestMapping("/restaurant")
public class RestaurantController {


    @Autowired
    private RestaurantService restaurantService;



    @ApiOperation("查询智慧生活中智慧餐厅的核心指标")
    @PostMapping("getCoreIndicators")
    public ReturnMsg  getCoreIndicators(@RequestBody IocParam iocParam){
        return restaurantService.getCoreIndicators(iocParam);
    }

    @ApiOperation("查询智慧生活中智慧餐厅的用餐分析")
    @PostMapping("getMealAnalysis")
    public ReturnMsg  getMealAnalysis(@RequestBody IocParam iocParam){
        return restaurantService.getMealAnalysis(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧餐厅的欢迎菜品")
    @PostMapping("getWelcomeDishes")
    public ReturnMsg getWelcomeDishes(@RequestBody IocParam iocParam){
        return restaurantService.getWelcomeDishes(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧餐厅的消费分析")
    @PostMapping("getConsumptionAnalysis")
    public ReturnMsg  getConsumptionAnalysis(@RequestBody IocParam iocParam){
        return restaurantService.getConsumptionAnalysis(iocParam);
    }

    @ApiOperation("查询智慧生活中智慧餐厅的盈利分析")
    @PostMapping("getProfitAnalysis")
    public ReturnMsg  getProfitAnalysis(@RequestBody IocParam iocParam) throws ParseException {
        return restaurantService.getProfitAnalysis(iocParam);
    }


    /**
     * TODO  查询智慧生活中智慧餐厅的支付分析
     * @Description
     * @Param iocDateParam
     * @Return java.lang.String
     * @Author LunCe
     * @date 2023/2/10 11:25
     */
    @ApiOperation("查询智慧生活中智慧餐厅的支付分析")
    @PostMapping("getPaymentAnalysis")
    public ReturnMsg  getPaymentAnalysis(@RequestBody IocParam iocParam){
        return restaurantService.getPaymentAnalysis(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧餐厅的今日菜谱")
    @PostMapping("getTodayMenu")
    public ReturnMsg  getTodayMenu(){
        return restaurantService.getTodayMenu();
    }


    @ApiOperation("查询智慧生活中订单")
    @PostMapping("getOrderData")
    public ReturnMsg  getOrderData(){
        return restaurantService.getOrderData();
    }




}
