条件
主菜单:【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