Skip to content

Commit 3a3fd1c

Browse files
Modified generate's endpoint generate to accept array of events
1 parent 7ea6195 commit 3a3fd1c

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

service/src/main/java/com/ericsson/eiffel/remrem/generate/constants/RemremGenerateServiceConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public final class RemremGenerateServiceConstants {
2525
public static final String NO_TEMPLATE_ERROR = "{\"status_code\": 404, \"result\": \"FAIL\", "
2626
+ "\"message\":\"Requested template is not available\"}";
2727

28-
public static final String TEMPLATE_ERROR = "{\"status_code\": 400, \"result\": \"FAIL\", "
28+
public static final String TEMPLATE_ERROR = "{\"status_code\": 400, \"result\": \"fail\", "
2929
+ "\"message\":\"Template is not correct format or something is missing in the template, please check\"}";
3030

3131
public static final String INTERNAL_SERVER_ERROR = "{\"status_code\": 500, \"result\": \"FAIL\", "

service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,24 +205,37 @@ public ResponseEntity<?> generate(final String msgProtocol, final String msgType
205205
}
206206
}
207207

208-
209208
/**
210209
* To display response in browser or application
211-
* @param status response code for the HTTP request
210+
* @param status response code for the HTTP request
212211
* @param responseMessage the message according to response
213-
* @param resultMessage whatever the result this message gives you idea about that
214-
* @param errorResponse is to collect all the responses here.
212+
* @param resultMessage whatever the result this message gives you idea about that
213+
* @param errorResponse is to collect all the responses here.
215214
* @return ResponseEntity
216215
*/
217216
public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String responseMessage, String resultMessage,
218217
JsonObject errorResponse) {
219218
initializeResponse(status, responseMessage, resultMessage, errorResponse);
220219
return new ResponseEntity<>(errorResponse, status);
221220
}
221+
222+
/**
223+
* To display response in browser or application
224+
* @param status response code for the HTTP request
225+
* @param responseMessage the message according to response
226+
* @param resultMessage whatever the result this message gives you idea about that
227+
* @return ResponseEntity
228+
*/
222229
public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String responseMessage, String resultMessage) {
223230
return createResponseEntity(status, responseMessage, resultMessage, new JsonObject());
224231
}
225232

233+
/**
234+
* To initialize in the @{createResponseEntity} method
235+
* @param status response code for the HTTP request
236+
* @param resultMessage whatever the result this message gives you idea about that
237+
* @param errorResponse is to collect all the responses here.
238+
*/
226239
public void initializeResponse(HttpStatus status, String errorMessage, String resultMessage, JsonObject errorResponse) {
227240
errorResponse.addProperty(JSON_STATUS_CODE, status.value());
228241
errorResponse.addProperty(JSON_STATUS_RESULT, resultMessage);
@@ -268,7 +281,6 @@ private ResponseEntity<JsonObject> handleException(Exception e) {
268281
* @param jsonObject The content of the message which is used in creating the event details.
269282
* @return JsonObject generated event
270283
*/
271-
272284
public JsonObject processEvent(String msgProtocol, String msgType, Boolean failIfMultipleFound,
273285
Boolean failIfNoneFound, Boolean lookupInExternalERs, int lookupLimit,
274286
Boolean okToLeaveOutInvalidOptionalFields, JsonObject jsonObject) throws REMGenerateException, JsonSyntaxException {

0 commit comments

Comments
 (0)