package com.njcn.energy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.energy.mapper.DevVersionMapper;
import com.njcn.energy.pojo.param.DevVersionParam;
import com.njcn.energy.pojo.po.DevVersion;
import com.njcn.energy.service.IDevVersionService;
import com.njcn.web.utils.RequestUtil;
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);
    }
}
