Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

MUMPFL-115 Show student birthdate #51

Merged
merged 2 commits into from
Oct 13, 2015
Merged
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
16 changes: 16 additions & 0 deletions my-profile-api/src/main/java/edu/wisc/my/profile/model/User.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.wisc.my.profile.model;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -15,6 +17,8 @@ public class User implements Comparable{
public String pvi;
@JsonProperty("middleName")
public String middleName;
@JsonProperty("DOB")
public Date birthDate;


/**
Expand Down Expand Up @@ -67,6 +71,18 @@ public void setPvi(String pvi) {
this.pvi = pvi;
}

/**
* @return the birthDate
*/
public Date getBirthDate() {
return birthDate;
}
/**
* @param birthDate the birthDate to set
*/
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
@Override
public int compareTo(Object o) {
if(o == null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public User mapRow(ResultSet argResults, int argRowNum ) throws SQLException {
tempUser.setPvi(argResults.getString("PVI"));
tempUser.setLastName(argResults.getString("LAST_NAME"));
tempUser.setMiddleName(argResults.getString("MIDDLE_NAME"));
tempUser.setBirthDate(argResults.getDate("BIRTHDATE"));
return tempUser;
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void setUsernameAttr(String attr) {
user.put("firstName", u.getFirstName());
user.put("pvi", u.getPvi());
user.put("middleName", u.getMiddleName());
user.put("birthDate", u.getBirthDate());
userList.put(user);
}
jsonToReturn.put("people", userList);
Expand Down
12 changes: 8 additions & 4 deletions my-profile-webapp/src/main/resources/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
"PVI":"admin",
"lastName":"Administrator",
"middleName":"Ashley",
"firstName":"Amy"
"firstName":"Amy",
"DOB" : "1988-04-16"
},
{
"PVI":"staff",
"lastName":"Staff",
"middleName":"Flag",
"firstName":"Samuel"
"firstName":"Samuel",
"DOB" : "1991-09-24"
},
{
"PVI":"student",
"lastName":"Student",
"middleName":"tooCoolForSchool",
"firstName":"Steven"
"firstName":"Steven",
"DOB" : "1987-10-31"
},
{
"PVI":"student2",
"lastName":"Student",
"middleName":"notCoolEnoughForSchool",
"firstName":"Steve"
"firstName":"Steve",
"DOB" : "1987-11-09"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-xs-6">
<div class="userSearchResultName">
<span><strong>
{{people.firstName}} {{people.middleName}} {{people.lastName}}
{{people.firstName}} {{people.middleName}} {{people.lastName}} - Date of Birth: {{people.birthDate | date:'shortDate'}}
</strong></span>
</div>
</div>
Expand Down