package com.zcloud.primeport.gatewayimpl;

import com.zcloud.primeport.domain.gateway.VehicleDockLogGateway;
import com.zcloud.primeport.domain.model.VehicleDockLogE;
import com.zcloud.primeport.persistence.dataobject.VehicleDockLogDO;
import com.zcloud.primeport.persistence.repository.VehicleDockLogRepository;
import lombok.AllArgsConstructor;
import com.zcloud.gbscommon.utils.Tools;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-infrastructure
 *
 * @Author dearLin
 * @Date 2026-04-14 14:53:30
 */
@Service
@AllArgsConstructor
public class VehicleDockLogGatewayImpl implements VehicleDockLogGateway {
    private final VehicleDockLogRepository vehicleDockLogRepository;

    @Override
    public Boolean add(VehicleDockLogE vehicleDockLogE) {
        VehicleDockLogDO d = new VehicleDockLogDO();
        BeanUtils.copyProperties(vehicleDockLogE, d);
        vehicleDockLogRepository.save(d);
        return true;
    }

    @Override
    public Boolean update(VehicleDockLogE vehicleDockLogE) {
        VehicleDockLogDO d = new VehicleDockLogDO();
        BeanUtils.copyProperties(vehicleDockLogE, d);
        vehicleDockLogRepository.updateById(d);
        return true;
    }

    @Override
    public Boolean deletedVehicleDockLogById(Long id) {
        return vehicleDockLogRepository.removeById(id);
    }

    @Override
    public Boolean deletedVehicleDockLogByIds(List<Long> ids) {
        return vehicleDockLogRepository.removeByIds(ids);
    }
}

