package com.zcloud.basic.info.service;

import com.alibaba.cola.dto.MultiResponse;
import com.zcloud.basic.info.api.UserChangeRecordServiceI;
import com.zcloud.basic.info.command.UserChangeRecordAddExe;
import com.zcloud.basic.info.command.UserChangeRecordRemoveExe;
import com.zcloud.basic.info.command.UserChangeRecordUpdateExe;
import com.zcloud.basic.info.command.query.UserChangeRecordQueryExe;
import com.zcloud.basic.info.dto.*;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author SondonYong
 * @Date 2025-12-02 14:08:19
 */
@Service
@AllArgsConstructor
public class UserChangeRecordServiceImpl implements UserChangeRecordServiceI {
    private final UserChangeRecordAddExe userChangeRecordAddExe;
    private final UserChangeRecordUpdateExe userChangeRecordUpdateExe;
    private final UserChangeRecordRemoveExe userChangeRecordRemoveExe;
    private final UserChangeRecordQueryExe userChangeRecordQueryExe;

    @Override
    public PageResponse<UserChangeRecordCO> listPage(UserChangeRecordPageQry qry) {
        return userChangeRecordQueryExe.execute(qry);
    }

    @Override
    public MultiResponse<UserChangeRecordCO> list(UserChangeRecordListQry qry) {
        return userChangeRecordQueryExe.execute(qry);
    }

    @Override
    public SingleResponse<UserChangeRecordCO> getInfoById(Long id) {
        return userChangeRecordQueryExe.execute(id);
    }

    @Override
    public SingleResponse add(UserChangeRecordAddCmd cmd) {
        userChangeRecordAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(UserChangeRecordUpdateCmd cmd) {
        userChangeRecordUpdateExe.execute(cmd);
    }

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

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

    @Override
    public UserChangeRecordCO getChangerRecordInfoById(UserChangeRecordInfoQry userChangeRecordInfoQry) {
        return userChangeRecordQueryExe.getChangerRecordInfoById(userChangeRecordInfoQry);
    }
}

