Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification setting #247

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d58d604
RC-Synch
kumarpawantarento Aug 8, 2023
07a50f0
Update SunbirdRCApplication.java
kumarpawantarento Aug 8, 2023
a80f8c6
Update SunbirdRCApplication.java
kumarpawantarento Aug 8, 2023
2f6db6a
schema updates
kumarpawantarento Aug 9, 2023
5131363
cors issue
kumarpawantarento Aug 9, 2023
5c3a6a8
feeRecipt
kumarpawantarento Aug 9, 2023
a173d8e
cors filter removal
kumarpawantarento Aug 9, 2023
817f318
cors config
kumarpawantarento Aug 9, 2023
d62bf3a
multifiles upload and single files upload
kumarpawantarento Aug 10, 2023
c245ca6
schema updates
kumarpawantarento Aug 10, 2023
795aa89
XXX
kumarpawantarento Aug 10, 2023
7fe9e28
json updates
kumarpawantarento Aug 10, 2023
454a1ef
json change
kumarpawantarento Aug 10, 2023
60a6018
cors issue
kumarpawantarento Aug 10, 2023
7809c2e
claim-ms
kumarpawantarento Aug 14, 2023
fd31bc3
json correction
kumarpawantarento Aug 15, 2023
0252ce4
json fix
kumarpawantarento Aug 16, 2023
1e56ca8
mail integration upto pending item
rahu-tarento Aug 16, 2023
21e8169
Mail integration up-to pending Item
rahu-tarento Aug 16, 2023
12ca11d
Merge and resolve conflict
rahu-tarento Aug 16, 2023
3f24085
Added new feature to persist user credential through API
rahu-tarento Aug 16, 2023
2be20ed
Merge pull request #1 from kumarpawantarento/rahu_um_new
kumarpawantarento Aug 18, 2023
18fb1e7
digilocker implementation
kumarpawantarento Aug 18, 2023
f01aaac
credType updates
kumarpawantarento Aug 21, 2023
bb3acf3
course api
kumarpawantarento Aug 22, 2023
2a54322
Sending pending item mail to foreign council Regulator through cron job
rahu-tarento Aug 22, 2023
d87612f
Merge and conflict resolved. Removed unused snippet from claim
rahu-tarento Aug 22, 2023
037b69a
student verification
kumarpawantarento Aug 22, 2023
d36344d
Cred Type addition in pending action item.
rahu-tarento Aug 22, 2023
9f2d016
review changes
kumarpawantarento Aug 22, 2023
abc8a4c
Support direct call for send OTP and User creation mail.
rahu-tarento Aug 22, 2023
dceba4c
Merge pull request #2 from kumarpawantarento/rahu_um_new
kumarpawantarento Aug 22, 2023
54b2a9c
diploma change
kumarpawantarento Aug 22, 2023
0bb5e79
Merge branch 'main' into rahu_mail_integration
rahu-tarento Aug 22, 2023
3724775
Send manual pending action item for foreign student
rahu-tarento Aug 23, 2023
78027dd
Merge pull request #3 from kumarpawantarento/rahu_mail_integration
kumarpawantarento Aug 23, 2023
3b0e50e
claim get course
kumarpawantarento Aug 23, 2023
5d3871f
outside up
kumarpawantarento Aug 23, 2023
209b370
certificate number
kumarpawantarento Aug 24, 2023
ac1bf0c
Verify link with candidate details and approval. Manual mail send to …
rahu-tarento Aug 24, 2023
9e615f7
Merge branch 'main' into rahu_verify_mail
rahu-tarento Aug 24, 2023
dac0e30
Merge pull request #4 from kumarpawantarento/rahu_verify_mail
kumarpawantarento Aug 24, 2023
304b97d
api request
kumarpawantarento Aug 24, 2023
59e8dad
Merge branch 'main' of https://github.com/kumarpawantarento/sunbird-r…
kumarpawantarento Aug 24, 2023
9ab9959
api request
kumarpawantarento Aug 24, 2023
818b699
updates
kumarpawantarento Aug 25, 2023
14927e9
adding user represtation and role representation details to auth tok…
mahesh-maney Aug 27, 2023
ff682aa
outside up fix
kumarpawantarento Aug 29, 2023
84f75d7
Auto mail for foreign, outside, from up and good standing candidate. …
rahu-tarento Aug 29, 2023
e1e78e2
Merge branch 'main' into rahu_auto_manual_mail
rahu-tarento Aug 29, 2023
0052168
Merge pull request #5 from kumarpawantarento/rahu_auto_manual_mail
kumarpawantarento Aug 29, 2023
cf7d3a4
notifications setting
kumarpawantarento Aug 29, 2023
487997a
notification change
kumarpawantarento Aug 29, 2023
ce6e36a
Send mail notification with default password while calling candidate …
rahu-tarento Aug 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions java/123.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set MAVEN_HOME=D:\apache-maven-3.9.1\
set PATH=%PATH%;D:\apache-maven-3.9.1\bin\
set CLASSPATH=%CLASSPATH%;D:\apache-maven-3.9.1\lib\
mvn clean install -DskipTests
2 changes: 1 addition & 1 deletion java/claim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jdk-alpine
FROM openjdk:17-oracle
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
89 changes: 85 additions & 4 deletions java/claim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,78 @@
<relativePath/>
</parent>
<properties>
<java.version>1.8</java.version>
<java.version>11</java.version>
<spring-cloud-gcp.version>4.1.1</spring-cloud-gcp.version>
<spring-cloud.version>2022.0.1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>5.5.2</version>
</dependency>
<!-- jpa, crud repository -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-vision</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-storage</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-storage</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2022.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>4.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- PostgreSQL -->
<dependency>
<groupId>org.postgresql</groupId>
Expand Down Expand Up @@ -84,7 +143,29 @@
<version>2.0.3</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
</dependencies>

