基于javaweb和mysql的springboot校园社团信息管理(java+springboot+mybaits+vue+elementui+mysql)

私信源码获取及调试交流

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行

前端:WebStorm/VSCode/HBuilderX等均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的SpringBoot校园社团信息管理(java+springboot+mybaits+vue+elementui+mysql)

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits

前端:Vue + elementui

使用说明

项目运行:

  1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;

  3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

  4. 运行项目,在浏览器中输入地址:

前台地址:http://localhost:8080/springbootrpj39/front/index.html

后台地址:http://localhost:8080/springbootrpj39/admin/dist/index.html

管理员 abo 密码 abo

用户:用户1 密码: 123456

注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。


if(existRole==null){

return  Result.error(CodeMsg.ADMIN_ROLE_NO_EXIST);

existRole.setName(role.getName());

existRole.setRemark(role.getRemark());

existRole.setStatus(role.getStatus());

existRole.setAuthorities(role.getAuthorities());

if(roleService.save(existRole)==null){

return  Result.error(CodeMsg.ADMIN_ROLE_EDIT_ERROR);

log.info("编辑角色["+role+"]");

operaterLogService.add("编辑角色["+role.getName()+"]");

return Result.success(true);


@Autowired

private RoleService roleService;

/**

* 分页搜索角色列表

* @param model

* @param role

* @param pageBean

* @return

*/

@RequestMapping(value = "/list")

public String list(Model model, Role role, PageBean<Role> pageBean){

model.addAttribute("title","角色列表");


return "admin/user/add";

@ResponseBody

@RequestMapping(value = "/add",method = RequestMethod.POST)

public Result<Boolean> add(Model model,User user){

//用统一验证实体方法验证是否合法

CodeMsg validate = ValidateEntityUtil.validate(user);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return Result.error(validate);

//判断用户的角色是否选择

if(user.getRole()==null ||user.getRole().getId()==null){

return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);

//没有ID 传个0进去 0不是Long类型 所以加个0l L


/**

* 学生管理列表

* @param model

* @return

*/

@RequestMapping("/list")

public String list(Model model, Student student, PageBean<Student> pageBean){

model.addAttribute("pageBean",studentService.findList(student, pageBean));

model.addAttribute("studentLoginName",student.getLoginName());

model.addAttribute("title","学生列表");

return "/admin/student/list";
* 后台学生添加信息操作

*/

@ResponseBody

@RequestMapping(value = "/add",method = RequestMethod.POST)

public Result<Boolean> add(Model model,Student student){

CodeMsg validate = ValidateEntityUtil.validate(student);

if (validate.getCode() != CodeMsg.SUCCESS.getCode()) {

return Result.error(validate);

if(studentService.findByLoginName(student.getLoginName())!=null){

return Result.error(CodeMsg.ADMIN_STUDENT_ISEXIST_ERROR);

if(studentService.save(student)==null){

return Result.error(CodeMsg.ADMIN_STUDENT_ADD_ERROR);

return Result.success(true);


private OperaterLogService operaterLogService;

/**

* 学生管理列表

* @param model

* @return

*/

@RequestMapping("/list")

public String list(Model model, Student student, PageBean<Student> pageBean){

model.addAttribute("pageBean",studentService.findList(student, pageBean));

model.addAttribute("studentLoginName",student.getLoginName());

model.addAttribute("title","学生列表");

return "/admin/student/list";

/**


return "admin/user/add";

@ResponseBody

@RequestMapping(value = "/add",method = RequestMethod.POST)

public Result<Boolean> add(Model model,User user){

//用统一验证实体方法验证是否合法

CodeMsg validate = ValidateEntityUtil.validate(user);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return Result.error(validate);

//判断用户的角色是否选择

if(user.getRole()==null ||user.getRole().getId()==null){

return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);


* @return

*/

@ResponseBody

@RequestMapping(value = "/edit",method = RequestMethod.POST)

public Result<Boolean> edit(Role role, HttpServletRequest request){

CodeMsg validate = ValidateEntityUtil.validate(role);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return  Result.error(validate);

Role existRole = roleService.find(role.getId());

if(existRole==null){

operaterLogService.add("添加用户,用户名:"+user.getUsername());

return Result.success(true);

/**

* 用户编辑页面

* @param model

* @param id

* @return

*/

@RequestMapping(value = "/edit",method = RequestMethod.GET)

public String edit(Model model,@RequestParam(name = "id",required = true) Long id){

model.addAttribute("user",userService.find(id));

model.addAttribute("roles",roleService.findAll());

return "admin/user/edit";
/**

* 后台用户管理控制器

*/

@RequestMapping("/admin/user")

@Component

public class UserController {

@Autowired

private UserService userService;

@Autowired

private RoleService roleService;

@Autowired

List<Role> all = roleService.findAll();

model.addAttribute("roles",all);

return "admin/user/add";

@ResponseBody

@RequestMapping(value = "/add",method = RequestMethod.POST)

public Result<Boolean> add(Model model,User user){

//用统一验证实体方法验证是否合法

CodeMsg validate = ValidateEntityUtil.validate(user);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return Result.error(validate);

//判断用户的角色是否选择
/**

* 角色修改表单提交处理

* @param role

* @param request

* @return

*/

@ResponseBody

@RequestMapping(value = "/edit",method = RequestMethod.POST)

public Result<Boolean> edit(Role role, HttpServletRequest request){

CodeMsg validate = ValidateEntityUtil.validate(role);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return  Result.error(validate);

Role existRole = roleService.find(role.getId());

if(existRole==null){

public Result<Boolean> add(Model model,Student student){

CodeMsg validate = ValidateEntityUtil.validate(student);

if (validate.getCode() != CodeMsg.SUCCESS.getCode()) {

return Result.error(validate);

if(studentService.findByLoginName(student.getLoginName())!=null){

return Result.error(CodeMsg.ADMIN_STUDENT_ISEXIST_ERROR);

if(studentService.save(student)==null){

return Result.error(CodeMsg.ADMIN_STUDENT_ADD_ERROR);

return Result.success(true);

/**


return  Result.error(CodeMsg.ADMIN_ROLE_ADD_ERROR);

log.info("添加角色["+role+"]");

operaterLogService.add("添加角色["+role.getName()+"]");

return Result.success(true);

/**

* 角色编辑页面

* @param id

* @param model

* @return

*/

@RequestMapping(value = "/edit",method = RequestMethod.GET)

public String edit(@RequestParam(name = "id",required = true) Long id, Model model){

List<Menu> all = menuService.findAll();


if(studentService.save(student)==null){

return Result.error(CodeMsg.ADMIN_STUDENT_ADD_ERROR);

return Result.success(true);

/**

* 编辑学生页面

* @param model

* @param id

* @return

*/

@RequestMapping(value = "/edit",method = RequestMethod.GET)

public String edit(Model model, @RequestParam("id")Long id){

if(studentService.findById(id)!=null){

model.addAttribute("student",studentService.findById(id));

try {

roleService.delete(id);

}catch (Exception e){

return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);

log.info("删除角色ID["+id+"]");

operaterLogService.add("删除角色ID["+id+"]");

return Result.success(true);

后台学生管理:

/**

* 后台学生管理

*/

@RequestMapping("/admin/student/")


*/

@ResponseBody

@RequestMapping(value = "/edit",method = RequestMethod.POST)

public Result<Boolean> edit(Role role, HttpServletRequest request){

CodeMsg validate = ValidateEntityUtil.validate(role);

if(validate.getCode()!=CodeMsg.SUCCESS.getCode()){

return  Result.error(validate);

Role existRole = roleService.find(role.getId());

if(existRole==null){

return  Result.error(CodeMsg.ADMIN_ROLE_NO_EXIST);

existRole.setName(role.getName());

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