Skip to content

mshumba/CodeU23

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring 2019 CodeU Project

Usage of Datastore

When retrieving information about usesr:

  1. Prepare:
import com.google.codeu.service.Session;
Session session = new Session();
  1. Check if the user is logged in. Returns boolean value of whether is logged in
session.isLoggedIn(request,response);
  • If not logged in,
response.sendRedirect("/login");
  1. If logged in,query the datastore
 \\if you want to look up users with the key-value pair property
  List<User> users = datastore.findUserBy(key,value);
 \\ if you want to find the user that is currently logged in.
  User user = session.getCurrentUser(request,response);

Current User data structure

  private String userName;
  private String gender;
  private String email;
  private String birthday;
  private String description;

If you want to add other data field, please update the findUserBy and getCurrentUser method. It should be pretty straight forward how to update it.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

1 star

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors