package com.mosty.wzzx.config.mongo;

import lombok.Data;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;

@Data
public abstract class AbstractMongoConfigure {
    private String uri;

    public MongoDatabaseFactory mongoDbFactory() {
        return new SimpleMongoClientDatabaseFactory(uri);
    }

    abstract public MongoTemplate getMongoTemplate() throws Exception;
}
