v1 of userService and models
This commit is contained in:
parent
ad27db1a47
commit
53a9b1ea2e
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
package com.uam.wmi.findmytutor.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class IsUsingListBool {
|
||||
|
||||
@SerializedName("isUsing")
|
||||
@Expose
|
||||
private Boolean isUsing;
|
||||
|
||||
public Boolean getIsUsing() {
|
||||
return isUsing;
|
||||
}
|
||||
|
||||
public void setIsUsing(Boolean isUsing) {
|
||||
this.isUsing = isUsing;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.uam.wmi.findmytutor.model;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class PagedResult {
|
||||
|
||||
@SerializedName("results")
|
||||
@Expose
|
||||
private List<Result> results = null;
|
||||
@SerializedName("currentPage")
|
||||
@Expose
|
||||
private Integer currentPage;
|
||||
@SerializedName("pageCount")
|
||||
@Expose
|
||||
private Integer pageCount;
|
||||
@SerializedName("pageSize")
|
||||
@Expose
|
||||
private Integer pageSize;
|
||||
@SerializedName("rowCount")
|
||||
@Expose
|
||||
private Integer rowCount;
|
||||
@SerializedName("firstRowOnPage")
|
||||
@Expose
|
||||
private Integer firstRowOnPage;
|
||||
@SerializedName("lastRowOnPage")
|
||||
@Expose
|
||||
private Integer lastRowOnPage;
|
||||
|
||||
public List<Result> getResults() {
|
||||
return results;
|
||||
}
|
||||
|
||||
public void setResults(List<Result> results) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public Integer getCurrentPage() {
|
||||
return currentPage;
|
||||
}
|
||||
|
||||
public void setCurrentPage(Integer currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
|
||||
public Integer getPageCount() {
|
||||
return pageCount;
|
||||
}
|
||||
|
||||
public void setPageCount(Integer pageCount) {
|
||||
this.pageCount = pageCount;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getRowCount() {
|
||||
return rowCount;
|
||||
}
|
||||
|
||||
public void setRowCount(Integer rowCount) {
|
||||
this.rowCount = rowCount;
|
||||
}
|
||||
|
||||
public Integer getFirstRowOnPage() {
|
||||
return firstRowOnPage;
|
||||
}
|
||||
|
||||
public void setFirstRowOnPage(Integer firstRowOnPage) {
|
||||
this.firstRowOnPage = firstRowOnPage;
|
||||
}
|
||||
|
||||
public Integer getLastRowOnPage() {
|
||||
return lastRowOnPage;
|
||||
}
|
||||
|
||||
public void setLastRowOnPage(Integer lastRowOnPage) {
|
||||
this.lastRowOnPage = lastRowOnPage;
|
||||
}
|
||||
|
||||
}
|
163
app/src/main/java/com/uam/wmi/findmytutor/model/Result.java
Normal file
163
app/src/main/java/com/uam/wmi/findmytutor/model/Result.java
Normal file
@ -0,0 +1,163 @@
|
||||
package com.uam.wmi.findmytutor.model;
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Result {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private String id;
|
||||
@SerializedName("isOnline")
|
||||
@Expose
|
||||
private Boolean isOnline;
|
||||
@SerializedName("isUsingBlacklist")
|
||||
@Expose
|
||||
private Boolean isUsingBlacklist;
|
||||
@SerializedName("isUsingWhitelist")
|
||||
@Expose
|
||||
private Boolean isUsingWhitelist;
|
||||
@SerializedName("blacklist")
|
||||
@Expose
|
||||
private List<String> blacklist = null;
|
||||
@SerializedName("whitelist")
|
||||
@Expose
|
||||
private List<String> whitelist = null;
|
||||
@SerializedName("ldapLogin")
|
||||
@Expose
|
||||
private String ldapLogin;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("firstName")
|
||||
@Expose
|
||||
private String firstName;
|
||||
@SerializedName("lastName")
|
||||
@Expose
|
||||
private String lastName;
|
||||
@SerializedName("department")
|
||||
@Expose
|
||||
private String department;
|
||||
@SerializedName("userName")
|
||||
@Expose
|
||||
private String userName;
|
||||
@SerializedName("email")
|
||||
@Expose
|
||||
private String email;
|
||||
@SerializedName("isActive")
|
||||
@Expose
|
||||
private Boolean isActive;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Boolean getIsOnline() {
|
||||
return isOnline;
|
||||
}
|
||||
|
||||
public void setIsOnline(Boolean isOnline) {
|
||||
this.isOnline = isOnline;
|
||||
}
|
||||
|
||||
public Boolean getIsUsingBlacklist() {
|
||||
return isUsingBlacklist;
|
||||
}
|
||||
|
||||
public void setIsUsingBlacklist(Boolean isUsingBlacklist) {
|
||||
this.isUsingBlacklist = isUsingBlacklist;
|
||||
}
|
||||
|
||||
public Boolean getIsUsingWhitelist() {
|
||||
return isUsingWhitelist;
|
||||
}
|
||||
|
||||
public void setIsUsingWhitelist(Boolean isUsingWhitelist) {
|
||||
this.isUsingWhitelist = isUsingWhitelist;
|
||||
}
|
||||
|
||||
public List<String> getBlacklist() {
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
public void setBlacklist(List<String> blacklist) {
|
||||
this.blacklist = blacklist;
|
||||
}
|
||||
|
||||
public List<String> getWhitelist() {
|
||||
return whitelist;
|
||||
}
|
||||
|
||||
public void setWhitelist(List<String> whitelist) {
|
||||
this.whitelist = whitelist;
|
||||
}
|
||||
|
||||
public String getLdapLogin() {
|
||||
return ldapLogin;
|
||||
}
|
||||
|
||||
public void setLdapLogin(String ldapLogin) {
|
||||
this.ldapLogin = ldapLogin;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Boolean getIsActive() {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void setIsActive(Boolean isActive) {
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.uam.wmi.findmytutor.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class StudentIdModel {
|
||||
|
||||
@SerializedName("studentId")
|
||||
@Expose
|
||||
private String studentId;
|
||||
@SerializedName("ldapLogin")
|
||||
@Expose
|
||||
private String ldapLogin;
|
||||
|
||||
public String getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(String studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public String getLdapLogin() {
|
||||
return ldapLogin;
|
||||
}
|
||||
|
||||
public void setLdapLogin(String ldapLogin) {
|
||||
this.ldapLogin = ldapLogin;
|
||||
}
|
||||
|
||||
}
|
164
app/src/main/java/com/uam/wmi/findmytutor/model/User.java
Normal file
164
app/src/main/java/com/uam/wmi/findmytutor/model/User.java
Normal file
@ -0,0 +1,164 @@
|
||||
package com.uam.wmi.findmytutor.model;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class User {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private String id;
|
||||
@SerializedName("isOnline")
|
||||
@Expose
|
||||
private Boolean isOnline;
|
||||
@SerializedName("isUsingBlacklist")
|
||||
@Expose
|
||||
private Boolean isUsingBlacklist;
|
||||
@SerializedName("isUsingWhitelist")
|
||||
@Expose
|
||||
private Boolean isUsingWhitelist;
|
||||
@SerializedName("blacklist")
|
||||
@Expose
|
||||
private List<String> blacklist = null;
|
||||
@SerializedName("whitelist")
|
||||
@Expose
|
||||
private List<String> whitelist = null;
|
||||
@SerializedName("ldapLogin")
|
||||
@Expose
|
||||
private String ldapLogin;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("firstName")
|
||||
@Expose
|
||||
private String firstName;
|
||||
@SerializedName("lastName")
|
||||
@Expose
|
||||
private String lastName;
|
||||
@SerializedName("department")
|
||||
@Expose
|
||||
private String department;
|
||||
@SerializedName("userName")
|
||||
@Expose
|
||||
private String userName;
|
||||
@SerializedName("email")
|
||||
@Expose
|
||||
private String email;
|
||||
@SerializedName("isActive")
|
||||
@Expose
|
||||
private Boolean isActive;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Boolean getIsOnline() {
|
||||
return isOnline;
|
||||
}
|
||||
|
||||
public void setIsOnline(Boolean isOnline) {
|
||||
this.isOnline = isOnline;
|
||||
}
|
||||
|
||||
public Boolean getIsUsingBlacklist() {
|
||||
return isUsingBlacklist;
|
||||
}
|
||||
|
||||
public void setIsUsingBlacklist(Boolean isUsingBlacklist) {
|
||||
this.isUsingBlacklist = isUsingBlacklist;
|
||||
}
|
||||
|
||||
public Boolean getIsUsingWhitelist() {
|
||||
return isUsingWhitelist;
|
||||
}
|
||||
|
||||
public void setIsUsingWhitelist(Boolean isUsingWhitelist) {
|
||||
this.isUsingWhitelist = isUsingWhitelist;
|
||||
}
|
||||
|
||||
public List<String> getBlacklist() {
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
public void setBlacklist(List<String> blacklist) {
|
||||
this.blacklist = blacklist;
|
||||
}
|
||||
|
||||
public List<String> getWhitelist() {
|
||||
return whitelist;
|
||||
}
|
||||
|
||||
public void setWhitelist(List<String> whitelist) {
|
||||
this.whitelist = whitelist;
|
||||
}
|
||||
|
||||
public String getLdapLogin() {
|
||||
return ldapLogin;
|
||||
}
|
||||
|
||||
public void setLdapLogin(String ldapLogin) {
|
||||
this.ldapLogin = ldapLogin;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Boolean getIsActive() {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void setIsActive(Boolean isActive) {
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.uam.wmi.findmytutor.service;
|
||||
import com.uam.wmi.findmytutor.model.JwtToken;
|
||||
import com.uam.wmi.findmytutor.model.PagedResult;
|
||||
import com.uam.wmi.findmytutor.model.User;
|
||||
import com.uam.wmi.findmytutor.model.IsUsingListBool;
|
||||
import com.uam.wmi.findmytutor.model.StudentIdModel;
|
||||
import java.util.List;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.DELETE;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Header;
|
||||
|
||||
public interface UserService {
|
||||
@GET("api/users")
|
||||
Call<List<User>> getAllUsers(@Header("Authorization") JwtToken token);
|
||||
|
||||
@POST("api/users")
|
||||
Call<List<User>> postAllUsers(@Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("api/users/page/{pageNum}")
|
||||
Call<PagedResult> getPagedUsers(@Path("pageNum") String pageNum, @Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("/api/users/tutors/page/{pageNum}")
|
||||
Call<PagedResult> getPagedTutors(@Path("pageNum") String pageNum, @Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("/api/users/students/page/{pageNum}")
|
||||
Call<PagedResult> getPagedStudents(@Path("pageNum") String pageNum, @Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("api/users/{id}")
|
||||
Call<User> getUserByID(@Path("id") String userID, @Header("Authorization") JwtToken token);
|
||||
|
||||
@PUT("api/users/{id}")
|
||||
Call<User> updateUserByID(@Path("id") String userID, @Body User user,@Header("Authorization") JwtToken token);
|
||||
|
||||
@DELETE("api/users/{id}")
|
||||
Call<User> deleteUserByID(@Path("id") String userID, @Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("api/users/userLogin/{ldapLogin}")
|
||||
Call<String> getUserLdapLogin(@Path("ldapLogin") String ldapLogin,@Header("Authorization") JwtToken token);
|
||||
|
||||
@PUT("api/users/setActive/{userID}")
|
||||
Call<User> setUserActive(@Path("userID") String userID,@Header("Authorization") JwtToken token);
|
||||
|
||||
@PUT("api/users/setInActive/{userID}")
|
||||
Call<User> setUserInActive(@Path("userID") String userID,@Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("api/users/blacklist/{tutorID}")
|
||||
Call<List<User>> getTutorBlacklistedByID(@Path("tutorID") String tutorID,@Header("Authorization") JwtToken token);
|
||||
|
||||
@PUT("api/users/blacklist/{tutorID}")
|
||||
Call<User> setTutorBlacklist(@Path("tutorID") String tutorID, @Body IsUsingListBool isUsing,@Header("Authorization") JwtToken token);
|
||||
|
||||
@POST("api/users/blacklist/{tutorID}")
|
||||
Call<List<User>> addStudentToBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student,@Header("Authorization") JwtToken token);
|
||||
|
||||
@DELETE("api/users/blacklist/{tutorID}")
|
||||
Call<List<User>> removeStudentFromBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student,@Header("Authorization") JwtToken token);
|
||||
|
||||
@GET("api/users/whitelist/{tutorID}")
|
||||
Call<List<User>> getTutorwhitelistedByID(@Path("tutorID") String tutorID,@Header("Authorization") JwtToken token);
|
||||
|
||||
@PUT("api/users/whitelist/{tutorID}")
|
||||
Call<User> setTutorWhitelist(@Path("tutorID") String tutorID, @Body IsUsingListBool isUsing,@Header("Authorization") JwtToken token);
|
||||
|
||||
@POST("api/users/whitelist/{tutorID}")
|
||||
Call<List<User>> addStudentTowhitelist(@Path("tutorID") String tutorID, @Body StudentIdModel student,@Header("Authorization") JwtToken token);
|
||||
|
||||
@DELETE("api/users/whitelist/{tutorID}")
|
||||
Call<List<User>> removeStudentFromWhitelist(@Path("tutorID") String tutorID, @Body StudentIdModel student,@Header("Authorization") JwtToken token);
|
||||
}
|
@ -7,7 +7,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.2'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
Loading…
Reference in New Issue
Block a user