package com.zcloud.domain.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.domain.api.ProjectTaskInfoServiceI;
import com.zcloud.domain.command.ProjectTaskInfoAddExe;
import com.zcloud.domain.command.ProjectTaskInfoRemoveExe;
import com.zcloud.domain.command.ProjectTaskInfoUpdateExe;
import com.zcloud.domain.command.query.ProjectTaskInfoQueryExe;
import com.zcloud.domain.dto.ProjectTaskInfoAddCmd;
import com.zcloud.domain.dto.ProjectTaskInfoPageQry;
import com.zcloud.domain.dto.ProjectTaskInfoUpdateCmd;
import com.zcloud.domain.dto.clientobject.ProjectTaskInfoCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:30:30
 */
@Service
@AllArgsConstructor
public class ProjectTaskInfoServiceImpl implements ProjectTaskInfoServiceI {
    private final ProjectTaskInfoAddExe projectTaskInfoAddExe;
    private final ProjectTaskInfoUpdateExe projectTaskInfoUpdateExe;
    private final ProjectTaskInfoRemoveExe projectTaskInfoRemoveExe;
    private final ProjectTaskInfoQueryExe projectTaskInfoQueryExe;

    @Override
    public PageResponse<ProjectTaskInfoCO> listPage(ProjectTaskInfoPageQry qry) {

        return projectTaskInfoQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ProjectTaskInfoAddCmd cmd) {

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

    @Override
    public void edit(ProjectTaskInfoUpdateCmd projectTaskInfoUpdateCmd) {
        projectTaskInfoUpdateExe.execute(projectTaskInfoUpdateCmd);
    }

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

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

