package com.zcloud.domain.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.domain.api.ProjectTaskScoreInfoServiceI;
import com.zcloud.domain.command.ProjectTaskScoreInfoAddExe;
import com.zcloud.domain.command.ProjectTaskScoreInfoRemoveExe;
import com.zcloud.domain.command.ProjectTaskScoreInfoUpdateExe;
import com.zcloud.domain.command.query.ProjectTaskScoreInfoQueryExe;
import com.zcloud.domain.dto.*;
import com.zcloud.domain.dto.clientobject.ProjectTaskScoreInfoCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:30:46
 */
@Service
@AllArgsConstructor
public class ProjectTaskScoreInfoServiceImpl implements ProjectTaskScoreInfoServiceI {
    private final ProjectTaskScoreInfoAddExe projectTaskScoreInfoAddExe;
    private final ProjectTaskScoreInfoUpdateExe projectTaskScoreInfoUpdateExe;
    private final ProjectTaskScoreInfoRemoveExe projectTaskScoreInfoRemoveExe;
    private final ProjectTaskScoreInfoQueryExe projectTaskScoreInfoQueryExe;

    @Override
    public PageResponse<ProjectTaskScoreInfoCO> listPage(ProjectTaskScoreInfoPageQry qry) {

        return projectTaskScoreInfoQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ProjectTaskScoreInfoAddCmd cmd) {

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

    @Override
    public void edit(ProjectTaskScoreInfoUpdateCmd projectTaskScoreInfoUpdateCmd) {
        projectTaskScoreInfoUpdateExe.execute(projectTaskScoreInfoUpdateCmd);
    }

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

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

    @Override
    public void setScore(ProjectTaskSetScoreCmd projectTaskSetScoreCmd) {
        projectTaskScoreInfoUpdateExe.setScore(projectTaskSetScoreCmd);
    }

    @Override
    public SingleResponse<ProjectTaskScoreInfoCO> saveScoreUser(ProjectTaskDetailAddCmd cmd) {
        projectTaskScoreInfoAddExe.saveScoreUser(cmd);
        return SingleResponse.buildSuccess();
    }
}

