package com.zcloud.zcGbsServicer.service;

import com.zcloud.zcGbsServicer.api.ResourcePersonServiceI;
import com.zcloud.zcGbsServicer.command.ResourcePersonAddExe;
import com.zcloud.zcGbsServicer.command.ResourcePersonRemoveExe;
import com.zcloud.zcGbsServicer.command.ResourcePersonUpdateExe;
import com.zcloud.zcGbsServicer.command.query.ResourcePersonQueryExe;
import com.zcloud.zcGbsServicer.dto.ResourcePersonAddCmd;
import com.zcloud.zcGbsServicer.dto.ResourcePersonPageQry;
import com.zcloud.zcGbsServicer.dto.ResourcePersonUpdateCmd;
import com.zcloud.zcGbsServicer.dto.clientobject.ResourcePersonCO;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
* web-app
* @Author makejava
* @Date 2026-01-21 17:23:34
*/
@Service
@AllArgsConstructor
public class ResourcePersonServiceImpl implements ResourcePersonServiceI {
    private final ResourcePersonAddExe resourcePersonAddExe;
    private final ResourcePersonUpdateExe resourcePersonUpdateExe;
    private final ResourcePersonRemoveExe resourcePersonRemoveExe;
    private final ResourcePersonQueryExe resourcePersonQueryExe;

    @Override
    public PageResponse<ResourcePersonCO> listPage(ResourcePersonPageQry qry){

        return resourcePersonQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ResourcePersonAddCmd cmd) {

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

    @Override
    public void edit(ResourcePersonUpdateCmd resourcePersonUpdateCmd) {
        resourcePersonUpdateExe.execute(resourcePersonUpdateCmd);
    }

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

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

