diff options
author | beanplebs <benalmstead@gmail.com> | 2025-02-15 15:43:35 -0500 |
---|---|---|
committer | beanplebs <benalmstead@gmail.com> | 2025-02-15 15:43:35 -0500 |
commit | 8268f5ee92372afb2f23045b25ec9bd45213f869 (patch) | |
tree | 3d01998803e9c69354875a19cbf723aa418e1a41 /ufund-api | |
parent | 27550aa067f5f763356c869c79f6ab4361ae0008 (diff) | |
download | JellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.tar.gz JellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.tar.bz2 JellySolutions-8268f5ee92372afb2f23045b25ec9bd45213f869.zip |
CupboardController CRUD methods
Diffstat (limited to 'ufund-api')
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/CupboardController.java | 40 |
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 + } + } |