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

联系方式绿泡泡公主号👇

相关推荐
VX:Fegn08951 小时前
计算机毕业设计|基于springboot + vue智慧医药系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·课程设计
两个蝴蝶飞5 小时前
Java量化系列(四):实现自选股票维护功能
java·经验分享
半桶水专家7 小时前
go语言中的结构体嵌入详解
开发语言·后端·golang
短剑重铸之日7 小时前
7天读懂MySQL|Day 5:执行引擎与SQL优化
java·数据库·sql·mysql·架构
酒九鸠玖7 小时前
Java--多线程
java
Dreamboat-L7 小时前
云服务器上部署nginx
java·服务器·nginx
长安er8 小时前
LeetCode215/347/295 堆相关理论与题目
java·数据结构·算法·leetcode·
在屏幕前出油8 小时前
二、Python面向对象编程基础——理解self
开发语言·python
阿方索8 小时前
python文件与数据格式化
开发语言·python
cici158749 小时前
C#实现三菱PLC通信
java·网络·c#