package com.kt.event.content.infra.gateway.mock;

import com.kt.event.content.biz.usecase.out.CDNUploader;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

/**
 * Mock CDN Uploader (테스트용)
 * 실제 Azure Blob Storage 연동 전까지 사용
 */
@Slf4j
@Component
@Profile({"local", "test"})
public class MockCDNUploader implements CDNUploader {

    private static final String MOCK_CDN_BASE_URL = "https://cdn.kt-event.com/images/mock";

    @Override
    public String upload(byte[] imageData, String fileName) {
        log.info("[MOCK] CDN에 이미지 업로드: fileName={}, size={} bytes",
                fileName, imageData.length);

        // Mock CDN URL 생성
        String mockUrl = String.format("%s/%s", MOCK_CDN_BASE_URL, fileName);

        log.info("[MOCK] 업로드된 CDN URL: {}", mockUrl);

        return mockUrl;
    }
}
