package cn.reghao.oss.web.app.service.media;

import cn.reghao.oss.api.iface.media.ConvertService;
import cn.reghao.oss.api.iface.media.MediaScopeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * @author reghao
 * @date 2024-02-23 09:24:05
 */
@Service
public class MediaService {
    @DubboReference(check = false)
    private ConvertService convertService;
    @DubboReference(check = false)
    private MediaScopeService mediaScopeService;

    public void convertVideo(String videoFileId) {
        convertService.convertVideo(videoFileId);
    }

    public void convertAudio(String audioFileId) {
        convertService.convertAudio(audioFileId);
    }

    @Deprecated
    public void setVideoScope(String videoFileId, int scope) {
        mediaScopeService.setVideoScope(videoFileId, scope);
    }

    @Deprecated
    public void setAudioScope(String audioFileId, int scope) {
        mediaScopeService.setAudioScope(audioFileId, scope);
    }

    @Deprecated
    public void setImagesScope(Set<String> imageFileIds, int scope) {
        mediaScopeService.setImagesScope(imageFileIds, scope);
    }

    public void setObjectScope(int scope, String objectId, int contentType) {
        mediaScopeService.setObjectScope(scope, objectId, contentType);
    }

    public void setObjectsScope(int scope, List<String> objectIds, int contentType) {
        mediaScopeService.setObjectsScope(scope, objectIds, contentType);
    }
}
