Java图书管理_增删改查_分层实现功能

这是一个Java实现的图书管理系统,包括登录、注册、增删改查功能。系统分为controller、service、dao、bean四层架构,管理员可进行书籍管理,用户可查看和借阅书籍。登录验证后,管理员可进行书籍的添加、删除、修改和用户权限调整,用户则能查看书籍、借阅及查看已借书籍。
摘要由CSDN通过智能技术生成
条件

主菜单:【1】登录【2】注册【3】退出
登录成功后提示恭喜***登录本系统;登录不成功要提示是密码错误还是账号错误。

管理员登录:【1】添加书【2】删除书【3】修改书【4】查看书【5】修改用户权限【6】返回上一层

用户登录:【1】查看书【2】借书【3】查看已借书【4】返回上一层

项目需要分层 controller service dao

代码
bean层
//图书类
public class Book {
   
    private int bookId;
    private String bookName;
    private String bookAuthor;
    private String bookStatus;//状态

    public Book() {
    }

    public Book(int bookId, String bookName, String bookAuthor, String bookStatus) {
   
        this.bookId = bookId;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
        this.bookStatus = bookStatus;
    }

    public int getBookId() {
   
        return bookId;
    }

    public void setBookId(int bookId) {
   
        this.bookId = bookId;
    }

    public String getBookName() {
   
        return bookName;
    }

    public void setBookName(String bookName) {
   
        this.bookName = bookName;
    }

    public String getBookAuthor() {
   
        return bookAuthor;
    }

    public void setBookAuthor(String bookAuthor) {
   
        this.bookAuthor = bookAuthor;
    }

    public String getBookStatus() {
   
        return bookStatus;
    }

    public void setBookStatus(String bookStatus) {
   
        this.bookStatus = bookStatus;
    }

    @Override
    public String toString() {
   
        return "Book{" +
                "bookId=" + bookId +
                ", bookName='" + bookName + '\'' +
                ", bookAuthor='" + bookAuthor + '\'' +
                ", bookStatus=" + bookStatus +
                '}';
    }
}
//用户类
public class User {
   
    private int userId;
    private String userName;
    private String userLoginName;
    private String userPwd;
    private String role;

    public User() {
   }
    public User(int userId, String userName, String userLoginName, String userPwd, String role) {
   
        this.userId = userId;
        this.userName = userName;
        this.userLoginName = userLoginName;
        this.userPwd = userPwd;
        this.role = role;
    }

    public int getUserId() {
   
        return userId;
    }

    public void setUserId(int userId) {
   
        this.userId = userId;
    }

    public String getUserName() {
   
        return userName;
    }

    public void setUserName(String userName) {
   
        this.userName = userName;
    }

    public String getUserLoginName() {
   
        return userLoginName;
    }

    public void setUserLoginName(String userLoginName) {
   
        this.userLoginName = userLoginName;
    }

    public String getUserPwd() {
   
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
   
        this.userPwd = userPwd;
    }

    public String getRole() {
   
        return role;
    }

    public void setRole(String role) {
   
        this.role = role;
    }

    @Override
    public String toString() {
   
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userLoginName='" + userLoginName + '\'' +
                ", userPwd='" + userPwd + '\'' +
                ", role='" + role + '\'' +
                '}';
    }
}
//借书类
public class Jbook {
   
    private int id;
    private String jusername;
    private String jbookname;
    private String jdata;
    private String hdata;

    public Jbook() {
    }
    public Jbook(int id, String jusername, String jbookname, String jdata, String hdata) {
   
        this.id = id;
        this.jusername = jusername;
        this.jbookname = jbookname;
        this.jdata = jdata;
        this.hdata = hdata;
    }

    public int getId() {
   
        return id;
    }

    public void setId(int id) {
   
        this.id = id;
    }

    public String getJusername() {
   
        return jusername;
    }

    public void setJusername(String jusername) {
   
        this.jusername = jusername;
    }

    public String getJbookname
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值