package com.mosty.wzzx.config.mongo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

@Configuration
@EnableMongoRepositories(basePackages = {"com.mosty.wzzx.mongodb"}, mongoTemplateRef = "mostyMongoTemplate")
@ConfigurationProperties(prefix = "spring.data.mongodb")
public class AdminMongoConfigure extends AbstractMongoConfigure {

    @Bean(name = "mostyMongoTemplate")
    @Override
    public MongoTemplate getMongoTemplate() throws Exception {
        return new MongoTemplate(mongoDbFactory());
    }
}
