【JAVA项目】基于JAVA的宿舍管理系统

一、项目介绍

本系统前端框架采用了比较流行的渐进式JavaScript框架Vue.js。使用Vue-Router实现动态路由,Ajax实现前后端通信,Element-plus组件库使页面快速成型。后端部分:采用SpringBoot作为开发框架,同时集成MyBatis、Redis、阿里云oss对象存储等相关技术。

宿舍管理系统,可前后端分离

运行环境:idea

技术栈:springboot,vue,mybatis,redis,elementplus

jwt令牌技术,不登录无法访问内容页面,换浏览器也不可以

二、系统功能

  • 宿舍管理员管理可以对宿舍管理员进行查询增加删除和修改操作
  • 学生管理可以对学生进行查询增加删除和修改操作
  • 宿舍楼管理可以对宿舍楼进行查询增加删除和修改操作
  • 对个人信息的修改和退出登录

三、系统实现

登陆界面

四、实现代码

复制代码
package com.example.demo.Controller;

import com.example.demo.Service.CategoryService;

import com.example.demo.entity.Pojo.Category;
import com.example.demo.entity.Pojo.Flower;
import com.example.demo.entity.Result.PageBean;
import com.example.demo.entity.Result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    //获取列表
    @GetMapping
    public Result<List<Category>> getMessage(){
        List<Category> cs= categoryService.list();
        return Result.success(cs);
    }

    //新增
    @PostMapping
    public Result add(@RequestBody Category category){
        categoryService.add(category);
        return Result.success();
    }

    //获取详情
    @GetMapping("/detail")
    public Result<Category> detail(Integer id){
        Category c= categoryService.findById(id);
        return Result.success(c);
    }

    //更新商品分类
    @PutMapping
    public Result update(@RequestBody Category category){
        categoryService.update(category);
        return  Result.success();
    }

    // 删除
    @DeleteMapping
    public Result delete(Integer id){
        categoryService.delete(id);
        return Result.success();
    }

    //分页查询
    @GetMapping("/page")
    public Result<PageBean<Category>> page(Integer pageNum, Integer pageSize, String agriculturalName){
        PageBean<Category> pageBean= categoryService.page(pageNum, pageSize, agriculturalName);
        return Result.success(pageBean);
    }

    //根据分类查询
    @GetMapping("/flower")
    public Result<PageBean<Flower>> listByCategory(Integer pageNum, Integer pageSize, String categoryName){
        PageBean<Flower> pageBean= categoryService.getByCategoryId(pageNum, pageSize, categoryName);
        return Result.success(pageBean);
    }
}

联系方式绿泡泡公主号👇

相关推荐
云烟成雨TD几秒前
Spring AI 1.x 系列【54】Retry 机制分析
java·人工智能·spring
weixin_523185322 分钟前
Collections.unmodifiableMap详解:真的不可修改吗?
java·linux·前端
点燃大海4 分钟前
SpringAI构建智能体
java·spring boot·spring·springai智能体
xier_ran6 分钟前
【infra之路】02_RadixAttention与KV_Cache管理
java·spring boot·spring
黑马师兄19 分钟前
RAG混合检索深度解析:让AI真正找到你要的内容
java·人工智能·ai·agent·rag·ai-native
码客日记23 分钟前
Spring Boot 配置文件敏感信息加密(Jasypt 企业级完整方案)
java·spring boot·git
宋拾壹38 分钟前
同时添加多个类目
android·开发语言·javascript
点灯小铭1 小时前
基于单片机的数码管定时插座设计与定时开关功能实现
单片机·嵌入式硬件·毕业设计·课程设计·期末大作业
凡人叶枫1 小时前
Effective C++ 条款04:确定对象被使用前已先被初始化
java·linux·开发语言·c++·嵌入式开发
极客先躯1 小时前
高级java每日一道面试题-2026年02月01日-实战篇[Docker]-Docker Volume 的生命周期管理是怎样的?
java·运维·docker·容器·持久化·架构图·容器卷