package com.zcloud.basic.info.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.DepartmentSuperviseServiceI;
import com.zcloud.basic.info.command.DepartmentSuperviseAddExe;
import com.zcloud.basic.info.command.DepartmentSuperviseRemoveExe;
import com.zcloud.basic.info.command.DepartmentSuperviseUpdateExe;
import com.zcloud.basic.info.command.query.DepartmentSuperviseQueryExe;
import com.zcloud.basic.info.dto.DepartmentSuperviseAddCmd;
import com.zcloud.basic.info.dto.DepartmentSupervisePageQry;
import com.zcloud.basic.info.dto.DepartmentSuperviseUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.DepartmentSuperviseCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-11-10 14:13:46
 */
@Service
@AllArgsConstructor
public class DepartmentSuperviseServiceImpl implements DepartmentSuperviseServiceI {
    private final DepartmentSuperviseAddExe departmentSuperviseAddExe;
    private final DepartmentSuperviseUpdateExe departmentSuperviseUpdateExe;
    private final DepartmentSuperviseRemoveExe departmentSuperviseRemoveExe;
    private final DepartmentSuperviseQueryExe departmentSuperviseQueryExe;

    @Override
    public PageResponse<DepartmentSuperviseCO> listPage(DepartmentSupervisePageQry qry) {

        return departmentSuperviseQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(DepartmentSuperviseAddCmd cmd) {

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

    @Override
    public void edit(DepartmentSuperviseUpdateCmd departmentSuperviseUpdateCmd) {
        departmentSuperviseUpdateExe.execute(departmentSuperviseUpdateCmd);
    }

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

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

