【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);
    }
}

联系方式绿泡泡公主号👇

相关推荐
FungLeo7 分钟前
FengCMS · PHP+MySQL 升级实录 · 内容写入一致性:锁等待超时与跨模型子树删除竞态
开发语言·mysql·php·工程实践·fengcms
jaysee-sjc1 小时前
【黑马点评】Day02:优惠券秒杀与分布式锁
java·分布式·nginx·spring·node.js·tomcat·maven
谙弆悕博士2 小时前
多智能体架构详解:市场拍卖式架构(Market-based / 竞价协商)
开发语言·架构·去中心化·多智能体·智能体·拍卖架构
ShineWinsu2 小时前
对于Qt:QMessageBox的解析
开发语言·c++·qt·面试·客户端·qmessagebox·消息对话框
承渊政道2 小时前
【Python编程快速上手—让繁琐工作自动化】(列表:把数据排成队,从下标取值到深拷贝)
开发语言·python·pycharm·自动化·列表
秋天的怀念_David2 小时前
算法一千零一夜 · 第三十五夜 · 恢复风暴
java·程序人生·算法
考虑考虑2 小时前
JDK27中的加密对象的 PEM 编码
java·后端·java ee
行者-全栈开发3 小时前
SpringBoot + GraalVM 原生编译实战:启动时间从8秒到0.5秒的极致优化
java·spring boot·后端
tryCbest3 小时前
Python 爬虫从入门到实战(一):基础篇——从零写出第一个爬虫
开发语言·爬虫·python
CoderYanger3 小时前
Java EE 进阶:10. MyBatis-Plus使用(第一弹)
java·spring boot·后端·sql·spring·java-ee·mybatis