diff --git a/后端的都放着里面/demo/pom.xml b/后端的都放着里面/demo/pom.xml index 6132cbf..6449a7f 100644 --- a/后端的都放着里面/demo/pom.xml +++ b/后端的都放着里面/demo/pom.xml @@ -28,7 +28,7 @@ org.springframework.boot spring-boot-starter-test - 1.3.2 + test org.mybatis.spring.boot @@ -39,6 +39,11 @@ org.springframework.boot spring-boot-starter-data-jpa + + org.projectlombok + lombok + 1.16.10 + net.sf.json-lib json-lib diff --git a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/book.java b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/book.java index bde93a3..2497913 100644 --- a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/book.java +++ b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/book.java @@ -1,54 +1,22 @@ package com.example.demo.bean; +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +@Getter +@Setter +@Entity public class book { @GeneratedValue(strategy=GenerationType.AUTO) - @ID private long book_id; - private string book_name; - private string author; - private string book_sort; + private String book_name; + private String author; + private String book_sort; private int book_num; - public long getBook_id() { - return book_id; - } - - public void setBook_id(long book_id) { - this.book_id = book_id; - } - - public string getBook_name() { - return book_name; - } - - public void setBook_name(string book_name) { - this.book_name = book_name; - } - - public string getAuthor() { - return author; - } - - public void setAuthor(string author) { - this.author = author; - } - - public string getBook_sort() { - return book_sort; - } - - public void setBook_sort(string book_sort) { - this.book_sort = book_sort; - } - - public int getBook_num() { - return book_num; - } - - public void setBook_num(int book_num) { - this.book_num = book_num; - } - public book(){}; } diff --git a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/borrowrecord.java b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/borrowrecord.java index b20095f..649b6b6 100644 --- a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/borrowrecord.java +++ b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/borrowrecord.java @@ -1,66 +1,22 @@ package com.example.demo.bean; -import org.springframework.boot.autoconfigure.domain.EntityScan; - -@EntityScan +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +@Getter +@Setter +@Entity public class borrowrecord { @GeneratedValue(strategy=GenerationType.AUTO) - @ID private long s_id; private long book_id; - private string s_name; - - public long getS_id() { - return s_id; - } - - public void setS_id(long s_id) { - this.s_id = s_id; - } - - public long getBook_id() { - return book_id; - } - - public void setBook_id(long book_id) { - this.book_id = book_id; - } - - public string getS_name() { - return s_name; - } - - public void setS_name(string s_name) { - this.s_name = s_name; - } - - public string getBook_name() { - return book_name; - } - - public void setBook_name(string book_name) { - this.book_name = book_name; - } - - public string getBorrowtime() { - return borrowtime; - } - - public void setBorrowtime(string borrowtime) { - this.borrowtime = borrowtime; - } - - public string getSenttime() { - return senttime; - } - - public void setSenttime(string senttime) { - this.senttime = senttime; - } - - private string book_name; - private string borrowtime; - private string senttime; + private String s_name; + private String book_name; + private String borrowtime; + private String senttime; public borrowrecord(){}; } diff --git a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/student.java b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/student.java index bb41d52..49bd669 100644 --- a/后端的都放着里面/demo/src/main/java/com/example/demo/bean/student.java +++ b/后端的都放着里面/demo/src/main/java/com/example/demo/bean/student.java @@ -1,38 +1,19 @@ package com.example.demo.bean; -import org.springframework.boot.autoconfigure.domain.EntityScan; -@EntityScan +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +@Getter +@Setter +@Entity public class student { @GeneratedValue(strategy=GenerationType.AUTO) - @ID private long s_id; private String s_name; private String s_password; - - public long getS_id() { - return s_id; - } - - public void setS_id(long s_id) { - this.s_id = s_id; - } - - public String getS_name() { - return s_name; - } - - public void setS_name(string s_name) { - this.s_name = s_name; - } - - public string getS_password() { - return s_password; - } - - public void setS_password(string s_password) { - this.s_password = s_password; - } - public student() {}; }