package com.zcloud.domain.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.domain.api.DomainGroupUserServiceI;
import com.zcloud.domain.command.DomainGroupUserAddExe;
import com.zcloud.domain.command.DomainGroupUserRemoveExe;
import com.zcloud.domain.command.DomainGroupUserUpdateExe;
import com.zcloud.domain.command.query.DomainGroupUserQueryExe;
import com.zcloud.domain.dto.DomainGroupUserAddCmd;
import com.zcloud.domain.dto.DomainGroupUserPageQry;
import com.zcloud.domain.dto.DomainGroupUserUpdateCmd;
import com.zcloud.domain.dto.clientobject.DomainGroupUserCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:29:43
 */
@Service
@AllArgsConstructor
public class DomainGroupUserServiceImpl implements DomainGroupUserServiceI {
    private final DomainGroupUserAddExe domainGroupUserAddExe;
    private final DomainGroupUserUpdateExe domainGroupUserUpdateExe;
    private final DomainGroupUserRemoveExe domainGroupUserRemoveExe;
    private final DomainGroupUserQueryExe domainGroupUserQueryExe;

    @Override
    public PageResponse<DomainGroupUserCO> listPage(DomainGroupUserPageQry qry) {

        return domainGroupUserQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(DomainGroupUserAddCmd cmd) {

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

    @Override
    public void edit(DomainGroupUserUpdateCmd domainGroupUserUpdateCmd) {
        domainGroupUserUpdateExe.execute(domainGroupUserUpdateCmd);
    }

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

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

    @Override
    public List<DomainGroupUserCO> listAll(DomainGroupUserPageQry qry) {
        return domainGroupUserQueryExe.listAll(qry);
    }
}

