作者主页:编程指南针
简介:Java领域优质创作者、CSDN博客专家 Java项目、简历模板、学习资料、面试题库、技术互助
文末获取源码
项目编号:BS-XX-074
考研管理系统基于SpringBoot + SpringMVC+MyBatis 框架实现,前台采用VUE框架。数据库采用MYSQL。
功能主要包含文章管理、评论管理、签到管理、好友管理等功能
部分功能展示
后台登录首页
编辑
用户管理
编辑
菜单管理
编辑
个人中心
编辑
文章管理
编辑
添加文章
编辑
评论管理
编辑
签到管理
编辑
好友管理
编辑
篇幅所限,就不在一一叙说具体单个功能模块了,本文章主要介绍一些相关的项目实现
部分实现代码:
package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.AdminMapper; import model.Admin; import service.AdminService; @Service public class AdminServiceImpl implements AdminService { @Autowired AdminMapper adminDao; @Override public int logIn(String account, String password) { Boolean isexist = existAccount(account); if (isexist) { Admin admin = getAdminByAccount(account); if (admin.getPassword().equals(password)) { return 2; } return 1; } return 0; } @Override public int addAdmin(Admin admin) { Boolean isexist= existAccount(admin.getAccount()); if(isexist){ return 1; }else{ adminDao.addAdmin(admin); return 2; } } @Override public boolean updataAdmin(Admin admin) { return adminDao.updataAdmin(admin)>0; } @Override public boolean existAccount(String account) { return adminDao.isExistAccount(account)>0; } @Override public Admin getAdminByAccount(String account) { return adminDao.selectByAccount(account); } @Override public int deleteByID(int id){ return adminDao.deleteByID(id); } @Override public Admin getAdminByID(int ID) { return adminDao.selectByID(ID); } @Override public ArrayList<Admin> allAdmin() { return adminDao.allAdmin(); } @Override public ArrayList<Admin> search(String keyword) { // TODO Auto-generated method stub return adminDao.search(keyword); } }
package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.FavoriteMapper; import model.Favorite; import service.FavoriteService; @Service public class FavoriteServiceImpl implements FavoriteService { @Autowired FavoriteMapper favoriteDao; @Override public int addFavorite(Favorite favorite) { return favoriteDao.addFavorite(favorite); } @Override public ArrayList<Favorite> selectByUserID(int id) { return favoriteDao.selectByUserID(id); } @Override public int deleteByID(int id) { return favoriteDao.deleteByID(id); } @Override public Favorite selectByID(int id) { return favoriteDao.selectByID(id); } @Override public boolean existFavorite(Favorite favorite) { return favoriteDao.existFavorite(favorite)>0; } @Override public int deleteBy2ID(Favorite favorite) { return favoriteDao.deleteBy2ID(favorite); } @Override public int favoriteNumber(int id) { return favoriteDao.favoriteNumber(id); } @Override public int pagefavoriteNumber(int id) { return favoriteDao.pagefavoriteNumber(id); } @Override public int deleteByUserID(int id) { return favoriteDao.deleteByUserID(id); } }
package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.PageMapper; import model.Page; import service.PageServce; @Service public class PageServiceImpl implements PageServce { @Autowired PageMapper pageDao; @Override public int addPage(Page page) { Boolean isexist= existTitle(page.getTitle()); if(isexist){ return 1; }else{ pageDao.addPage(page); return 0; } } @Override public Page selectByID(int id) { return pageDao.selectByID(id); } @Override public Page selectByTitle(String title) { return pageDao.selectByTitle(title); } @Override public Boolean existTitle(String title) { return pageDao.existTitle(title)>0; } @Override public int deleteByID(int id) { return pageDao.deleteByID(id); } @Override public ArrayList<Page> allPage() { return pageDao.allPage(); } @Override public ArrayList<Page> search(String keyword) { return pageDao.search(keyword); } @Override public void updatePageView(Page page) { pageDao.updatePageView(page); } @Override public void updatePageStar(Page page) { pageDao.updatePageStar(page); } }
/** * */ package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.PushMapper; import model.Page; import model.Push; import service.PushService; /** * @author znz * */ @Service public class PushServiceImpl implements PushService { @Autowired PushMapper pushDao; /* (non-Javadoc) * @see service.PushService#addPush(model.Push) */ @Override public int addPush(Push push) { // TODO Auto-generated method stub return pushDao.addPush(push); } /* (non-Javadoc) * @see service.PushService#search(java.lang.String) */ @Override public ArrayList<Push> search(String keyword) { // TODO Auto-generated method stub return pushDao.search(keyword); } /* (non-Javadoc) * @see service.PushService#selectByID(int) */ @Override public Push selectByID(int ID) { // TODO Auto-generated method stub return pushDao.selectByID(ID); } /* (non-Javadoc) * @see service.PushService#selectByType(java.lang.String) */ @Override public ArrayList<Page> selectByType(String type) { ArrayList<Push> pushs = pushDao.selectByType(type); ArrayList<Page> pages = new ArrayList<Page>(); for (Push push : pushs) { pages.add(push.getPage()); } return pages; } /* (non-Javadoc) * @see service.PushService#deleteByID(int) */ @Override public int deleteByID(int ID) { // TODO Auto-generated method stub return pushDao.deleteByID(ID); } @Override public ArrayList<Push> allPush() { // TODO Auto-generated method stub return pushDao.allPush(); } @Override public boolean existPID(int PID) { // TODO Auto-generated method stub return pushDao.existPID(PID)>0; } @Override public int updateTypeByID(Push push) { // TODO Auto-generated method stub return pushDao.updateTypeByID(push); } }
package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.ReviewsMapper; import model.Reviews; import service.ReviewsService; @Service public class ReviewsServiceImpl implements ReviewsService { @Autowired ReviewsMapper reviewsDao; @Override public int addReviews(Reviews reviews) { return reviewsDao.addReviews(reviews); } @Override public ArrayList<Reviews> selectByPage(int id) { return reviewsDao.selectByPage(id); } @Override public int deleteByID(int id) { return reviewsDao.deleteByID(id); } @Override public Reviews selectByID(int ID) { return reviewsDao.selectByID(ID); } @Override public ArrayList<Reviews> selectByUserID(int UID) { return reviewsDao.selectByUserID(UID); } @Override public int reviewsNumber(int UID) { return reviewsDao.reviewsNumber(UID); } @Override public int deleteByUserID(int ID) { return reviewsDao.deleteByUserID(ID); } }
package service.impl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import dao.UserMapper; import model.User; import service.UserService; @Service public class UserServiceImpl implements UserService { @Autowired public UserMapper userDao; @Override public int addUser(User user) { Boolean isexist= existAccount(user.getAccount()); if(isexist){ return 1; }else{ userDao.addUser(user); return 2; } } @Override public int login(String account, String password) { // 判断username是否存在 boolean existAccount = existAccount(account); // 若username存在,验证密码 if (existAccount) { User resUser = userDao.selectByAccount(account); if(resUser.getStatus()!=0){ return 3; } if (resUser.getPassword().equals(password)) { return 2; } return 1; } return 0; } @Override public boolean existAccount(String account) { return userDao.existAccount(account) > 0; } @Override public User getUserById(Integer id) { return userDao.selectByID(id); } @Override public int getUserCount() { return userDao.getUserCount(); } @Override public boolean updateUserByID(User user) { return userDao.updateByID(user); } @Override public int deleteByID(int ID) { return userDao.deleteByID(ID); } @Override public User getUserByAccount(String account) { return userDao.selectByAccount(account); } @Override public ArrayList<User> allUser() { return userDao.allUser(); } @Override public ArrayList<User> search(String keyword) { return userDao.search(keyword); } }