package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base;

import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCutLengthModifyTypeService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.mes.bean.MesCutLengthModifyType;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description : 长度修改类型
 * @Reference :
 * @Author : junsheng.li
 * @CreateDate 2024/6/13 15:13
 * @Modify:
 **/
@RestController
@Api(tags = "长度修改类型")
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mes-cut-length-modify-type")
public class MesCutLengthModifyTypeController {

    @Autowired
    private IMesCutLengthModifyTypeService cutLengthModifyTypeService;

    @GetMapping("/query")
    @ApiOperation(value = "查询信息")
    public ResultBean queryMesCutLengthModifyType(MesCutLengthModifyType cutLengthModifyType) {
        try {
            return ResultBean.success("查询成功").setResultList(cutLengthModifyTypeService.queryMesCutLengthModifyTypeList(cutLengthModifyType));
        } catch (ImppBusiException imppException) {
            return ResultBean.fail(imppException);
        } catch (Exception e) {
            return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
        }
    }
}
