package com.zcloud.basic.info.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.UserCorpServiceI;
import com.zcloud.basic.info.command.UserCorpAddExe;
import com.zcloud.basic.info.command.UserCorpRemoveExe;
import com.zcloud.basic.info.command.UserCorpUpdateExe;
import com.zcloud.basic.info.command.query.UserCorpQueryExe;
import com.zcloud.basic.info.dto.UserCorpAddCmd;
import com.zcloud.basic.info.dto.UserCorpPageQry;
import com.zcloud.basic.info.dto.UserCorpUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.UserCorpCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author zhaokai
 * @Date 2025-12-02 11:13:33
 */
@Service
@AllArgsConstructor
public class UserCorpServiceImpl implements UserCorpServiceI {
    private final UserCorpAddExe userCorpAddExe;
    private final UserCorpUpdateExe userCorpUpdateExe;
    private final UserCorpRemoveExe userCorpRemoveExe;
    private final UserCorpQueryExe userCorpQueryExe;

    @Override
    public PageResponse<UserCorpCO> listPage(UserCorpPageQry qry) {

        return userCorpQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(UserCorpAddCmd cmd) {

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

    @Override
    public void edit(UserCorpUpdateCmd userCorpUpdateCmd) {
        userCorpUpdateExe.execute(userCorpUpdateCmd);
    }

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

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

