这个其实和dao层的一样的内容
AdminService
1 package com.jsj.service; 2 3 import com.jsj.entity.Admin; 4 5 public interface AdminService { 6 7 //验证管理员输入的代码是否正确方法 8 Admin login(String username,String password); 9 }
NewCateService
1 package com.jsj.service; 2 3 import com.jsj.entity.NewsCateVo; 4 import com.jsj.entity.NewsCate; 5 6 import java.util.List; 7 8 public interface NewsCateService { 9 10 List<NewsCate> getAllCate(); 11 12 List<NewsCateVo> getAllNewsCateVo(Integer length); 13 14 NewsCate getNewsCateById(Integer id); 15 16 int insert(NewsCate newsCate); 17 18 int update(NewsCate newsCate); 19 20 int delete(Integer id); 21 }
NewsService
1 package com.jsj.service; 2 3 import com.jsj.entity.News; 4 import com.jsj.entity.NewsVo; 5 import com.jsj.entity.Page; 6 7 import java.util.List; 8 9 public interface NewsService { 10 11 Page<NewsVo> getNewsVoPage(Integer pageIndex, Integer pageSize); 12 13 Page<News> getNewsPageByCate(Integer cateId,Integer pageIndex, Integer pageSize); 14 15 List<NewsVo> getNewsVoList(Integer pageIndex,Integer length); 16 17 List<News> getNewsListByCate(Integer cateId,Integer pageIndex,Integer length); 18 19 News getNewsById(Integer id); 20 21 int publish(News news); 22 23 List<NewsVo> getAllNewsVo(); 24 25 int deleteNewsById(Integer id); 26 }
UserService
1 package com.jsj.service; 2 3 import com.jsj.entity.User; 4 5 public interface UserService{ 6 7 int register(User user); 8 9 User login(String username,String password); 10 }