Skip to content

API controller

Vu edited this page Apr 4, 2025 · 9 revisions

PLEASE GO TO project-insight/db/CSV_file_to_Import_Database to get the .CSV files to build you database in your local machine

Here are the APIs that I have created (some of it is still empty, which means you will not receive any result(NULL)). If you guys need any more methods or suggestions, leave comments.

models (these are what I'm gonna return to front-end, because you use GUI so the return value is an Object not a JSON)

Employee { int empid; String Fname; String Lname; String job_title; String email; double salary; String ssn;

int getEmpid() { return empid }
String getFname() { return Fname }
...

} EmployeePayInfo{ int empid, String Fname, String Lname, Date payDate, double earning, double fed_tax, double fed_med, double fed_SS, double state_tax, double retire_401K, double health_care

int getEmpid() { return empid }
String getFname() { return Fname }
....

} User { int empid int role; (0 for admin, 1 for employee) int getEmpid() {return empid} public int getRole() {return role}

API Controller(these are the methods you guys can use):

TO LOGIN:

UserLogin.login(String username, String password) =======> return User{}

TO VIEW EMPLOYEE INFO:

EmployeeInfo.viewEmployeeInfoById(int empid) =======> return Employee{} EmployeeInfo.viewEmployeeInfoByName(String Name, String Name) =======> return Employee{} EmployeeInfo.viewEmployeeInfoBySsn(String ssn) =======> return Employee{}

TO VIEW EMPLOYEE PAY INFO (FOR REPORT)

Report.getEmployeePayReport(int empId) =======> return A LIST OF Report.getTotalPayByJobtitle(int jobtitle_id) =======> return a float number Report.getEmployeeReportByDivision(int division_id) =======> return a float number

(please prompt admin to input jobtitle_id or division_id NOT THE NAME), you can refer to the database to know the id

TO UPDATE SALARY BY RANGE:

UpdateRangeSalary.updateRangeSalary(int min, int max, int increment) =======> return an integer of how many people got updated

TO UPDATE Employee INFORMATION: (To be provided)

Clone this wiki locally