Skip to content

Commit

Permalink
4.0.1 user report (#163)
Browse files Browse the repository at this point in the history
* Added user and user enrolment report generation feature

Co-authored-by: Manas-tarento <[email protected]>
Co-authored-by: Juhi <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2022
1 parent 557c931 commit df944f4
Show file tree
Hide file tree
Showing 22 changed files with 1,632 additions and 396 deletions.
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,17 @@
<version>18.0.0</version>
</dependency>


<!-- Apache POI - for generating CSV / XLS Reports. -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11</version>
</dependency>
</dependencies>

<build>
Expand Down
132 changes: 67 additions & 65 deletions src/main/java/org/sunbird/cassandra/utils/CassandraOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,79 @@
*/
public interface CassandraOperation {

/**
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param request Map<String,Object>(i.e map of column name and their value)
* @return Response
* @desc This method is used to insert record in cassandra db
*/
/**
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param request Map<String,Object>(i.e map of column name and their
* value)
* @return Response
* @desc This method is used to insert record in cassandra db
*/

public SBApiResponse insertRecord(String keyspaceName, String tableName, Map<String, Object> request);
public SBApiResponse insertRecord(String keyspaceName, String tableName, Map<String, Object> request);

/**
* Insert bulk data using batch
*
* @param keyspaceName String
* @param tableName String
* @param request List<Map<String, Object>>
* @return SBApiResponse
*/
public SBApiResponse insertBulkRecord(String keyspaceName, String tableName, List<Map<String, Object>> request);
/**
* Insert bulk data using batch
*
* @param keyspaceName String
* @param tableName String
* @param request List<Map<String, Object>>
* @return SBApiResponse
*/
public SBApiResponse insertBulkRecord(String keyspaceName, String tableName, List<Map<String, Object>> request);

/**
* Fetch records with specified columns (select all if null) for given column
* map (name, value pairs).
*
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param propertyMap Map describing columns to be used in where clause of select query.
* @param fields List of columns to be returned in each record
* @return List consisting of fetched records
*/
List<Map<String, Object>> getRecordsByProperties(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields);
/**
* Fetch records with specified columns (select all if null) for given column
* map (name, value pairs).
*
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param propertyMap Map describing columns to be used in where clause of
* select query.
* @param fields List of columns to be returned in each record
* @return List consisting of fetched records
*/
List<Map<String, Object>> getRecordsByProperties(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields);

/**
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param keyMap Column map for composite primary key
* @desc This method is used to delete record in cassandra db by their primary
* composite key
*/
public void deleteRecord(String keyspaceName, String tableName, Map<String, Object> keyMap);
/**
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param keyMap Column map for composite primary key
* @desc This method is used to delete record in cassandra db by their primary
* composite key
*/
public void deleteRecord(String keyspaceName, String tableName, Map<String, Object> keyMap);

/**
* Method to update the record on basis of composite primary key.
*
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param updateAttributes Column map to be used in set clause of update query
* @param compositeKey Column map for composite primary key
* @return Response consisting of update query status
*/
Map<String, Object> updateRecord(String keyspaceName, String tableName, Map<String, Object> updateAttributes,
Map<String, Object> compositeKey);
/**
* Method to update the record on basis of composite primary key.
*
* @param keyspaceName Keyspace name
* @param tableName Table name
* @param updateAttributes Column map to be used in set clause of update query
* @param compositeKey Column map for composite primary key
* @return Response consisting of update query status
*/
Map<String, Object> updateRecord(String keyspaceName, String tableName, Map<String, Object> updateAttributes,
Map<String, Object> compositeKey);

/**
* To get count of all records
*
* @param keyspace String
* @param table String
* @return Long
*/
public Long getRecordCount(String keyspace, String table);
/**
* To get count of all records
*
* @param keyspace String
* @param table String
* @return Long
*/
public Long getRecordCount(String keyspace, String table);

public Map<String, Object> getRecordsByProperties(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields,String key);
public Map<String, Object> getRecordsByPropertiesWithPagination(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields, int limit, String updatedOn,String key);
List<Map<String, Object>> searchByWhereClause(
String keyspace,
String tableName,
List<String> fields,
Date date);
public Map<String, Object> getRecordsByProperties(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields, String key);

public Map<String, Object> getRecordsByPropertiesWithPagination(String keyspaceName, String tableName,
Map<String, Object> propertyMap, List<String> fields, int limit, String updatedOn, String key);

List<Map<String, Object>> searchByWhereClause(String keyspace, String tableName, List<String> fields, Date date);

public void getAllRecords(String keyspace, String table, List<String> fields, String key,
Map<String, Map<String, String>> objectInfo);
}
Loading

0 comments on commit df944f4

Please sign in to comment.