package com.usky.iot.service.impl;

import com.usky.common.security.utils.SecurityUtils;
import com.usky.iot.domain.BaseFacilityDevice;
import com.usky.iot.domain.BaseFacilityType;
import com.usky.iot.mapper.BaseFacilityDeviceMapper;
import com.usky.iot.service.BaseFacilityDeviceService;
import com.usky.common.mybatis.core.AbstractCrudService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 地理设施设备关联表 服务实现类
 * </p>
 *
 * @author han
 * @since 2023-06-07
 */
@Service
public class BaseFacilityDeviceServiceImpl extends AbstractCrudService<BaseFacilityDeviceMapper, BaseFacilityDevice> implements BaseFacilityDeviceService {
    @Override
    public boolean add(BaseFacilityDevice baseFacilityDevice) {
        baseFacilityDevice.setCreatedBy(SecurityUtils.getUsername());
        baseFacilityDevice.setCreatedTime(LocalDateTime.now());
        return this.save(baseFacilityDevice);
    }

    @Override
    public boolean remove(Integer id) {
        return this.removeById(id);
    }
}
