目录
结尾名片获取源码
开发语言:Java
框架:SpringBoot
持久化框架:Mybatis-plus
JDK版本:JDK1.8
服务器:tomcat7\8\9
数据库:mysql 5.7以上
数据库工具:Navicat11以上
开发软件:eclipse/myeclipse/idea
Maven:Maven3.5.4
浏览器:谷歌浏览器\Edge
功能描述
近些年,随着中国经济发展,人民的生活质量逐渐提高,对网络的依赖性越来越高,通过网络处理的事务越来越多。随着白优校园社团网站的常态化,如果依然采用传统的管理方式,将会为工作人员带来庞大的工作量,这将是一个巨大考验,需要投入大量人力开展对社团、社团活动、新闻资讯等相关工作进行管理,单一且反复的操作容易出错且不易被察觉,于是利用现代信息技术,设计开发一款白优校园社团网站,能够极大的节省人力物力、提高工作效率、降低工作成本[1]。
本论文拟采用计算机技术设计并开发的白优校园社团网站,主要是为学生提供服务。使得学生可以在系统上查看社团信息然后申请加入,社团进行审核等,管理员对信息进行统一管理,与此同时可以筛选出符合的信息,给笔者提供更符合实际的合理化建议,本课题的意义在于,管理者能通过使用白优校园社团网站,提高工作效率和服务质量,进而提高用户的体验感[2]。
相比于国内,国外的线上管理系统建设比较早,在上世纪就已经很先进,但受七十年代的经济危机影响,导致部分国家发展缓慢,但也有些发达国家走群众路线,全面发展网络技术[3]。
在国内,线下管理系统已经特别完善,它基于计算机技术,让系统具有信息化、科学化、自动化等特性。在计算机的辅助下,国内该类系统可使管理者提高信息的复用率,对数据的处理、备份等方面也有了显著的效率提升,这种有效的工作可使管理者能更快的做好决定,也实现了“无纸化”的信息管理方式。由于其功能特别完善,也导致系统比较庞大,所以在了解该类系统的功能、操作后,决定开发一款白优校园社团网站,它的功能小,但是操作简单、快速、准确的特点,也体现了设计它的意义[4]。
系统设计
设计原理,是指一个系统的设计由来,其将需求合理拆解成功能,抽象的描述系统的模块,以模块下的功能。功能模块化后,变成可组合、可拆解的单元,在设计时,会将所有信息分解存储在各个表中,界面不会显示所有定义的字段。在设计时,会有几大要求,抽象、模块化、信息隐藏、耦合低、内聚等特性,本系统的设计也符合以上几大特性。制作和显示流程都属于程序员需要分析研究的一部分。每个模块都是相对独立的,系统前台不显示账号操作权限范围外的信息。
该章节的功能模块设计,只是大概描述了系统的所有功能模块,将功能按权限来讲解。系统总体结构图如图4-1所示。
功能展示
当游客打开系统的网址后,首先看到的就是首页界面。在这里,游客能够看到白优校园社团网站的导航条显示首页、社团、社团活动、新闻资讯、后台管理。系统首页界面如图5-1所示:
在系统首页点击右侧的注册/登录按钮,然后页面跳转到注册登录界面,后来输入信息完成后,单击注册或者登录操作,如图5-2所示:
学生点击社团,在社团页面的搜索栏输入社团账号等信息,进行查询,还可以查看社团账号、图片、社团名称、社团分类、负责人、联系电话,还可以点击社团加入等操作;如图5-3所示:
学生点击社团活动,在社团活动页面的搜索栏输入活动名称等信息,进行查询,还可以查看活动名称、活动图片、活动地点、活动时间、活动时长、活动人数、社团账号、社团名称,还可以点击活动报名等操作;如图5-4所示:
在个人中心页面可以输入学号、密码、头像、学生姓名、性别、手机号码等信息,进行信息更新,如图5-5所示:
管理员登录,通过登录页面填写用户名和密码、角色等信息,点击登录操作,如图5-6所示。
管理员登录进入系统可以查看首页、个人中心、学生管理、社团分类分类、社团管理、社团加入管理、社团活动管理、活动报名管理、社团成员管理、社团申请管理、系统管理等功能,进行详细操作,如图5-7所示。
管理员点击学生管理;在学生管理页面输入学号、头像、学生姓名、性别、手机号码等信息,进行查询,新增或删除学生信息等操作;如图5-8所示。
管理员点击社团管理;在社团管理页面输入社团账号、图片、社团名称、社团分类、负责人、联系电话等信息,进行查询,新增或删除社团信息等操作;如图5-9所示。
管理员点击社团加入管理;在社团加入管理页面输入社团账号、社团名称、学号、学生姓名、性别、手机号码、申请时间、审核回复、审核状态等信息,进行查询或删除社团加入等操作;如图5-10所示。
管理员点击社团活动管理;在社团活动管理页面对活动名称、活动图片、活动地点、活动时间、活动时长、活动人数、社团账号、社团名称、审核回复、审核状态、审核等信息,进行查询或删除社团活动等操作;如图5-11所示。
管理员点击社团申请管理;在社团申请管理页面对学号、学生姓名、手机号码、社团名称、社团分类、申请时间、审核回复、审核状态、审核等信息,进行查询或删除社团申请等操作;如图5-12所示。
管理员点击系统管理;在系统管理页面对轮播图管理、新闻资讯等信息,进行查询或删除系统信息等操作;如图5-13所示。
社团登录,通过登录页面填写信息完成后,点击登录操作,如图5-14所示。
社团登录到白优校园社团网站可以查看首页、个人中心、社团管理、社团加入管理、社团活动管理、活动报名管理、社团成员管理等信息,进行相应操作,如图5-15所示。
学生登录,通过登录页面填写信息完成后,点击登录操作,如图5-16所示。
学生登录到白优校园社团网站可以查看首页、个人中心、社团加入管理、活动报名管理、社团成员管理、社团申请管理等信息,进行相应操作,如图5-17所示。
实现代码
Controller层
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
Dao层
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;
/**
* 用户
*/
public interface UserDao extends BaseMapper<UserEntity> {
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
}
Server层
package com.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.UserEntity;
import com.utils.PageUtils;
/**
* 系统用户
*/
public interface UserService extends IService<UserEntity> {
PageUtils queryPage(Map<String, Object> params);
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
}
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.UserDao;
import com.entity.UserEntity;
import com.service.UserService;
import com.utils.PageUtils;
import com.utils.Query;
/**
* 系统用户
*/
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<UserEntity> page = this.selectPage(
new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>()
);
return new PageUtils(page);
}
@Override
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<UserEntity> wrapper) {
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
}
权限验证
package com.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
/**
* 权限(Token)验证
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
* 不需要验证权限的方法直接放过
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close();
}
}
// throw new EIException("请先登录", 401);
return false;
}
}
为什么选择我?
选择我作为您的毕业设计系统开发伙伴,是基于以下几个关键理由:
专业经验:我拥有丰富的软件开发经验,特别是在教育技术和信息系统方面。我了解毕业设计流程的复杂性,能够针对性地提供解决方案,确保系统的实用性和高效性。
定制化服务:我明白每个教育机构都有其独特的需求和挑战。我将与您紧密合作,深入了解您的具体要求,从而开发出完全符合您需求的定制化系统。
技术专长:我对最新的编程语言和开发工具有深入的了解,能够运用先进的技术来构建安全、稳定且易于维护的系统。无论是前端用户体验还是后端数据处理,我都能够提供专业的技术支持。
项目管理能力:我具备良好的项目管理技能,能够确保项目按时按质完成。我会制定详细的项目计划,并与您保持密切沟通,确保项目的每个阶段都能满足预期目标。
持续支持与维护:系统开发完成后,我将提供持续的技术支持和维护服务。这包括定期的系统更新、故障排除以及根据用户反馈进行的功能改进。
成本效益:我提供的是高性价比的服务。通过高效的项目管理和合理的资源配置,我能够在保证质量的前提下,为您节省不必要的开支。
综上所述,我的专业技能、定制化服务、技术专长、项目管理能力以及对客户的长期承诺,都是您选择我作为毕业设计系统开发伙伴的有力理由。
项目推荐
👇题目未定的小伙伴可以看看下面找找灵感👇
Java 微信小程序(UNIAPP、云原生)合集
Java Android合集
Java SSM框架合集
Python Djaogo框架合集
获取源码
大家点赞、关注加收藏!👇下方名片获取源码啦!👇

778

被折叠的 条评论
为什么被折叠?



