package com.fjhx.controller.stock;

import com.fjhx.enums.stock.InTypeEnum;
import com.fjhx.params.stock.StockChangeVo;
import com.fjhx.service.stock.StockService;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * @author 手动入库
 */
@RestController
@RequestMapping("/manual/in/stock")
public class ManualInStockController {

    @Autowired
    private StockService stockService;

    @PostMapping("/add")
    public R add(@RequestBody StockChangeVo stockVo) {
        stockVo.setTypeEnum(InTypeEnum.MANUAL);
        stockService.changeQuantity(stockVo);
        return R.success();
    }

}
