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.
Merge pull request #600 from egovernments/develop
Develop
- Loading branch information
Showing
30 changed files
with
189 additions
and
26 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
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
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
26 changes: 26 additions & 0 deletions
26
...v-notification-sms/src/main/java/org/egov/web/notification/sms/models/SmsSaveRequest.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,26 @@ | ||
package org.egov.web.notification.sms.models; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
import static org.apache.commons.lang3.StringUtils.isNotEmpty; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
@ToString | ||
public class SmsSaveRequest { | ||
private Long id; | ||
private String mobileNumber; | ||
private String message; | ||
private Category category; | ||
private Long createdtime; | ||
private String templateId; | ||
private String tenantId; | ||
public boolean isValid() { | ||
|
||
return isNotEmpty(mobileNumber) && isNotEmpty(message); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../egov-notification-sms/src/main/java/org/egov/web/notification/sms/producer/Producer.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,18 @@ | ||
package org.egov.web.notification.sms.producer; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.egov.tracer.kafka.CustomKafkaTemplate; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@Slf4j | ||
public class Producer { | ||
|
||
@Autowired | ||
private CustomKafkaTemplate<String, Object> kafkaTemplate; | ||
|
||
public void push(String topic, Object value) { | ||
kafkaTemplate.send(topic, value); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...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,24 @@ | ||
package org.egov.web.notification.sms.repository.builder; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.stereotype.Repository; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
@Component | ||
@Slf4j | ||
@Repository | ||
public class SmsNotificationRepository { | ||
|
||
@Autowired | ||
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
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
9 changes: 9 additions & 0 deletions
9
core-services/egov-notification-sms/src/main/resources/db/Dockerfile
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,9 @@ | ||
FROM egovio/flyway:4.1.2 | ||
|
||
COPY ./migration/main /flyway/sql | ||
|
||
COPY migrate.sh /usr/bin/migrate.sh | ||
|
||
RUN chmod +x /usr/bin/migrate.sh | ||
|
||
CMD ["/usr/bin/migrate.sh"] |
3 changes: 3 additions & 0 deletions
3
core-services/egov-notification-sms/src/main/resources/db/migrate.sh
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,3 @@ | ||
#!/bin/sh | ||
|
||
flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate |
17 changes: 17 additions & 0 deletions
17
...cation-sms/src/main/resources/db/migration/main/V20231006150836__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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE TABLE IF NOT EXISTS eg_notification_sms ( | ||
id bigint NOT NULL, | ||
mobile_no VARCHAR(20) NOT NULL, | ||
message TEXT, | ||
category VARCHAR(50), | ||
template_id VARCHAR(50), | ||
createdtime bigint, | ||
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); | ||
|
2 changes: 1 addition & 1 deletion
2
frontend/mgramseva/lib/model/connection/water_connection.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.