Skip to content
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

Closed
wants to merge 10 commits into from
Closed

Bsoptei append user data #2

wants to merge 10 commits into from

Conversation

bsoptei
Copy link
Collaborator

@bsoptei bsoptei commented Jan 31, 2017

No description provided.

@bsoptei
Copy link
Collaborator Author

bsoptei commented Feb 1, 2017

@adamgyulavari /login and /register endpoints are ready to go (needs fine tuning but ready to connect with front end)

// getContext().
// getAuthentication().
// getName();
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsoptei remove commented code

Copy link
Collaborator Author

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);
}
}
Copy link
Contributor

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.

Copy link
Collaborator Author

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;
Copy link
Contributor

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>

Copy link
Collaborator Author

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)

Copy link
Collaborator Author

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;
Copy link
Contributor

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()

Copy link
Collaborator Author

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

@bsoptei bsoptei closed this Feb 2, 2017
@bsoptei bsoptei deleted the bsoptei-append_user_data branch February 2, 2017 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants