简介
初学做的第一个项目
使用DbUtils
使用MVC三层架构
采用MD5加密
采用随机验证码
链接
https://github.com/Yzh1Jun/BooksManagementSystem
数据库
使用pd画的物理模型生成的sql
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2022/8/30 18:53:51 */
/*==============================================================*/
drop table if exists book;
drop table if exists booktype;
drop table if exists borrow;
drop table if exists message;
drop table if exists user;
/*==============================================================*/
/* Table: book */
/*==============================================================*/
create table book
(
bookid int not null,
bookname varchar(255),
typeid int,
author varchar(255),
booknum int,
state int not null default 0,
primary key (bookid)
);
alter table book comment '图书信息';
/*==============================================================*/
/* Table: booktype */
/*==============================================================*/
create table booktype
(
typeid int not null,
typename varchar(255) not null,
primary key (typeid)
);
alter table booktype comment '图书类型信息';
/*==============================================================*/
/* Table: borrow */
/*==============================================================*/
create table borrow
(
borrowid int not null,
userid int,
bookid int,
number int,
starttime datetime,
endtime datetime,
state int not null default 0,
primary key (borrowid)
);
alter table borrow comment '用户借阅图书信息';
/*==============================================================*/
/* Table: message */
/*==============================================================*/
create table message
(
messageid int not null auto_increment,
id int not null,
message varchar(255),
primary key (messageid)
);
alter table message comment '消息信息';
/*==============================================================*/
/* Table: user */
/*==============================================================*/
create table user
(
id int not null,
username varchar(255) not null,
password varchar(255) not null,
gender varchar(255),
age int,
state int not null default 0,
role int not null default 0,
primary key (id)
);
alter table user comment '用户信息';
alter table book add constraint FK_book_booktype_r foreign key (typeid)
references booktype (typeid) on delete restrict on update restrict;
alter table borrow add constraint FK_book_borrow_r foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table borrow add constraint FK_user_borrow_r foreign key (userid)
references user (id) on delete restrict on update restrict;
alter table message add constraint FK_user_message_r foreign key (id)
references user (id) on delete restrict on update restrict;