package com.bonus.zlpt.bigscreen.controller;

import com.bonus.zlpt.common.core.web.controller.BaseController;
import com.bonus.zlpt.common.core.web.domain.AjaxResult;
import com.bonus.zlpt.bigscreen.domain.MaOrderInfo;
import com.bonus.zlpt.bigscreen.domain.vo.MaOrderInfoVo;
import com.bonus.zlpt.bigscreen.domain.vo.MaOrderVo;
import com.bonus.zlpt.bigscreen.service.MaOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 订单信息表(MaOrderInfo)表控制层
 *
 * @author makejava
 * @since 2023-11-30 13:14:19
 */
@RestController
@RequestMapping("maOrderInfo")
public class MaOrderInfoController extends BaseController {
    /**
     * 服务对象
     */
    @Autowired
    private MaOrderInfoService maOrderInfoService;

    /**
     * 获取每个月对应的订单数量
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(MaOrderInfo maOrderInfo)
    {
        List<MaOrderInfoVo> machinistInfos = maOrderInfoService.selectMaOrderInfoList(maOrderInfo);
        return success(machinistInfos);
    }

    /**
     * 查询今日订单额以及订单数量
     * @param maOrderInfo
     * @return
     */
    @GetMapping("/today-list")
    public AjaxResult todayList(MaOrderInfo maOrderInfo)
    {
        List<MaOrderVo> maOrderInfos = maOrderInfoService.selectTodayList(maOrderInfo);
        return success(maOrderInfos);
    }
}

