-
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.
Merge pull request #116 from samagra-comms/development
Development Merge
- Loading branch information
Showing
6 changed files
with
137 additions
and
104 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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/uci/transformer/controllers/ODKController.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 com.uci.transformer.controllers; | ||
|
||
import com.uci.transformer.odk.FormDownloader; | ||
import lombok.extern.java.Log; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@Slf4j | ||
public class ODKController { | ||
|
||
@GetMapping(path = "/odk/updateAll") | ||
public void updateAllODKForms() { | ||
log.info("Updating forms...."); | ||
new FormDownloader().downloadFormsDelta(); | ||
} | ||
} |
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.RestController; | ||
import reactor.core.publisher.Mono; | ||
|
||
import javax.ws.rs.BadRequestException; | ||
|
||
@RestController() | ||
public class XMessageController { | ||
|
||
@Autowired | ||
private ODKConsumerReactive odkConsumerReactive; | ||
|
||
@PostMapping("/xmsg/processXMessage") | ||
public Mono<String> processXMessage(@RequestBody String xMessage) { | ||
if (xMessage == null || xMessage.isEmpty() || xMessage.isBlank()) { | ||
throw new BadRequestException(); | ||
} | ||
return 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
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