aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src
diff options
context:
space:
mode:
authorbeanplebs <benalmstead@gmail.com>2025-02-15 15:43:35 -0500
committerbeanplebs <benalmstead@gmail.com>2025-02-15 15:43:35 -0500
commit8268f5ee92372afb2f23045b25ec9bd45213f869 (patch)
tree3d01998803e9c69354875a19cbf723aa418e1a41 /ufund-api/src
parent27550aa067f5f763356c869c79f6ab4361ae0008 (diff)
downloadJellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.tar.gz
JellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.tar.bz2
JellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.zip
CupboardController CRUD methods
Diffstat (limited to 'ufund-api/src')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java40
1 files changed, 38 insertions, 2 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java
index 6b200d3..85f9933 100644
--- a/ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java
+++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java
@@ -2,6 +2,42 @@ package com.ufund.api.ufundapi;
import java.util.ArrayList;
-public class Cupboard {
- ArrayList<Need> needs;
+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
+ }
+
}