package com.zcloud.basic.info.service;

import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.ImgFilesServiceI;
import com.zcloud.basic.info.command.ImgFilesAddExe;
import com.zcloud.basic.info.command.ImgFilesRemoveExe;
import com.zcloud.basic.info.command.ImgFilesUpdateExe;
import com.zcloud.basic.info.command.query.ImgFilesQueryExe;
import com.zcloud.basic.info.dto.ImgFilesAddCmd;
import com.zcloud.basic.info.dto.ImgFilesPageQry;
import com.zcloud.basic.info.dto.ImgFilesQryCmd;
import com.zcloud.basic.info.dto.ImgFilesUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
import com.zcloud.basic.info.dto.clientobject.ImgFilesBase64CO;
import com.zcloud.basic.info.dto.clientobject.ImgFilesInfoCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * web-app
 *
 * @Author zhangyue
 * @Date 2025-10-30 16:10:08
 */
@Service
@AllArgsConstructor
public class ImgFilesServiceImpl implements ImgFilesServiceI {
    private final ImgFilesAddExe imgFilesAddExe;
    private final ImgFilesUpdateExe imgFilesUpdateExe;
    private final ImgFilesRemoveExe imgFilesRemoveExe;
    private final ImgFilesQueryExe imgFilesQueryExe;

    @Override
    public PageResponse<ImgFilesCO> listPage(ImgFilesPageQry qry) {

        return imgFilesQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(ImgFilesAddCmd cmd) {
        return imgFilesAddExe.execute(cmd);
    }

    @Override
    public SingleResponse<ImgFilesInfoCO> batchAdd(ImgFilesAddCmd cmd) {
        return imgFilesAddExe.batchExecute(cmd);
    }

    @Override
    public void edit(ImgFilesUpdateCmd imgFilesUpdateCmd) {
        imgFilesUpdateExe.execute(imgFilesUpdateCmd);
    }

    @Override
    public void removeFile(String filePath) {
        imgFilesRemoveExe.execute(filePath);
    }

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

    @Override
    public void removeBatch(Map<String, Object> params) {
        imgFilesRemoveExe.execute(params);
    }

    @Override
    public MultiResponse<ImgFilesCO> listAll(ImgFilesQryCmd imgFilesQryCmd) {
        return imgFilesQueryExe.executeList(imgFilesQryCmd);
    }

    @Override
    public String getImagePath() {
        return imgFilesQueryExe.getImagePath();
    }

    @Override
    public MultiResponse<ImgFilesBase64CO> listAllBase64(ImgFilesQryCmd imgFilesQryCmd) {
        return imgFilesQueryExe.executeListBase64(imgFilesQryCmd);
    }
}

