package com.huimv.produce.produce.controller;


import com.huimv.common.utils.Result;
import com.huimv.produce.produce.service.IProdSalesDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-10-22
 */
@RestController
@RequestMapping("/prodSalesDetail")
public class ProdSalesDetailController {

    @Autowired
    private  IProdSalesDetailService prodSalesDetailService;

    @GetMapping("/getSalesDetail")
    public Result getSalesDetail(@RequestParam(name = "beginDate") String beginDate,
                                 @RequestParam(name = "endDate") String endDate,
                                 @RequestParam(name = "farmId") Integer farmId){
        return prodSalesDetailService.getSalesDetail(beginDate,endDate,farmId);

    }

    @GetMapping("/getSalesWeek")
    public Result getSalesWeek(@RequestParam(name = "farmId") Integer farmId){
        return prodSalesDetailService.getSalesWeek(farmId);

    }
}
