-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd721d1
commit 607b0ab
Showing
2 changed files
with
67 additions
and
41 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/com/uci/transformer/controllers/XMessageController.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,25 @@ | ||
package com.uci.transformer.controllers; | ||
|
||
import com.uci.transformer.odk.ODKConsumerReactive; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.ws.rs.BadRequestException; | ||
|
||
@RestController() | ||
public class XMessageController { | ||
|
||
@Autowired | ||
private ODKConsumerReactive odkConsumerReactive; | ||
|
||
@PostMapping("/xmsg/processXMessage") | ||
public void processXMessage(@RequestBody String xMessage) { | ||
if (xMessage == null || xMessage.isEmpty() || xMessage.isBlank()) { | ||
throw new BadRequestException(); | ||
} | ||
odkConsumerReactive.processMessage(xMessage); | ||
} | ||
} |
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