package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.VehicleMessageServiceI;
import com.zcloud.primeport.command.VehicleMessageAddExe;
import com.zcloud.primeport.command.VehicleMessageRemoveExe;
import com.zcloud.primeport.command.VehicleMessageUpdateExe;
import com.zcloud.primeport.command.query.VehicleMessageQueryExe;
import com.zcloud.primeport.dto.VehicleMessageAddCmd;
import com.zcloud.primeport.dto.VehicleMessagePageQry;
import com.zcloud.primeport.dto.VehicleMessageUpdateCmd;
import com.zcloud.primeport.dto.clientobject.VehicleMessageCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:28
 */
@Service
@AllArgsConstructor
public class VehicleMessageServiceImpl implements VehicleMessageServiceI {
    private final VehicleMessageAddExe vehicleMessageAddExe;
    private final VehicleMessageUpdateExe vehicleMessageUpdateExe;
    private final VehicleMessageRemoveExe vehicleMessageRemoveExe;
    private final VehicleMessageQueryExe vehicleMessageQueryExe;

    @Override
    public PageResponse<VehicleMessageCO> listPage(VehicleMessagePageQry qry) {

        return vehicleMessageQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(VehicleMessageAddCmd cmd) {

        vehicleMessageAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(VehicleMessageUpdateCmd vehicleMessageUpdateCmd) {
        vehicleMessageUpdateExe.execute(vehicleMessageUpdateCmd);
    }

    @Override
    public void remove(Long id) {
        vehicleMessageRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        vehicleMessageRemoveExe.execute(ids);
    }
}

