package com.m2pool.manage.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * @Description 管理系统html文档管理器
 * @Date 2025/7/23 10:00
 * @Author yyb
 */
@Data
@Configuration
@RefreshScope
@ConfigurationProperties("spring.data.mongodb.documentation")
public class MongoDbConfig  extends AbstractMongoDbConfig{


    @Primary
    @Bean(name = "docMongoTemplate")
    @Override
    public MongoTemplate getMongoTemplate() {
        return new MongoTemplate(mongoDatabaseNoUserFactory(host, port, database));
    }

    private String database;
    private String host;
    private String port;

}
