package vip.xiaonuo.production.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.production.entity.ProductionYield;
import vip.xiaonuo.production.param.ProductionLocationEditParam;
import vip.xiaonuo.production.param.ProductionLocationParam;
import vip.xiaonuo.production.param.ProductionYieldParam;
import vip.xiaonuo.production.service.IProduceLocationService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 生成管控公司与车间对应表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-12-12
 */
@RestController
@Api(tags = "生成管控公司与车间对应表")
@ApiSupport(author = "wang", order = 1)
@Validated
public class ProduceLocationController {

    @Autowired
    private IProduceLocationService locationService;

    @PostMapping("/produce-location/add")
    @ApiOperationSupport(order = 1)
    @ApiOperation("车间添加")
    public CommonResult add(@RequestBody ProductionLocationParam param) {
        return locationService.add(param);
    }

    @PostMapping("/produce-location/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation("车间列表")
    public CommonResult list(@RequestBody Map<String, String> paramsMap) {
        return locationService.list(paramsMap);
    }

    @PostMapping("/produce-location/edit")
    @ApiOperationSupport(order = 3)
    @ApiOperation("车间修改")
    public CommonResult edit(@RequestBody ProductionLocationEditParam editParam) {
        return locationService.edit(editParam);
    }

    @PostMapping("/produce-location/delete")
    @ApiOperationSupport(order = 4)
    @ApiOperation("车间删除")
    public CommonResult delete(@RequestBody Map<String, String> paramsMap) {
        return locationService.delete(paramsMap);
    }

    @PostMapping("/produce-location/page")
    @ApiOperationSupport(order = 5)
    @ApiOperation("车间分页")
    public CommonResult page(@RequestBody Map<String, String> paramsMap) {
        return locationService.page(paramsMap);
    }

}
