package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.VideoServiceI;
import com.zcloud.primeport.command.VideoAddExe;
import com.zcloud.primeport.command.VideoRemoveExe;
import com.zcloud.primeport.command.VideoUpdateExe;
import com.zcloud.primeport.command.query.VideoQueryExe;
import com.zcloud.primeport.dto.VideoAddCmd;
import com.zcloud.primeport.dto.VideoPageQry;
import com.zcloud.primeport.dto.VideoUpdateCmd;
import com.zcloud.primeport.dto.clientobject.VideoCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:31
 */
@Service
@AllArgsConstructor
public class VideoServiceImpl implements VideoServiceI {
    private final VideoAddExe videoAddExe;
    private final VideoUpdateExe videoUpdateExe;
    private final VideoRemoveExe videoRemoveExe;
    private final VideoQueryExe videoQueryExe;

    @Override
    public PageResponse<VideoCO> listPage(VideoPageQry qry) {

        return videoQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(VideoAddCmd cmd) {

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

    @Override
    public void edit(VideoUpdateCmd videoUpdateCmd) {
        videoUpdateExe.execute(videoUpdateCmd);
    }

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

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

    @Override
    public VideoCO getInfoById(Long id) {
        return videoQueryExe.getInfoById(id);
    }
}

