New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bsoptei append user data #2
Conversation
@adamgyulavari /login and /register endpoints are ready to go (needs fine tuning but ready to connect with front end) |
// getContext(). | ||
// getAuthentication(). | ||
// getName(); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsoptei remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
public ResponseEntity generateResponse() { | ||
return new ResponseEntity<>("", createResponseHeaders(), HttpStatus.BAD_REQUEST); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsoptei why different classes for creating a ResponseEntity?
the ResponseEntity should be created in the controller, just the first parameters should be defined as different response objects: eg. ContactListResponse
, EmptyResponse
, SingleContactResponse
, etc...
These should be simple classes that can be serialized by the default serializer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fixed it,
crud responses need fine tuning though.
but /login and /register are cool
going to push soon
* Created by BSoptei on 2/1/2017. | ||
*/ | ||
public class ListedItemsResponse extends CustomServerResponse { | ||
private String body; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsoptei not string body here, but a List<Contact>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently it is converted into a String from a List (this is one type of a solution for the do-not-display-all-user-data problem)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw. we also tried with the @JsonIgnore annotation in the User class but it did not work
URI location = URI.create("https://raptor-konnekt.herokuapp.com"); | ||
responseHeaders.setLocation(location); | ||
responseHeaders.set("session_token",token); | ||
return responseHeaders; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsoptei you can call the defaults using super.createResponseHeaders()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried but it won't allow me to
call the responseHeaders.set("session_token",token)
I was going to do it with the getHeaders().set("session_token", token) approach but it's not allowed
No description provided.