package com.huimv.receiver.farm.controller;

import com.huimv.receiver.farm.service.IWeight;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.biosafety.uface.controller
 * @Description : TODO
 * @Version : 1.0
 * @Author : ZhuoNing
 * @Create : 2020-12-25
 **/
@CrossOrigin
@RestController
@Slf4j
@RequestMapping(value = "/receiver/farm/weight")
public class WeightController {
    @Autowired
    private IWeight weight;

    //保存日总重
    @RequestMapping(value = "/putDayWeight",method = RequestMethod.POST)
    public void putDayWeight(@RequestParam(value = "data",required = true) String data){
    log.info("接收每天总重>>"+data);
        //
        weight.saveDayWeight(data);
    }

    //保存批次总重
    @RequestMapping(value = "/putBatchWeight",method = RequestMethod.POST)
    public void putBatchWeight(@RequestParam(value = "data",required = true) String data){
        log.info("接收批次总重>>"+data);
        //
        weight.saveBatchWeight(data);
    }

    //保存每次称重
    @RequestMapping(value = "/putEveryTimeWeight",method = RequestMethod.POST)
    public void putEveryTimeWeight(@RequestParam(value = "data",required = true) String data){
        log.info("接收每次称重>>"+data);
        //
        weight.saveEveryTimeWeight(data);
    }

}
