Skip to content

Commit 38eac3b

Browse files
Merge pull request #126 from KB-iGOT/4.8.30-dev-v1
4.8.30 dev v1
2 parents aa62e5d + b45f45e commit 38eac3b

File tree

9 files changed

+645
-8
lines changed

9 files changed

+645
-8
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17-slim
1+
FROM openjdk:17.0.1-jdk-slim
22

33
RUN apt-get update \
44
&& apt-get install -y \

Dockerfile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17-slim
1+
FROM openjdk:17.0.1-jdk-slim
22

33
RUN apt update && apt install maven -y
44

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.igot.cb.controller;
2+
3+
import com.igot.cb.util.Constants;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.http.ResponseEntity;
6+
import org.springframework.web.bind.annotation.*;
7+
8+
import com.igot.cb.model.ApiResponse;
9+
import com.igot.cb.service.NotificationService;
10+
11+
import java.util.Map;
12+
13+
@RestController
14+
@RequestMapping("/v1/notifyAssignment")
15+
public class NotificationController {
16+
17+
@Autowired
18+
private NotificationService notificationService;
19+
20+
/**
21+
* Notifies learners in a batch that an instructor uploaded an assignment.
22+
*
23+
* @param requestData the request body containing courseId, batchId and assignmentTitle
24+
* @param authToken the authentication token for the user
25+
* @return a ResponseEntity containing the ApiResponse with notification result
26+
*/
27+
@PostMapping("/upload")
28+
public ResponseEntity<Object> notifyAssignmentUploaded(@RequestBody Map<String, Object> requestData, @RequestHeader(Constants.X_AUTH_TOKEN) String authToken) {
29+
ApiResponse response = notificationService.notifyAssignmentUploaded(requestData, authToken);
30+
return new ResponseEntity<>(response, response.getResponseCode());
31+
}
32+
33+
/**
34+
* Notifies learners in a batch that an instructor evaluated an assignment.
35+
*
36+
* @param requestData the request body containing courseId, batchId, assignmentTitle and learnerId
37+
* @param authToken the authentication token for the user
38+
* @return a ResponseEntity containing the ApiResponse with notification result
39+
*/
40+
@PostMapping("/evaluate")
41+
public ResponseEntity<Object> notifyAssignmentEvaluation(@RequestBody Map<String, Object> requestData, @RequestHeader(Constants.X_AUTH_TOKEN) String authToken) {
42+
ApiResponse response = notificationService.notifyAssignmentEvaluate(requestData, authToken);
43+
return new ResponseEntity<>(response, response.getResponseCode());
44+
}
45+
46+
/**
47+
* Notifies learners in a batch that a learner submitted an assignment.
48+
*
49+
* @param requestData the request body containing courseId, batchId and assignmentTitle and instructorId
50+
* @param authToken the authentication token for the user
51+
* @return a ResponseEntity containing the ApiResponse with notification result
52+
*/
53+
@PostMapping("/submit")
54+
public ResponseEntity<Object> notifyAssignmentSubmit(@RequestBody Map<String, Object> requestData, @RequestHeader(Constants.X_AUTH_TOKEN) String authToken) {
55+
ApiResponse response = notificationService.notifyAssignmentSubmit(requestData, authToken);
56+
return new ResponseEntity<>(response, response.getResponseCode());
57+
}
58+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.igot.cb.service;
2+
3+
import com.igot.cb.model.ApiResponse;
4+
5+
import java.util.Map;
6+
7+
public interface NotificationService {
8+
9+
ApiResponse notifyAssignmentUploaded(Map<String, Object> requestData, String authToken);
10+
11+
ApiResponse notifyAssignmentEvaluate(Map<String, Object> requestData, String authToken);
12+
13+
ApiResponse notifyAssignmentSubmit(Map<String, Object> requestData, String authToken);
14+
15+
}

0 commit comments

Comments
 (0)