⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 categoryservice.java

📁 不说了
💻 JAVA
字号:
package com.david.service;

import java.util.List;
import com.david.bo.Category;
import com.david.bo.Userinfo;
import com.david.dao.ICategoryDao;
import com.david.validate.IValidate;
import com.david.validate.Validate;

public class CategoryService implements ICategoryService {

	private ICategoryDao categoryDao;
	
	private IValidate validate;
	
	public boolean addCategory(Category category) {
		// TODO Auto-generated method stub		
		if(validate.isEmpty(category.getCategoryName())||validate.isEmpty(category.getCategoryIntro())){
			return false;
		}else{
			return categoryDao.addCategory(category);
		}
	}

	public boolean deleteCategory(Category category) {
		// TODO Auto-generated method stub
		return this.categoryDao.deleteCategory(category);
	}

	public List<Category> getCategories(int start, Userinfo userinfo) {
		// TODO Auto-generated method stub		
		return categoryDao.getCategories(start, userinfo);
	}

	public void setCategoryDao(ICategoryDao categoryDao) {
		// TODO Auto-generated method stub
		this.categoryDao=categoryDao;

	}
	
	public Category getCategoryById(int id){
		return this.categoryDao.getCategoryById(id);
	}
	
	public boolean updateCategory(Category category) {
		// TODO Auto-generated method stub
		return categoryDao.updateCategory(category);
	}

	public void setValidate(Validate validate) {
		// TODO Auto-generated method stub
		this.validate=validate;
	}

	public int getCategoriesNum(Userinfo userinfo) {
		// TODO Auto-generated method stub
		return categoryDao.getCategoriesNum(userinfo);
	}

	public List<Category> getCategories(Userinfo userinfo) {
		// TODO Auto-generated method stub
		return categoryDao.getCategories(userinfo);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -