package com.zcloud.domain.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.domain.api.ProjectTaskGroupUserServiceI;
import com.zcloud.domain.command.ProjectTaskGroupUserAddExe;
import com.zcloud.domain.command.ProjectTaskGroupUserRemoveExe;
import com.zcloud.domain.command.ProjectTaskGroupUserUpdateExe;
import com.zcloud.domain.command.query.ProjectTaskGroupUserQueryExe;
import com.zcloud.domain.dto.ProjectTaskDetailAddCmd;
import com.zcloud.domain.dto.ProjectTaskGroupUserAddCmd;
import com.zcloud.domain.dto.ProjectTaskGroupUserPageQry;
import com.zcloud.domain.dto.ProjectTaskGroupUserUpdateCmd;
import com.zcloud.domain.dto.clientobject.ProjectTaskGroupUserCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-29 11:28:09
 */
@Service
@AllArgsConstructor
public class ProjectTaskGroupUserServiceImpl implements ProjectTaskGroupUserServiceI {
    private final ProjectTaskGroupUserAddExe projectTaskGroupUserAddExe;
    private final ProjectTaskGroupUserUpdateExe projectTaskGroupUserUpdateExe;
    private final ProjectTaskGroupUserRemoveExe projectTaskGroupUserRemoveExe;
    private final ProjectTaskGroupUserQueryExe projectTaskGroupUserQueryExe;

    @Override
    public PageResponse<ProjectTaskGroupUserCO> listPage(ProjectTaskGroupUserPageQry qry) {

        return projectTaskGroupUserQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ProjectTaskGroupUserAddCmd cmd) {

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

    @Override
    public void edit(ProjectTaskGroupUserUpdateCmd projectTaskGroupUserUpdateCmd) {
        projectTaskGroupUserUpdateExe.execute(projectTaskGroupUserUpdateCmd);
    }

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

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

    @Override
    public SingleResponse<ProjectTaskGroupUserCO> saveGroupUser(ProjectTaskDetailAddCmd cmd) {
        projectTaskGroupUserAddExe.saveGroupUser(cmd);
        return SingleResponse.buildSuccess();
    }
}

