blob: dba88db24b9396718cc74cee1e29635351219f92 (
plain) (
blame)
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
|
package com.ufund.api.ufundapi.controller;
import com.ufund.api.ufundapi.model.Cupboard;
import com.ufund.api.ufundapi.model.Need;
import com.ufund.api.ufundapi.persistence.CupboardDAO;
import java.util.ArrayList;
public class CupboardController {
private ArrayList<Need> needs;
private Cupboard cupboard;
private CupboardDAO dao;
public CupboardController(CupboardDAO dao) {
this.dao = dao;
}
public void createNeed(String name, double max, Need.GoalType type) {;
cupboard.createNeed(name, max, type);
//dao.createNeed(need);
//implement in dao
}
public Need[] getNeeds() {
return cupboard.getNeeds();
//return dao.getNeeds();
//implement in dao
}
public Need getNeed(int index) {
return cupboard.getNeed(index);
//return dao.getNeed();
//implement in dao
}
public void updateNeed(Need need) {
cupboard.updateNeed(need);
//dao.updateNeed(need);
//implement in dao
}
public void deleteNeed(String name) {
cupboard.removeNeed(name);
//dao.removeNeed(name);
//implement in dao
}
}
|