package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.VehicleViolationsServiceI;
import com.zcloud.primeport.command.VehicleViolationsAddExe;
import com.zcloud.primeport.command.VehicleViolationsRemoveExe;
import com.zcloud.primeport.command.VehicleViolationsUpdateExe;
import com.zcloud.primeport.command.query.VehicleViolationsQueryExe;
import com.zcloud.primeport.dto.VehicleViolationsAddCmd;
import com.zcloud.primeport.dto.VehicleViolationsPageQry;
import com.zcloud.primeport.dto.VehicleViolationsUpdateCmd;
import com.zcloud.primeport.dto.clientobject.VehicleViolationsCO;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:30
 */
@Service
@AllArgsConstructor
public class VehicleViolationsServiceImpl implements VehicleViolationsServiceI {
    private final VehicleViolationsAddExe vehicleViolationsAddExe;
    private final VehicleViolationsUpdateExe vehicleViolationsUpdateExe;
    private final VehicleViolationsRemoveExe vehicleViolationsRemoveExe;
    private final VehicleViolationsQueryExe vehicleViolationsQueryExe;

    @Override
    public PageResponse<VehicleViolationsCO> listPage(VehicleViolationsPageQry qry) {

        return vehicleViolationsQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(VehicleViolationsAddCmd cmd) {

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

    @Override
    public void edit(VehicleViolationsUpdateCmd vehicleViolationsUpdateCmd) {
        vehicleViolationsUpdateExe.execute(vehicleViolationsUpdateCmd);
    }

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

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

    @Override
    public PageResponse<VehicleViolationsCO> violationRecordslistPage(VehicleViolationsPageQry qry) {
        return vehicleViolationsQueryExe.violationRecordslistPage(qry);
    }

    @Override
    public VehicleViolationsCO getInfoById(Long id) {
        return vehicleViolationsQueryExe.getInfoById(id);
    }
}

