This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PFM-4871: added the changes to persist sms in a table in mgramseva
- Loading branch information
debasishchakraborty-egovt
committed
Oct 6, 2023
1 parent
f9818bc
commit 2153189
Showing
5 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...main/java/org/egov/web/notification/sms/repository/builder/SmsNotificationRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.egov.web.notification.sms.repository.builder; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.stereotype.Repository; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
@Component | ||
@Slf4j | ||
@Repository | ||
public class SmsNotificationRepository { | ||
|
||
private JdbcTemplate jdbcTemplate; | ||
|
||
public static final String SELECT_NEXT_SEQUENCE_USER = "select nextval('seq_eg_notification_sms')"; | ||
|
||
public Long getNextSequence() { | ||
return jdbcTemplate.queryForObject(SELECT_NEXT_SEQUENCE_USER, Long.class); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
...ication-sms/src/main/resources/db/migration.main/V20231005150835_notification_sms_ddl.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
CREATE TABLE IF NOT EXISTS eg_notification_sms ( | ||
id SERIAL PRIMARY KEY, | ||
id bigint NOT NULL, | ||
mobile_no VARCHAR(20) NOT NULL, | ||
message TEXT, | ||
category VARCHAR(50), | ||
template_id VARCHAR(50), | ||
createdtime TIMESTAMP, | ||
tenant_id VARCHAR(50) | ||
); | ||
CREATE SEQUENCE seq_eg_notification_sms | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER TABLE eg_notification_sms ADD CONSTRAINT eg_notification_sms_pkey PRIMARY KEY (id); | ||
|