package com.cf.imes.module.system.api.customplateno;

import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.module.system.api.customplateno.dto.CustomPlateNoSeqDTO;
import com.cf.imes.module.system.dal.dataobject.customplateno.CustomPlateNoSeqDO;
import com.cf.imes.module.system.service.customplateno.CustomPlateNoSeqService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

/**
 * 自定义板编号序号feign实现类
 *
 * @author Gqr
 * @since 2024/11/15 11:39
 */
@RestController
@Validated
public class CustomPlateNoSeqApiImpl implements CustomPlateNoSeqApi {

    @Resource
    private CustomPlateNoSeqService customPlateNoSeqService;

    @Override
    public CommonResult<CustomPlateNoSeqDTO> getOrgCustomPlateNoSeq() {
        return CommonResult.success(BeanUtils.toBean(customPlateNoSeqService.getOrgCustomPlateNoSeq(), CustomPlateNoSeqDTO.class));
    }

    @Override
    public CommonResult<Boolean> modifyOrgCustomPlateNoSeq(CustomPlateNoSeqDTO customPlateNoSeqDTO) {
        return CommonResult.success(customPlateNoSeqService.modifyOrgCustomPlateNoSeq(BeanUtils.toBean(customPlateNoSeqDTO, CustomPlateNoSeqDO.class)));
    }
}
