Add template for assignment 1
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package dst.ass1.doc;
|
||||
|
||||
import org.bson.Document;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IDocumentQuery {
|
||||
|
||||
Document findLocationById(Long locationId);
|
||||
|
||||
List<Long> findIdsByNameAndRadius(String name, double longitude, double latitude, double radius);
|
||||
|
||||
List<Document> getDocumentStatistics();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package dst.ass1.doc;
|
||||
|
||||
import dst.ass1.jpa.model.ILocation;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IDocumentRepository {
|
||||
|
||||
void insert(ILocation location, Map<String, Object> locationProperties);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package dst.ass1.doc;
|
||||
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
|
||||
public interface IDocumentServiceFactory {
|
||||
|
||||
IDocumentQuery createDocumentQuery(MongoDatabase db);
|
||||
|
||||
IDocumentRepository createDocumentRepository();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package dst.ass1.doc.impl;
|
||||
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import dst.ass1.doc.IDocumentQuery;
|
||||
import dst.ass1.doc.IDocumentRepository;
|
||||
import dst.ass1.doc.IDocumentServiceFactory;
|
||||
|
||||
public class DocumentServiceFactory implements IDocumentServiceFactory {
|
||||
|
||||
@Override
|
||||
public IDocumentQuery createDocumentQuery(MongoDatabase db) {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDocumentRepository createDocumentRepository() {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user