package com.bonus.canteen.core.supply.purchase.controller;

import com.bonus.canteen.core.supply.purchase.domain.bo.DrpDishesConvertDTO;
import com.bonus.canteen.core.supply.purchase.domain.vo.DrpDishesConvertVO;
import com.bonus.canteen.core.supply.purchase.service.DrpOtherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
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 javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping({"/api/v1/drp-other"})
@Api(
   value = "gyp-出入库其他接口",
   tags = {"gyp-出入库其他接口"}
)
public class DrpOtherController {
   private static final Logger log = LoggerFactory.getLogger(DrpOtherController.class);
   @Autowired
   @Lazy
   private DrpOtherService drpOtherService;

   @PostMapping({"/dishes/convert"})
   @ApiOperation("获取菜品原料反算接口")
   public List<DrpDishesConvertVO> dishesConvert(@RequestBody @Valid List<DrpDishesConvertDTO> content) {
      return this.drpOtherService.dishesConvert(content);
   }
}
