-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModels.java
66 lines (43 loc) · 1.26 KB
/
Models.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Bank Java
*
* @author Al-fariqy Raihan Azhwar (NPM : 202143501514)
* @version 1.0
*
*/
import java.util.HashMap;
public class Models implements Entities {
/*
* Model for deposit feature
*/
public HashMap<String, Integer> AddModel (int UserId, int BookId, int BookAmount) {
/**
* user_id
* book_id
* book_amount
*/
HashMap<String, Integer> AddBorrower = new HashMap<String, Integer>();
AddBorrower.put("user_id", UserId);
AddBorrower.put("book_id", BookId);
AddBorrower.put("book_amount", BookAmount);
return AddBorrower;
}
/*
* Model for transfer feature
*/
public HashMap<String, Integer> EditModel (int Id, int UserId, int BookId, int BookAmount) {
HashMap<String, Integer> EditBorrower = this.AddModel(
UserId, BookId, BookAmount);
EditBorrower.put("id", Id);
return EditBorrower;
}
/*
* Model for mutation feature
*/
public HashMap<String, Integer> DeleteModel (int Id) {
// User Token
HashMap<String, Integer> DeleteBorrower = new HashMap<String, Integer>();
DeleteBorrower.put("id", Id);
return DeleteBorrower;
}
}