package com.zcloud.basic.info.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.CorpFormServiceI;
import com.zcloud.basic.info.command.CorpFormAddExe;
import com.zcloud.basic.info.command.CorpFormRemoveExe;
import com.zcloud.basic.info.command.CorpFormUpdateExe;
import com.zcloud.basic.info.command.query.CorpFormQueryExe;
import com.zcloud.basic.info.dto.CorpFormAddCmd;
import com.zcloud.basic.info.dto.CorpFormPageQry;
import com.zcloud.basic.info.dto.CorpFormUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.CorpFormCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-10-29 16:02:27
 */
@Service
@AllArgsConstructor
public class CorpFormServiceImpl implements CorpFormServiceI {
    private final CorpFormAddExe corpFormAddExe;
    private final CorpFormUpdateExe corpFormUpdateExe;
    private final CorpFormRemoveExe corpFormRemoveExe;
    private final CorpFormQueryExe corpFormQueryExe;

    @Override
    public PageResponse<CorpFormCO> listPage(CorpFormPageQry qry) {

        return corpFormQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(CorpFormAddCmd cmd) {

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

    @Override
    public void edit(CorpFormUpdateCmd corpFormUpdateCmd) {
        corpFormUpdateExe.execute(corpFormUpdateCmd);
    }

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

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

