Skip to content

Commit

Permalink
refactor: Controller method order
Browse files Browse the repository at this point in the history
  • Loading branch information
apetro committed Feb 23, 2018
1 parent a30e355 commit 989f0e3
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public class MessagesController {
private MessagesService messagesService;
private IsMemberOfHeaderParser isMemberOfHeaderParser;

@RequestMapping("/")
public Map<String, String> index() {
HashMap<String, String> statusResponse = new HashMap<>();
statusResponse.put("status", "up");
return statusResponse;
}

/**
* Messages filtered to the context of the request. <p> Expects user group memberships as
* isMemberOf header with semicolon-delimited values. Fails gracefully in absence of this header.
Expand Down Expand Up @@ -65,11 +72,15 @@ public Map<String, Object> allMessages() {
return responseMap;
}

@RequestMapping("/")
public Map<String, String> index() {
HashMap<String, String> statusResponse = new HashMap<>();
statusResponse.put("status", "up");
return statusResponse;
/**
* Get a specific message regardless of the message's audience, dates, etc.
*
* @param id message ID to match
* @return Message with matching ID
*/
@RequestMapping("/admin/message/{id}")
public Message messageById(@PathVariable String id) {
return messagesService.messageById(id);
}

@Autowired
Expand All @@ -82,15 +93,4 @@ public void setIsMemberOfHeaderParser(
IsMemberOfHeaderParser isMemberOfHeaderParser) {
this.isMemberOfHeaderParser = isMemberOfHeaderParser;
}

/**
* Get a specific message regardless of the message's audience, dates, etc.
*
* @param id message ID to match
* @return Message with matching ID
*/
@RequestMapping("/admin/message/{id}")
public Message messageById(@PathVariable String id) {
return messagesService.messageById(id);
}
}

0 comments on commit 989f0e3

Please sign in to comment.