package com.seer.teach.common.minio.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Captain
 * @Description: MinIo配置类
 * @Date: 2025-05-19 14:14
 */
@Data
@Configuration
public class MinioConfig implements InitializingBean {

    @Value("${minio.url:}")
    private String url;

    @Value("${minio.endpoint:http://192.168.0.39:9300}")
    private String endpoint;

    @Value("${minio.accessKey:}")
    private String accessKey;

    @Value("${minio.secretKey:}")
    private String secretKey;

    @Value("${minio.bucket:}")
    private String bucket;

    @Value("${minio.aiCorrect:}")
    private String aiCorrect;

    @Value("${minio.avatar:}")
    private String avatar;

    @Value("${minio.wxQrCodeImage:}")
    private String wxQrCodeImage;

    @Value("${minio.aiAudio:}")
    private String aiAudio;

    @Value("${minio.aiChatAudio:}")
    private String aiChatAudio;

    @Value("${minio.aiSmartAudio:}")
    private String aiSmartAudio;

    @Value("${minio.aiHealthArticleAudio:}")
    private String aiHealthArticleAudio;

    @Value("${minio.aiPreview:}")
    private String aiPreview;

    @Value("${minio.aiReview:}")
    private String aiReview;

    @Value("${minio.userAudios:}")
    private String userAudios;

    @Value("${minio.chatLogFolder:}")
    private String chatLogFolder;

    @Value("${minio.androidFolder:}")
    private String androidFolder;

    @Value("${minio.banner:}")
    private String banner;

    @Value("${minio.textBook:textbook}")
    private String textBook;

    public static String URL;
    public static String END_POINT;
    public static String ACCESS_KEY;
    public static String SECRET_KEY;
    public static String BUCKET;
    public static String AI_CORRECT_FOlDER;
    public static String AVATAR_FOlDER;
    public static String WX_QR_CODE_IMAGE_FOlDER;
    public static String AI_AUDIO_FOlDER;
    public static String AI_CHAT_AUDIO;
    public static String AI_SMART_AUDIO;
    public static String AI_HEALTH_ARTICLE_AUDIO;
    public static String AI_PREVIEW_AUDIO;
    public static String AI_REVIEW_AUDIO;
    public static String USER_AUDIOS;
    public static String ChAT_LOG_FOLDER;
    public static String ANDROID_FOLDER;
    public static String BANNER;
    public static String TEXT_BOOK;

    @Override
    public void afterPropertiesSet() throws Exception {
        URL = this.url;
        END_POINT = this.endpoint;
        ACCESS_KEY = this.accessKey;
        SECRET_KEY = this.secretKey;
        BUCKET = this.bucket;
        AI_CORRECT_FOlDER = this.aiCorrect;
        AVATAR_FOlDER = this.avatar;
        WX_QR_CODE_IMAGE_FOlDER = this.wxQrCodeImage;
        AI_AUDIO_FOlDER = this.aiAudio;
        AI_CHAT_AUDIO = this.aiChatAudio;
        AI_SMART_AUDIO = this.aiSmartAudio;
        AI_HEALTH_ARTICLE_AUDIO = this.aiHealthArticleAudio;
        AI_PREVIEW_AUDIO = this.aiPreview;
        AI_REVIEW_AUDIO = this.aiReview;
        USER_AUDIOS = this.userAudios;
        ChAT_LOG_FOLDER = this.chatLogFolder;
        ANDROID_FOLDER = this.androidFolder;
        BANNER = this.banner;
        TEXT_BOOK = this.textBook;
    }
}