基于javaweb和mysql的springboot校园社团信息管理(java+springboot+mybaits+vue+elementui+mysql)
基于javaweb和mysql的springboot校园社团信息管理(java+springboot+mybaits+vue+elementui+mysql)后台地址:http://localhost:8080/springbootrpj39/admin/dist/index.html。前台地址:http://localhost:8080/springbootrpj39/front/index.h
基于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
使用说明
项目运行:
-
使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
-
使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
-
将项目中application.yml配置文件中的数据库配置改为自己的配置;
-
运行项目,在浏览器中输入地址:
前台地址:http://localhost:8080/springbootrpj39/front/index.html
后台地址:http://localhost:8080/springbootrpj39/admin/dist/index.html
管理员 abo 密码 abo
用户:用户1 密码: 123456
注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。
operaterLogService.add("删除角色ID["+id+"]");
return Result.success(true);
后台学生管理:
/**
* 后台学生管理
*/
@RequestMapping("/admin/student/")
@Controller
public class StudentController {
@Autowired
private StudentService studentService ;
@Autowired
private OperaterLogService operaterLogService;
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));
后台用户管理控制器:
/**
* 后台用户管理控制器
*/
@RequestMapping("/admin/user")
@Component
public class UserController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
log.info("编辑角色["+role+"]");
operaterLogService.add("编辑角色["+role.getName()+"]");
return Result.success(true);
@ResponseBody
@RequestMapping(value = "/delete",method = RequestMethod.POST)
public Result<Boolean> delete(@RequestParam(name = "id",required = true) Long id,HttpServletRequest request){
try {
roleService.delete(id);
}catch (Exception e){
return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
log.info("删除角色ID["+id+"]");
* 学生删除操作
* @param ids
* @return
*/
@ResponseBody
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public Result<Boolean> delete(@RequestParam(name = "ids", required = true) String ids) {
if (!StringUtils.isEmpty(ids)) {
String[] splitIds = ids.split(",");
for (String id : splitIds) {
*/
@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));
return "/admin/student/edit";
/**
* 编辑后台学生信息
* @param student
* @return
*/
if(userService.isExistUsername(user.getUsername(),user.getId().longValue())){
return Result.error(CodeMsg.ADMIN_USER_NAME_EXIST);
//将提交的用户信息指定字段复制到已存在的user对象中
User findbyId = userService.find(user.getId());
//把source原来的字段复制到目标对象当中ignoreProperties表示忽略哪些字段 该方法会覆盖新字段内容
BeanUtils.copyProperties(user,findbyId,"id","createTime","updateTime");
//到这说明一切通过 开始进行数据库编辑
if(userService.save(findbyId)==null){
return Result.error(CodeMsg.ADMIN_USER_EDIT_ERROR);
operaterLogService.add("编辑用户,用户名:"+user.getUsername());
return Result.success(true);
* 角色修改表单提交处理
* @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);
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)
@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);
/**
return "admin/role/list";
/**
* 角色添加页面
* @param model
* @return
*/
@RequestMapping(value = "/add",method = RequestMethod.GET)
public String add(Model model){
List<Menu> all = menuService.findAll();
model.addAttribute("title","添加角色");
model.addAttribute("topMenus", MenuUtil.getTopMenus(all));
@RequestMapping(value = "/add",method = RequestMethod.GET)
public String add(Model model){
List<Menu> all = menuService.findAll();
model.addAttribute("title","添加角色");
model.addAttribute("topMenus", MenuUtil.getTopMenus(all));
model.addAttribute("secondMenus", MenuUtil.getSecondMenus(all));
model.addAttribute("thirdMenus", MenuUtil.getThirdMenus(all));
return "admin/role/add";
/**
* 角色添加表单提交处理
* @param role
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){
//没有ID 传个0进去 0不是Long类型 所以加个0l L
if(userService.isExistUsername(user.getUsername(),0l)){
return Result.error(CodeMsg.ADMIN_USER_NAME_EXIST);
//到这说明一切符合条件进行数据库新增
if(userService.save(user)==null){
return Result.error(CodeMsg.ADMIN_USER_ADD_ERROR);
operaterLogService.add("添加用户,用户名:"+user.getUsername());
return Result.success(true);
/**
* 用户编辑页面
* @param model
* @param id
* @return
* @return
*/
@RequestMapping(value = "/add",method = RequestMethod.GET)
public String add(Model model){
List<Menu> all = menuService.findAll();
model.addAttribute("title","添加角色");
model.addAttribute("topMenus", MenuUtil.getTopMenus(all));
model.addAttribute("secondMenus", MenuUtil.getSecondMenus(all));
model.addAttribute("thirdMenus", MenuUtil.getThirdMenus(all));
return "admin/role/add";
@Controller
public class StudentController {
@Autowired
private StudentService studentService ;
@Autowired
private OperaterLogService operaterLogService;
/**
* 学生管理列表
* @param model
* @return
*/
@RequestMapping("/list")
model.addAttribute("pageBean",userService.findList(user,pageBean));
model.addAttribute("title","用户列表");
return "admin/user/list";
/**
* 用户添加页面
* @param model
* @param
* @return
*/
@RequestMapping(value = "/add",method = RequestMethod.GET)
public String add(Model model){
public String add(Model model){
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);
//判断用户的角色是否选择
更多推荐
所有评论(0)