package com.huimv.produce.produce.controller;


import com.huimv.common.utils.Result;
import com.huimv.produce.produce.service.IProdSalesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 *  销售表
 * </p>
 *
 * @author astupidcoder
 * @since 2021-11-25
 */
@RestController
@RequestMapping("/prodSales")
public class ProdSalesController {
    @Autowired
    private IProdSalesService prodSalesService;

//    @GetMapping("/listSales")
//    public Result getCost(@RequestParam(name = "farmId") Integer farmId){
//        List<ProdSales> list = prodSalesService.list(new QueryWrapper<ProdSales>().eq("farm_id", farmId).eq("add_date", DataUill.getTimesmorning()));
//        return new Result(ResultCode.SUCCESS,list);
//    }

    @PostMapping("/listSales")
    public Result getCost(@RequestBody Map map){
            return  prodSalesService.listSales(map);
    }

    @GetMapping("/listClientHome")
    public Result listClientHome(@RequestParam(name = "farmId") Integer farmId){
        return  prodSalesService.listClientHome(farmId);
    }
}
