package com.zcloud.zcGbsServicer.service;

import com.zcloud.zcGbsServicer.api.WaterSourceServiceI;
import com.zcloud.zcGbsServicer.command.WaterSourceAddExe;
import com.zcloud.zcGbsServicer.command.WaterSourceRemoveExe;
import com.zcloud.zcGbsServicer.command.WaterSourceUpdateExe;
import com.zcloud.zcGbsServicer.command.query.WaterSourceQueryExe;
import com.zcloud.zcGbsServicer.dto.WaterSourceAddCmd;
import com.zcloud.zcGbsServicer.dto.WaterSourcePageQry;
import com.zcloud.zcGbsServicer.dto.WaterSourceScreenQry;
import com.zcloud.zcGbsServicer.dto.WaterSourceUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.WaterSourceCO;
import com.zcloud.zcGbsServicer.dto.clientobject.WaterSourceScreenCO;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
* web-app
* @Author makejava
* @Date 2026-01-21 17:23:50
*/
@Service
@AllArgsConstructor
public class WaterSourceServiceImpl implements WaterSourceServiceI {
    private final WaterSourceAddExe waterSourceAddExe;
    private final WaterSourceUpdateExe waterSourceUpdateExe;
    private final WaterSourceRemoveExe waterSourceRemoveExe;
    private final WaterSourceQueryExe waterSourceQueryExe;

    @Override
    public PageResponse<WaterSourceCO> listPage(WaterSourcePageQry qry){

        return waterSourceQueryExe.execute(qry);
    }

    @Override
    public PageResponse<WaterSourceScreenCO> listScreen(WaterSourceScreenQry qry) {
        return waterSourceQueryExe.listScreen(qry);
    }

    @Override
    public SingleResponse add(WaterSourceAddCmd cmd) {

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

    @Override
    public void edit(WaterSourceUpdateCmd waterSourceUpdateCmd) {
        waterSourceUpdateExe.execute(waterSourceUpdateCmd);
    }

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

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

    @Override
    public WaterSourceCO getInfoById(Long id) {
        return waterSourceQueryExe.getInfoById(id);
    }
}

