Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

GNUT GNUT-SERVICES-HOURTWO #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,6 @@ Centralize configuration for all micro services.
- [Spring cloud bootstrap](https://github.com/eugenp/tutorials/tree/master/spring-cloud/spring-cloud-bootstrap)
- [Securing cloud services](http://www.baeldung.com/spring-cloud-securing-services)

## From Eric
I just get a little bit confused, I just added the Rank into it.
No familiar with the server
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
public class ActionDto {
private String recipient;

enum Rank {
ADMIRAL(6), VICE_ADMIRAL(5), CAPTAIN(4), COMMANDER(3), LIEUTENANT(2), ENSIGN(1), CREWMAN(0);
private int rank;

private Rank(int rank) {
this.rank = rank;
}
}

public ActionDto() {

}

public ActionDto(String recipient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class MessageController {
public Message sendMessage(@RequestBody Message message, @CookieValue("SESSION") String cookie) {
checkAccess(new ActionDto(message.getRecipient()), cookie);
return messageRepository.save(message);

//check for user who is sending the message based on cookie
//compare the ranks through an error
}

@RequestMapping(value = "/messages", method = RequestMethod.GET)
Expand Down