<build>
Expand All @@ -96,4 +177,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@SpringBootApplication
@ComponentScan(basePackages = { "dev.sunbirdrc.registry.middleware", "dev.sunbirdrc.claim"})
@EnableAsync
public class ClaimsApplication {
public static void main(String[] args) {
SpringApplication.run(ClaimsApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dev.sunbirdrc.claim.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.SimpleMailMessage;

@Configuration
public class EmailConfig
{
@Bean
public SimpleMailMessage emailTemplate()
{
SimpleMailMessage message = new SimpleMailMessage();
message.setTo("kumarpawans@gmail.com");
message.setFrom("shishir.suman@tarento.com");
message.setSubject("Identity Card link for UPSMF");
message.setText("FATAL - Application crash. Save your job !!");
return message;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package dev.sunbirdrc.claim.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data
public class PropertyMapper {
@Value("${simple.mail.message.from}")
private String simpleMailMessageFrom;

@Value("${foreign.pending.item.subject}")
private String foreignPendingItemSubject;

@Value("${outside.up.pending.item.subject}")
private String outsideUpPendingItemSubject;

@Value("${from.up.pending.item.subject}")
private String fromUpPendingItemSubject;

@Value("${good.standing.pending.item.subject}")
private String goodStandingPendingItemSubject;

@Value("${up.council.name}")
private String upCouncilName;

@Value("${regulator.table.name}")
private String regulatorTableName;

@Value("${student.foreign.verification.table.name}")
private String studentForeignVerificationTableName;

@Value("${student.outside.verification.table.name}")
private String studentOutsideVerificationTableName;

@Value("${claim.url}")
private String claimUrl;

@Value("${registry.shard.id}")
private String registryShardId;

@Value("${student.foreign.entity.name}")
private String studentForeignEntityName;

@Value("${student.from.up.entity.name}")
private String studentFromUpEntityName;

@Value("${student.from.outside.entity.name}")
private String studentFromOutsideEntityName;

@Value("${student.good.standing.entity.name}")
private String studentGoodStandingEntityName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ public class AttributeNames {
public static final String ENTITY = "ENTITY";
public static final String LOWERCASE_ENTITY = "entity";;
public static final String ATTESTOR_INFO = "attestorInfo";

public static final String REQUESTOR_INFO = "reguestorInfo";
public static final String CONTENT = "content";
public static final String TOTAL_PAGES = "totalPages";
public static final String TOTAL_ELEMENTS = "totalElements";

public static final String JPG = "JPG";
public static final String JPEG = "JPEG";
public static final String PNG = "PNG";
public static final String GIF = "GIF";
public static final String PDF = "PDF";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package dev.sunbirdrc.claim.controller;

import dev.sunbirdrc.claim.service.CertificateNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CertificateNumberController {

private CertificateNumberService certificateNumberService;

@Autowired
public CertificateNumberController(CertificateNumberService certificateNumberService) {
this.certificateNumberService = certificateNumberService;
}

@GetMapping("/api/v1/generate-certNumber")
public Long generateNumber() {
return certificateNumberService.generateAndSaveNumber();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import dev.sunbirdrc.claim.service.ClaimService;
import dev.sunbirdrc.claim.service.ClaimsAuthorizer;
import dev.sunbirdrc.pojos.dto.ClaimDTO;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -17,11 +18,11 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Optional;

import static dev.sunbirdrc.claim.contants.AttributeNames.ATTESTOR_INFO;
import static dev.sunbirdrc.claim.contants.AttributeNames.LOWERCASE_ENTITY;
import static dev.sunbirdrc.claim.contants.AttributeNames.*;

@Controller
public class ClaimsController {
Expand All @@ -45,6 +46,15 @@ public ResponseEntity<Map<String, Object>> getClaims(@RequestHeader HttpHeaders
return new ResponseEntity<>(claims, HttpStatus.OK);
}


@RequestMapping(value = "/api/v2/getClaims", method = RequestMethod.POST)
public ResponseEntity<List<Claim>> getStudentClaims(@RequestHeader HttpHeaders headers,
@RequestBody JsonNode requestBody, Pageable pageable) {
String entity = requestBody.get(LOWERCASE_ENTITY).asText();
JsonNode attestorNode = requestBody.get(ATTESTOR_INFO);
List<Claim> claims = claimService.findByRequestorName(attestorNode.asText(), pageable);
return new ResponseEntity<>(claims, HttpStatus.OK);
}
@RequestMapping(value = "/api/v1/getClaims/{claimId}", method = RequestMethod.POST)
public ResponseEntity<ClaimWithNotesDTO> getClaimById(@RequestHeader HttpHeaders headers, @PathVariable String claimId,
@RequestBody JsonNode requestBody) {
Expand All @@ -64,7 +74,11 @@ public ResponseEntity<ClaimWithNotesDTO> getClaimById(@RequestHeader HttpHeaders

@RequestMapping(value = "/api/v1/claims", method = RequestMethod.POST)
public ResponseEntity<Claim> save(@RequestBody ClaimDTO claimDTO) {
JSONObject jsonObject = new JSONObject(claimDTO.getPropertyData());
String credType1 = jsonObject.get("credType").toString();
claimDTO.setCredtype(credType1);
logger.info("Adding new claimDTO {} ", claimDTO.toString());
logger.info("Cred Type new claimDTO {} ", claimDTO.getCredtype());
Claim savedClaim = claimService.save(Claim.fromDTO(claimDTO));
claimService.addNotes(claimDTO.getNotes(), savedClaim, claimDTO.getRequestorName());
return new ResponseEntity<>(savedClaim, HttpStatus.OK);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package dev.sunbirdrc.claim.controller;

import dev.sunbirdrc.claim.entity.Courses;
import dev.sunbirdrc.claim.service.CoursesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

@RestController
@RequestMapping("/api/v1/courses")
public class CoursesController {

private CoursesService coursesService;

@Autowired
public CoursesController(CoursesService coursesService) {
this.coursesService = coursesService;
}

@GetMapping("/all")
public ResponseEntity<List<Courses>> getAllCourses() {
List<Courses> courses = coursesService.getAllCourses();
return ResponseEntity.ok(courses);
}

@GetMapping("/")
public ResponseEntity<List<String>> getAllCourseName() {
List<Courses> courses = coursesService.getAllCourses();
List<String> courseName = new ArrayList<>();
for (Courses course:courses) {
courseName.add(course.getCourseName());
}
return ResponseEntity.ok(courseName);
}

@GetMapping("/{id}")
public ResponseEntity<Courses> getCourseById(@PathVariable Long id) {
Optional<Courses> course = coursesService.getCourseById(id);

if (course.isPresent()) {
return ResponseEntity.ok(course.get());
} else {
return ResponseEntity.notFound().build();
}
}

@GetMapping("/category")
public ResponseEntity<Courses> getCourseByName(@RequestParam(value = "category", required = false) String category) {
Optional<Courses> course = coursesService.getCourseByCourse(category);

if (course.isPresent()) {
return ResponseEntity.ok(course.get());
} else {
return ResponseEntity.notFound().build();
}
}

@GetMapping("/diploma")
public ResponseEntity<List<String>> getCourseByCategory(@RequestParam(value = "category", required = false) String category) {
List<String> course = coursesService.getCourseByCategory(category);
return ResponseEntity.ok(course);
}

@GetMapping("/course-template-key/{courseName}")
public ResponseEntity<String> getCourseShortName(@PathVariable String courseName) {
courseName = courseName.replace(" ","");
String course = coursesService.getCourseTemplateKey(courseName);
return ResponseEntity.ok(course);
}

@PostMapping
public ResponseEntity<Courses> createCourse(@RequestBody Courses course) {
Courses savedCourse = coursesService.createCourse(course);
return ResponseEntity.ok(savedCourse);
}
}
Loading