Skip to content

Commit

Permalink
Merge branch 'release-4.9.0' of https://github.com/samagra-comms/dao
Browse files Browse the repository at this point in the history
…into v2-integration
  • Loading branch information
surabhi-mahawar committed Jul 19, 2022
2 parents ec5fcf7 + 5378453 commit f0bd6bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/uci/dao/config/CassandraConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected List<String> getMigrationScripts() {
allScripts.add("ALTER TABLE " + keyspace + ".XMessage ADD sessionId uuid;");
allScripts.add("ALTER TABLE " + keyspace + ".XMessage ADD ownerOrgId text;");
allScripts.add("ALTER TABLE " + keyspace + ".XMessage ADD ownerId text;");

allScripts.add("ALTER TABLE " + keyspace + ".XMessage ADD botUuid uuid;");

// allScripts.add("CREATE INDEX IF NOT EXISTS message_state_index\n" +
// "ON "+keyspace
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/uci/dao/models/XMessageDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ public class XMessageDAO implements Serializable {

@Column
private String ownerId;

@Column
private UUID botUuid;
}
30 changes: 0 additions & 30 deletions src/main/java/com/uci/dao/repository/XMessageRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,27 @@ public interface XMessageRepository extends ReactiveCassandraRepository<XMessage

@AllowFiltering
Mono<Boolean> existsByUserId(String userID);

Flux<List<XMessageDAO>> findAllByFromIdOrderByTimestampDesc(String fromID);

Flux<XMessageDAO> findFirstByFromIdOrderByTimestampDesc(String fromID);

Flux<XMessageDAO> findFirstByAppOrderByTimestampDesc(String appName);

@AllowFiltering
Flux<XMessageDAO> findAllByUserId(Pageable pageable, String userID);

Flux<XMessageDAO> findByMessageId(String messageID);

Flux<XMessageDAO> findFirstByReplyIdOrderByTimestampDesc(String replyId);

Flux<XMessageDAO> findFirstByCauseIdAndMessageStateOrderByTimestampDesc(String causeId, String messageState);

@AllowFiltering
Flux<List<XMessageDAO>> findAllByUserIdOrderByTimestampDesc(String userID);

@AllowFiltering
Flux<XMessageDAO> findAllByUserIdAndTimestampAfter(String userID, LocalDateTime timestamp);

Flux<XMessageDAO> findTopByFromIdAndMessageStateOrderByTimestampDesc(String fromId, String messageState);

Flux<XMessageDAO> findFirstByUserIdAndCauseIdAndMessageStateOrderByTimestampDesc(String userId, String causeId, String messageState);

Flux<XMessageDAO> findTopByUserIdOrderByTimestampDesc(String userId);

@AllowFiltering
Flux<XMessageDAO> findAllByFromIdAndTimestampAfter(String userID, LocalDateTime timestamp);

@AllowFiltering
Flux<XMessageDAO> findById(UUID uuid);

Flux<XMessageDAO> findByXMessageAndUserId(XMessage xmsg, String userID);

@AllowFiltering
Flux<XMessageDAO> findFirstByAppAndUserIdAndFromIdAndMessageStateOrderByTimestampDesc(String app, String userID, String fromId, String messageState);

@AllowFiltering
Flux<XMessageDAO> findAllByUserIdOrderByTimestamp(String userID);

@AllowFiltering
Flux<Slice<XMessageDAO>> findAllByUserIdAndFromId(Pageable paging, String userID, String fromID);

@AllowFiltering
Mono<Slice<XMessageDAO>> findAllByAppAndTimestampAfterAndTimestampBeforeAndProvider(Pageable paging, String name, Timestamp startDate, Timestamp endDate, String provider);

@AllowFiltering
Mono<Slice<XMessageDAO>> findAllByUserIdAndTimestampAfterAndTimestampBeforeAndProvider(Pageable paging, String userId, Timestamp startDate, Timestamp endDate, String provider);

@AllowFiltering
Mono<Slice<XMessageDAO>> findAllByUserIdInAndFromIdInAndTimestampAfterAndTimestampBeforeAndProvider(Pageable paging, List<String> listUserId, List<String> listFromId, Timestamp startDate, Timestamp endDate, String provider);

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/uci/dao/utils/XMessageDAOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static XMessageDAO convertXMessageToDAO(XMessage xmsg) {
xmsgDao.setSessionId(xmsg.getSessionId());
xmsgDao.setOwnerOrgId(xmsg.getOwnerOrgId());
xmsgDao.setOwnerId(xmsg.getOwnerId());
xmsgDao.setBotUuid(xmsg.getBotId());

LocalDateTime triggerTime =
LocalDateTime.ofInstant(Instant.ofEpochMilli(xmsg.getTimestamp()),
Expand Down

0 comments on commit f0bd6bc

Please sign in to comment.