package com.zcloud.domain.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.domain.api.DomainDepartmentUserServiceI;
import com.zcloud.domain.command.DomainDepartmentUserAddExe;
import com.zcloud.domain.command.DomainDepartmentUserRemoveExe;
import com.zcloud.domain.command.DomainDepartmentUserUpdateExe;
import com.zcloud.domain.command.query.DomainDepartmentUserQueryExe;
import com.zcloud.domain.dto.DomainDepartmentUserAddCmd;
import com.zcloud.domain.dto.DomainDepartmentUserPageQry;
import com.zcloud.domain.dto.DomainDepartmentUserUpdateCmd;
import com.zcloud.domain.dto.clientobject.DomainDepartmentUserCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:29:09
 */
@Service
@AllArgsConstructor
public class DomainDepartmentUserServiceImpl implements DomainDepartmentUserServiceI {
    private final DomainDepartmentUserAddExe domainDepartmentUserAddExe;
    private final DomainDepartmentUserUpdateExe domainDepartmentUserUpdateExe;
    private final DomainDepartmentUserRemoveExe domainDepartmentUserRemoveExe;
    private final DomainDepartmentUserQueryExe domainDepartmentUserQueryExe;

    @Override
    public PageResponse<DomainDepartmentUserCO> listPage(DomainDepartmentUserPageQry qry) {

        return domainDepartmentUserQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(DomainDepartmentUserAddCmd cmd) {

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

    @Override
    public void edit(DomainDepartmentUserUpdateCmd domainDepartmentUserUpdateCmd) {
        domainDepartmentUserUpdateExe.execute(domainDepartmentUserUpdateCmd);
    }

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

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

    @Override
    public List<DomainDepartmentUserCO> listAll(DomainDepartmentUserPageQry qry) {
        return domainDepartmentUserQueryExe.listAll(qry);
    }
}

