Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-4871: added the changes to persist sms in a table in mgramseva
Browse files Browse the repository at this point in the history
  • Loading branch information
debasishchakraborty-egovt committed Oct 9, 2023
1 parent d73b95d commit 8658549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ public void sendSMS(Sms sms) {
log.info("calling submitToExternalSmsService() method");
if(smsProperties.isSaveSmsEnable()) {
Long id = smsNotificationRepository.getNextSequence();
SmsSaveRequest smsSaveRequest = SmsSaveRequest.builder().id(id).mobileNumber(sms.getMobileNumber()).message(sms.getMessage())
String mobileNumber = sms.getMobileNumber();
mobileNumber = mobileNumber.substring(0, 2) + mobileNumber.substring(6);
SmsSaveRequest smsSaveRequest = SmsSaveRequest.builder().id(id).mobileNumber(mobileNumber).message(sms.getMessage())
.category(sms.getCategory()).templateId(sms.getTemplateId()).tenantId(sms.getTenantId()).createdtime(System.currentTimeMillis()).build();
log.info("SMS request to save sms topic" + smsSaveRequest);
producer.push(smsProperties.getSaveSmsTopic(), smsSaveRequest);
}
submitToExternalSmsService(sms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS eg_notification_sms (
message TEXT,
category VARCHAR(50),
template_id VARCHAR(50),
createdtime TIMESTAMP,
createdtime bigint,
tenant_id VARCHAR(50)
);
CREATE SEQUENCE seq_eg_notification_sms
Expand Down

0 comments on commit 8658549

Please sign in to comment.