package com.njcn.quality.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.quality.mapper.DevVersionMapper;
import com.njcn.quality.param.DevVersionParam;
import com.njcn.quality.pojo.po.DevVersion;
import com.njcn.quality.service.IDevVersionService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/7 18:58
 */

@Service
public class DevVersionServiceImpl extends ServiceImpl<DevVersionMapper, DevVersion> implements IDevVersionService {


    @Override
    public DevVersion addDevVersion(DevVersionParam devVersionParam) {
        DevVersion devVersion = new DevVersion();
        BeanUtils.copyProperties(devVersionParam, devVersion);
        devVersion.setState(DataStateEnum.ENABLE.getCode());
        this.save(devVersion);
        return devVersion;
    }

    @Override
    public boolean deleteDevVersion(String id) {
        return this.removeById(id);
    }
}
