Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
ba44640d
Commit
ba44640d
authored
Jun 02, 2018
by
Sajal Narang
Committed by
GitHub
Jun 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #104 from pulsejet/models
Update Data Models
parents
4f2813e2
3053402b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
17 deletions
+80
-17
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Body.java
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Body.java
+40
-2
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
...src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
+14
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/User.java
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/User.java
+26
-14
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Body.java
View file @
ba44640d
...
...
@@ -16,6 +16,9 @@ public class Body {
@ColumnInfo
(
name
=
"id"
)
@SerializedName
(
"id"
)
String
bodyID
;
@ColumnInfo
(
name
=
"str_id"
)
@SerializedName
(
"str_id"
)
String
bodyStrID
;
@ColumnInfo
(
name
=
"name"
)
@SerializedName
(
"name"
)
String
bodyName
;
...
...
@@ -40,16 +43,26 @@ public class Body {
@ColumnInfo
(
name
=
"followers_count"
)
@SerializedName
(
"followers_count"
)
int
bodyFollowersCount
;
public
Body
(
String
bodyID
,
String
bodyName
,
String
bodyDescription
,
String
bodyImageURL
,
List
<
Body
>
bodyChildren
,
List
<
Body
>
bodyParents
,
List
<
Event
>
bodyEvents
,
int
bodyFollowersCount
)
{
@ColumnInfo
(
name
=
"website_url"
)
@SerializedName
(
"website_url"
)
String
bodyWebsiteURL
;
@ColumnInfo
(
name
=
"blog_url"
)
@SerializedName
(
"blog_url"
)
String
bodyBlogURL
;
public
Body
(
String
bodyID
,
String
bodyStrID
,
String
bodyName
,
String
bodyShortDescription
,
String
bodyDescription
,
String
bodyImageURL
,
List
<
Body
>
bodyChildren
,
List
<
Body
>
bodyParents
,
List
<
Event
>
bodyEvents
,
int
bodyFollowersCount
,
String
bodyWebsiteURL
,
String
bodyBlogURL
)
{
this
.
bodyID
=
bodyID
;
this
.
bodyStrID
=
bodyStrID
;
this
.
bodyName
=
bodyName
;
this
.
bodyShortDescription
=
bodyShortDescription
;
this
.
bodyDescription
=
bodyDescription
;
this
.
bodyImageURL
=
bodyImageURL
;
this
.
bodyChildren
=
bodyChildren
;
this
.
bodyParents
=
bodyParents
;
this
.
bodyEvents
=
bodyEvents
;
this
.
bodyFollowersCount
=
bodyFollowersCount
;
this
.
bodyWebsiteURL
=
bodyWebsiteURL
;
this
.
bodyBlogURL
=
bodyBlogURL
;
}
public
String
getBodyID
()
{
...
...
@@ -60,6 +73,14 @@ public class Body {
this
.
bodyID
=
bodyID
;
}
public
String
getBodyStrID
()
{
return
bodyStrID
;
}
public
void
setBodyStrID
(
String
bodyStrID
)
{
this
.
bodyStrID
=
bodyStrID
;
}
public
String
getBodyName
()
{
return
bodyName
;
}
...
...
@@ -123,4 +144,21 @@ public class Body {
public
void
setBodyFollowersCount
(
int
bodyFollowersCount
)
{
this
.
bodyFollowersCount
=
bodyFollowersCount
;
}
public
String
getBodyWebsiteURL
()
{
return
bodyWebsiteURL
;
}
public
void
setBodyWebsiteURL
(
String
bodyWebsiteURL
)
{
this
.
bodyWebsiteURL
=
bodyWebsiteURL
;
}
public
String
getBodyBlogURL
()
{
return
bodyBlogURL
;
}
public
void
setBodyBlogURL
(
String
bodyBlogURL
)
{
this
.
bodyBlogURL
=
bodyBlogURL
;
}
}
\ No newline at end of file
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/Event.java
View file @
ba44640d
...
...
@@ -57,9 +57,13 @@ public class Event {
@ColumnInfo
(
name
=
"going"
)
@SerializedName
(
"going"
)
List
<
User
>
eventGoing
;
@ColumnInfo
(
name
=
"website_url"
)
@SerializedName
(
"website_url"
)
String
eventWebsiteURL
;
public
Event
(
String
eventID
,
String
event
Name
,
String
eventDescription
,
String
eventImageURL
,
Timestamp
eventStartTime
,
Timestamp
eventEndTime
,
boolean
allDayEvent
,
List
<
Venue
>
eventVenues
,
List
<
Body
>
eventBodies
,
int
eventInterestedCount
,
int
eventGoingCount
,
List
<
User
>
eventInterested
,
List
<
User
>
eventGoing
)
{
public
Event
(
String
eventID
,
String
event
StrID
,
String
eventName
,
String
eventDescription
,
String
eventImageURL
,
Timestamp
eventStartTime
,
Timestamp
eventEndTime
,
boolean
allDayEvent
,
List
<
Venue
>
eventVenues
,
List
<
Body
>
eventBodies
,
int
eventInterestedCount
,
int
eventGoingCount
,
List
<
User
>
eventInterested
,
List
<
User
>
eventGoing
,
String
eventWebsiteURL
)
{
this
.
eventID
=
eventID
;
this
.
eventStrID
=
eventStrID
;
this
.
eventName
=
eventName
;
this
.
eventDescription
=
eventDescription
;
this
.
eventImageURL
=
eventImageURL
;
...
...
@@ -72,6 +76,7 @@ public class Event {
this
.
eventGoingCount
=
eventGoingCount
;
this
.
eventInterested
=
eventInterested
;
this
.
eventGoing
=
eventGoing
;
this
.
eventWebsiteURL
=
eventWebsiteURL
;
}
public
String
getEventID
()
{
...
...
@@ -185,4 +190,12 @@ public class Event {
public
void
setEventGoing
(
List
<
User
>
eventGoing
)
{
this
.
eventGoing
=
eventGoing
;
}
public
String
getEventWebsiteURL
()
{
return
eventWebsiteURL
;
}
public
void
setEventWebsiteURL
(
String
eventWebsiteURL
)
{
this
.
eventWebsiteURL
=
eventWebsiteURL
;
}
}
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/data/User.java
View file @
ba44640d
...
...
@@ -33,9 +33,6 @@ public class User {
@ColumnInfo
(
name
=
"email"
)
@SerializedName
(
"email"
)
String
userEmail
;
@ColumnInfo
(
name
=
"year"
)
@SerializedName
(
"year"
)
int
userYear
;
@ColumnInfo
(
name
=
"roll_no"
)
@SerializedName
(
"roll_no"
)
String
userRollNumber
;
...
...
@@ -51,20 +48,27 @@ public class User {
@ColumnInfo
(
name
=
"followed_bodies_id"
)
@SerializedName
(
"followed_bodies_id"
)
List
<
String
>
userFollowedBodiesID
;
public
User
(
String
userID
,
String
userName
,
String
userProfilePictureUrl
,
List
<
Event
>
userInterestedEvents
,
List
<
Event
>
userGoingEvents
,
String
userEmail
,
int
userYear
,
String
userRollNumber
,
String
userContactNumber
,
String
userAbout
,
List
<
Body
>
userFollowedBodies
,
List
<
String
>
userFollowedBodiesID
)
{
@ColumnInfo
(
name
=
"website_url"
)
@SerializedName
(
"website_url"
)
String
userWebsiteURL
;
@ColumnInfo
(
name
=
"ldap_id"
)
@SerializedName
(
"ldap_id"
)
String
userLDAPId
;
public
User
(
String
userID
,
String
userName
,
String
userProfilePictureUrl
,
List
<
Event
>
userInterestedEvents
,
List
<
Event
>
userGoingEvents
,
String
userEmail
,
String
userRollNumber
,
String
userContactNumber
,
String
userAbout
,
List
<
Body
>
userFollowedBodies
,
List
<
String
>
userFollowedBodiesID
,
String
userWebsiteURL
,
String
userLDAPID
)
{
this
.
userID
=
userID
;
this
.
userName
=
userName
;
this
.
userProfilePictureUrl
=
userProfilePictureUrl
;
this
.
userInterestedEvents
=
userInterestedEvents
;
this
.
userGoingEvents
=
userGoingEvents
;
this
.
userEmail
=
userEmail
;
this
.
userYear
=
userYear
;
this
.
userRollNumber
=
userRollNumber
;
this
.
userContactNumber
=
userContactNumber
;
this
.
userAbout
=
userAbout
;
this
.
userFollowedBodies
=
userFollowedBodies
;
this
.
userFollowedBodiesID
=
userFollowedBodiesID
;
this
.
userWebsiteURL
=
userWebsiteURL
;
this
.
userLDAPId
=
userLDAPID
;
}
public
static
User
fromString
(
String
json
)
{
...
...
@@ -119,14 +123,6 @@ public class User {
this
.
userEmail
=
userEmail
;
}
public
int
getUserYear
()
{
return
userYear
;
}
public
void
setUserYear
(
int
userYear
)
{
this
.
userYear
=
userYear
;
}
public
String
getUserRollNumber
()
{
return
userRollNumber
;
}
...
...
@@ -167,6 +163,22 @@ public class User {
this
.
userFollowedBodiesID
=
userFollowedBodiesID
;
}
public
String
getUserWebsiteURL
()
{
return
userWebsiteURL
;
}
public
void
setUserWebsiteURL
(
String
userWebsiteURL
)
{
this
.
userWebsiteURL
=
userWebsiteURL
;
}
public
String
getUserLDAPId
()
{
return
userLDAPId
;
}
public
void
setUserLDAPId
(
String
userLDAPId
)
{
this
.
userLDAPId
=
userLDAPId
;
}
@Override
public
String
toString
()
{
return
new
Gson
().
toJson
(
this
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment