Java鲜花操作系统服务层
2021/6/27 17:20:46
本文主要是介绍Java鲜花操作系统服务层,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1.CustomerService
//顾客表操作
package Service; import java.util.List; import DAO.CustomerDAO; import Factory.DAOFactory; import StoreManager.Customer; public class CustomerService { CustomerDAO cusDao = DAOFactory.getCustomerDAO(); public int insert(Customer cus) throws Exception { return cusDao.insert(cus); } public void delete(String cusid) throws Exception{ cusDao.delete(cusid); } public String[][] queryById(String cusid) throws Exception{ return cusDao.queryById(cusid); } public List<String> queryAll() throws Exception{ return cusDao.queryAll(); } public void update(Customer cus) throws Exception{ cusDao.update(cus); } public int update1(Customer cus) throws Exception{ return cusDao.update1(cus); } public int shopping(double balance,String id) throws Exception{ return cusDao.shopping(balance, id); } public double getBalance(String id) throws Exception{ return cusDao.getBalance(id); } public void update2(Customer cus) throws Exception{ cusDao.update2(cus); } }
2.FlowerService
//鲜花表操作
package Service; import java.util.List; import DAO.FlowerDAO; import Factory.DAOFactory; import StoreManager.Flower; public class FlowerService { FlowerDAO floDao = DAOFactory.getFlowerDAO(); public void insert(Flower flo) throws Exception{ floDao.insert(flo); } public void delete(int flid) throws Exception{ floDao.delete(flid); } public String[][] queryById(int flid) throws Exception{ return floDao.queryById(flid); } public String[][] queryByName(String flname) throws Exception{ return floDao.queryByName(flname); } public double getPrice(String flname) throws Exception{ return floDao.getPrice(flname); } public List<String> queryAll() throws Exception{ return floDao.queryAll(); } public List<String> queryComBox() throws Exception{ return floDao.queryComBox(); } public void update(Flower flo) throws Exception{ floDao.update(flo); } public int getStore(String name) throws Exception{ return floDao.getStore(name); } public int shopping(int number,String name) throws Exception{ return floDao.shopping(number, name); } }
3.OrdersService
//订单表操作
package Service; import java.util.List; import DAO.OrdersDAO; import Factory.DAOFactory; import StoreManager.Orders; public class OrdersService { OrdersDAO orDao = DAOFactory.getOrdersDAO(); public void insert(String s1,String s2,String s3,double s4) throws Exception{ orDao.insert(s1, s2, s3, s4); } public String[][] queryById(String ordid) throws Exception{ return orDao.queryById(ordid); } public List<String> queryByC_Id(String cusid) throws Exception{ return orDao.queryByC_Id(cusid); } public List<String> queryAll() throws Exception{ return orDao.queryAll(); } public void delete(int ordid) throws Exception{ orDao.delete(ordid); } public void update(Orders ord) throws Exception{ orDao.update(ord); } public void storemessageclear(){ orDao.storemessageclear(); } }
4.UserService
//管理员表操作
package Service; import java.util.List; import DAO.UserDAO; import Factory.DAOFactory; import StoreManager.User; public class UserService { UserDAO userDAO = DAOFactory.getUserDAO(); public void insert(User user) throws Exception{ userDAO.insert(user); } public void delete(String userid) throws Exception{ userDAO.delete(userid); } public String[][] queryById(String userid) throws Exception{ return userDAO.queryById(userid); } public List<String> queryAll() throws Exception{ return userDAO.queryAll(); } public void update(User user) throws Exception{ userDAO.update(user); } public void update1(User user) throws Exception{ userDAO.update1(user); } }
这篇关于Java鲜花操作系统服务层的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-28微服务架构中API版本控制的实践
- 2024-09-28AI给的和自己写的Python代码,都无法改变输入框的内容,替换也不行
- 2024-09-27Sentinel配置限流资料:新手入门教程
- 2024-09-27Sentinel配置限流资料详解
- 2024-09-27Sentinel限流资料:新手入门教程
- 2024-09-26Sentinel限流资料入门详解
- 2024-09-26Springboot框架资料:初学者入门教程
- 2024-09-26Springboot框架资料详解:新手入门教程
- 2024-09-26Springboot企业级开发资料:新手入门指南
- 2024-09-26SpringBoot企业级开发资料新手指南