package com.zfire.mall.manager.controller.stock;


import com.zfire.mall.manager.annotation.ApiNotAuth;
import com.zfire.mall.manager.bean.stock.StockForceAdd;
import com.zfire.mall.manager.helper.ResponseHelper;
import com.zfire.mall.manager.logic.stock.StockForceLogic;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author CHANGE
 */
@Slf4j
@RestController
@Api(value = "强制仓库选择", tags ={"强制仓库选择"} )
@RequestMapping(value = "/stock/force", produces = "application/json; charset=utf-8")
public class StockForceController {

    @Autowired
    StockForceLogic stockForceLogic;



    @ApiOperation(value = "添加强制仓库")
    @PostMapping("/update")
    public ResponseHelper update(
            @RequestBody StockForceAdd stockForceAdd
    ) throws Exception {

        stockForceLogic.update(stockForceAdd);
        return ResponseHelper.success();

    }



    @ApiOperation(value = "强制仓库展示")
    @PostMapping("/detail")
    public ResponseHelper<StockForceAdd> syncFullCost(
    ) throws Exception {

        StockForceAdd stockForceAdd = stockForceLogic.deatil();
        return ResponseHelper.success(stockForceAdd);

    }


    @ApiOperation(value = "删除强制仓")
    @PostMapping("/del")
    public ResponseHelper del(

    ) throws Exception {

        stockForceLogic.del();
        return ResponseHelper.success();

    }



}

