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

import cn.reghao.oss.api.dto.media.ImageUrlDto;
import cn.reghao.oss.api.iface.media.ImageFileService;
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:10:44
 */
@Service
public class ImageService {
    @DubboReference(check = false)
    private ImageFileService imageFileService;

    public void deleteByObjectNames(List<String> objectNames) {
        imageFileService.deleteByObjectNames(objectNames);
    }

    public void deleteByImageFileIds(List<String> imageFileIds) {
        imageFileService.deleteByImageFileIds(imageFileIds);
    }

    public ImageUrlDto getImageUrl(String channelName, String imageFileId) {
        int channelId = 1;
        return imageFileService.getImageUrl(channelId, imageFileId);
    }

    public List<ImageUrlDto> getImageUrls(Set<String> imageFileIds) {
        return imageFileService.getImageUrls(imageFileIds);
    }

    public String getSignedUrl(String url, long loginUser, int channelId) {
        return imageFileService.getSignedUrl(url);
    }
}
