diff --git a/SpringBootJPA/src/main/java/com/zz/controller/OrderController.java b/SpringBootJPA/src/main/java/com/zz/controller/OrderController.java index a8a1c35..feffbf6 100644 --- a/SpringBootJPA/src/main/java/com/zz/controller/OrderController.java +++ b/SpringBootJPA/src/main/java/com/zz/controller/OrderController.java @@ -3,6 +3,7 @@ package com.zz.controller; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -28,4 +29,9 @@ public class OrderController { return orderService.addmaster(master); } + @RequestMapping("show/{id}") + public OrderMaster getById(@PathVariable("id") String id){ + return orderService.getById(id); + } + } diff --git a/SpringBootJPA/src/main/java/com/zz/entity/OrderDetail.java b/SpringBootJPA/src/main/java/com/zz/entity/OrderDetail.java new file mode 100644 index 0000000..647f6e5 --- /dev/null +++ b/SpringBootJPA/src/main/java/com/zz/entity/OrderDetail.java @@ -0,0 +1,60 @@ +package com.zz.entity; + + + + + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.persistence.*; + +/** + * @Description: java类作用描述 + * @Author: Bsea + * @CreateDate: 2019/9/25$ 20:16$ + */ +@Entity + +public class OrderDetail { + @Id + @Column(length=50) + private String id; + private int num; + private String product_id; + @JsonIgnore + @ManyToOne + @JoinColumn(name="orderMaster_id") + private OrderMaster orderMaster; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getProduct_id() { + return product_id; + } + + public void setProduct_id(String product_id) { + this.product_id = product_id; + } + + public OrderMaster getOrderMaster() { + return orderMaster; + } + + public void setOrderMaster(OrderMaster orderMaster) { + this.orderMaster = orderMaster; + } +} diff --git a/SpringBootJPA/src/main/java/com/zz/entity/OrderMaster.java b/SpringBootJPA/src/main/java/com/zz/entity/OrderMaster.java index ed4501b..781f9f6 100644 --- a/SpringBootJPA/src/main/java/com/zz/entity/OrderMaster.java +++ b/SpringBootJPA/src/main/java/com/zz/entity/OrderMaster.java @@ -1,10 +1,13 @@ package com.zz.entity; import java.sql.Date; +import java.util.HashSet; +import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.OneToMany; @Entity public class OrderMaster { @@ -17,6 +20,17 @@ public class OrderMaster { private double total; private String address; private Date createTime; + @OneToMany(mappedBy = "orderMaster") + private Set orderDetailSet =new HashSet(); + + public Set getOrderDetailSet() { + return orderDetailSet; + } + + public void setOrderDetailSet(Set orderDetailSet) { + this.orderDetailSet = orderDetailSet; + } + public String getId() { return id; } diff --git a/SpringBootJPA/src/main/java/com/zz/entity/Product.java b/SpringBootJPA/src/main/java/com/zz/entity/Product.java index a5c9dc7..466bf47 100644 --- a/SpringBootJPA/src/main/java/com/zz/entity/Product.java +++ b/SpringBootJPA/src/main/java/com/zz/entity/Product.java @@ -1,11 +1,13 @@ package com.zz.entity; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Product { @Id + @Column(length=50) private String id; private String productName; private String productType; diff --git a/SpringBootJPA/src/main/java/com/zz/repository/OrderMasterRepository.java b/SpringBootJPA/src/main/java/com/zz/repository/OrderMasterRepository.java index 993341e..21acfc5 100644 --- a/SpringBootJPA/src/main/java/com/zz/repository/OrderMasterRepository.java +++ b/SpringBootJPA/src/main/java/com/zz/repository/OrderMasterRepository.java @@ -7,4 +7,6 @@ import com.zz.entity.OrderMaster; public interface OrderMasterRepository extends CrudRepository{ + + } diff --git a/SpringBootJPA/src/main/java/com/zz/service/OrderService.java b/SpringBootJPA/src/main/java/com/zz/service/OrderService.java index 987859f..a9514d6 100644 --- a/SpringBootJPA/src/main/java/com/zz/service/OrderService.java +++ b/SpringBootJPA/src/main/java/com/zz/service/OrderService.java @@ -17,4 +17,10 @@ public class OrderService { return masterRepository.save(master); } + + public OrderMaster getById(String id){ + + return masterRepository.findById(id).get(); + } + } diff --git a/SpringBootJPA/target/classes/com/zz/App.class b/SpringBootJPA/target/classes/com/zz/App.class index 73c67ce..67f9225 100644 Binary files a/SpringBootJPA/target/classes/com/zz/App.class and b/SpringBootJPA/target/classes/com/zz/App.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/CrudRepositoryDemoController.class b/SpringBootJPA/target/classes/com/zz/controller/CrudRepositoryDemoController.class index 29169ab..f4e6167 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/CrudRepositoryDemoController.class and b/SpringBootJPA/target/classes/com/zz/controller/CrudRepositoryDemoController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/HomeWorkController.class b/SpringBootJPA/target/classes/com/zz/controller/HomeWorkController.class index b4c64f5..dfe72c8 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/HomeWorkController.class and b/SpringBootJPA/target/classes/com/zz/controller/HomeWorkController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/OrderController.class b/SpringBootJPA/target/classes/com/zz/controller/OrderController.class index 44b5536..c7e9d15 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/OrderController.class and b/SpringBootJPA/target/classes/com/zz/controller/OrderController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/ProductController.class b/SpringBootJPA/target/classes/com/zz/controller/ProductController.class index a917d59..56030ce 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/ProductController.class and b/SpringBootJPA/target/classes/com/zz/controller/ProductController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/StudentController.class b/SpringBootJPA/target/classes/com/zz/controller/StudentController.class index a979bdb..08ff491 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/StudentController.class and b/SpringBootJPA/target/classes/com/zz/controller/StudentController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/controller/UserController.class b/SpringBootJPA/target/classes/com/zz/controller/UserController.class index 68d05f0..704a8eb 100644 Binary files a/SpringBootJPA/target/classes/com/zz/controller/UserController.class and b/SpringBootJPA/target/classes/com/zz/controller/UserController.class differ diff --git a/SpringBootJPA/target/classes/com/zz/dto/HomeWorkDTO.class b/SpringBootJPA/target/classes/com/zz/dto/HomeWorkDTO.class index bf83659..fec03a7 100644 Binary files a/SpringBootJPA/target/classes/com/zz/dto/HomeWorkDTO.class and b/SpringBootJPA/target/classes/com/zz/dto/HomeWorkDTO.class differ diff --git a/SpringBootJPA/target/classes/com/zz/entity/OrderMaster.class b/SpringBootJPA/target/classes/com/zz/entity/OrderMaster.class index c4994a1..8a0960a 100644 Binary files a/SpringBootJPA/target/classes/com/zz/entity/OrderMaster.class and b/SpringBootJPA/target/classes/com/zz/entity/OrderMaster.class differ diff --git a/SpringBootJPA/target/classes/com/zz/entity/Product.class b/SpringBootJPA/target/classes/com/zz/entity/Product.class index 958fc9c..b9f7fc2 100644 Binary files a/SpringBootJPA/target/classes/com/zz/entity/Product.class and b/SpringBootJPA/target/classes/com/zz/entity/Product.class differ diff --git a/SpringBootJPA/target/classes/com/zz/entity/Student.class b/SpringBootJPA/target/classes/com/zz/entity/Student.class index e74364e..3c9fc81 100644 Binary files a/SpringBootJPA/target/classes/com/zz/entity/Student.class and b/SpringBootJPA/target/classes/com/zz/entity/Student.class differ diff --git a/SpringBootJPA/target/classes/com/zz/entity/User.class b/SpringBootJPA/target/classes/com/zz/entity/User.class index 559b267..5e800cb 100644 Binary files a/SpringBootJPA/target/classes/com/zz/entity/User.class and b/SpringBootJPA/target/classes/com/zz/entity/User.class differ diff --git a/SpringBootJPA/target/classes/com/zz/repository/DTODao.class b/SpringBootJPA/target/classes/com/zz/repository/DTODao.class index cc5e5cb..51f8dc5 100644 Binary files a/SpringBootJPA/target/classes/com/zz/repository/DTODao.class and b/SpringBootJPA/target/classes/com/zz/repository/DTODao.class differ diff --git a/SpringBootJPA/target/classes/com/zz/repository/OrderMasterRepository.class b/SpringBootJPA/target/classes/com/zz/repository/OrderMasterRepository.class index e59a401..3a3e75c 100644 Binary files a/SpringBootJPA/target/classes/com/zz/repository/OrderMasterRepository.class and b/SpringBootJPA/target/classes/com/zz/repository/OrderMasterRepository.class differ diff --git a/SpringBootJPA/target/classes/com/zz/repository/ProductRepository.class b/SpringBootJPA/target/classes/com/zz/repository/ProductRepository.class index aa3ed60..25bd013 100644 Binary files a/SpringBootJPA/target/classes/com/zz/repository/ProductRepository.class and b/SpringBootJPA/target/classes/com/zz/repository/ProductRepository.class differ diff --git a/SpringBootJPA/target/classes/com/zz/repository/StudentRepository.class b/SpringBootJPA/target/classes/com/zz/repository/StudentRepository.class index 8e8c760..d550849 100644 Binary files a/SpringBootJPA/target/classes/com/zz/repository/StudentRepository.class and b/SpringBootJPA/target/classes/com/zz/repository/StudentRepository.class differ diff --git a/SpringBootJPA/target/classes/com/zz/repository/UserRepository.class b/SpringBootJPA/target/classes/com/zz/repository/UserRepository.class index b0d48c8..9ea463d 100644 Binary files a/SpringBootJPA/target/classes/com/zz/repository/UserRepository.class and b/SpringBootJPA/target/classes/com/zz/repository/UserRepository.class differ diff --git a/SpringBootJPA/target/classes/com/zz/service/HomeWorkService.class b/SpringBootJPA/target/classes/com/zz/service/HomeWorkService.class index 72ee90f..66686ef 100644 Binary files a/SpringBootJPA/target/classes/com/zz/service/HomeWorkService.class and b/SpringBootJPA/target/classes/com/zz/service/HomeWorkService.class differ diff --git a/SpringBootJPA/target/classes/com/zz/service/OrderService.class b/SpringBootJPA/target/classes/com/zz/service/OrderService.class index 0713c79..70ab885 100644 Binary files a/SpringBootJPA/target/classes/com/zz/service/OrderService.class and b/SpringBootJPA/target/classes/com/zz/service/OrderService.class differ diff --git a/SpringBootJPA/target/classes/com/zz/service/ProductService.class b/SpringBootJPA/target/classes/com/zz/service/ProductService.class index 637e1eb..ef4023f 100644 Binary files a/SpringBootJPA/target/classes/com/zz/service/ProductService.class and b/SpringBootJPA/target/classes/com/zz/service/ProductService.class differ diff --git a/SpringBootJPA/target/classes/com/zz/service/StudentService.class b/SpringBootJPA/target/classes/com/zz/service/StudentService.class index bf399a2..2805348 100644 Binary files a/SpringBootJPA/target/classes/com/zz/service/StudentService.class and b/SpringBootJPA/target/classes/com/zz/service/StudentService.class differ diff --git a/SpringBootJPA/target/classes/com/zz/service/UserService.class b/SpringBootJPA/target/classes/com/zz/service/UserService.class index 7a051f9..5d14afb 100644 Binary files a/SpringBootJPA/target/classes/com/zz/service/UserService.class and b/SpringBootJPA/target/classes/com/zz/service/UserService.class differ diff --git a/SpringBootJPA/target/classes/com/zz/util/DateUtil.class b/SpringBootJPA/target/classes/com/zz/util/DateUtil.class index ea2a9be..a611788 100644 Binary files a/SpringBootJPA/target/classes/com/zz/util/DateUtil.class and b/SpringBootJPA/target/classes/com/zz/util/DateUtil.class differ diff --git a/SpringBootJPA/target/classes/com/zz/util/KeyUtil.class b/SpringBootJPA/target/classes/com/zz/util/KeyUtil.class index 572dfce..29e9926 100644 Binary files a/SpringBootJPA/target/classes/com/zz/util/KeyUtil.class and b/SpringBootJPA/target/classes/com/zz/util/KeyUtil.class differ diff --git a/SpringBootShiroJWT/src/main/java/com/example/shirojwt/util/JwtUtil.java b/SpringBootShiroJWT/src/main/java/com/example/shirojwt/util/JwtUtil.java index 30ab7e0..525c3f9 100644 --- a/SpringBootShiroJWT/src/main/java/com/example/shirojwt/util/JwtUtil.java +++ b/SpringBootShiroJWT/src/main/java/com/example/shirojwt/util/JwtUtil.java @@ -20,7 +20,7 @@ public class JwtUtil { /** * JWT验证过期时间 EXPIRE_TIME 分钟 */ - private static final long EXPIRE_TIME = 30 * 60 * 1000; + private static final long EXPIRE_TIME = 1 * 25 * 1000; /** * 校验token是否正确 @@ -82,8 +82,10 @@ public class JwtUtil { public static void main(String[] args) { /** * 测试生成一个token - */ + String sign = sign("18888888888", "123456"); log.warn("测试生成一个token\n"+sign); + */ + log.warn(getUsername(null)); } } diff --git a/SpringBootShiroJWT/src/main/resources/static/index1.html b/SpringBootShiroJWT/src/main/resources/static/index1.html new file mode 100644 index 0000000..d07dfb1 --- /dev/null +++ b/SpringBootShiroJWT/src/main/resources/static/index1.html @@ -0,0 +1,54 @@ + + + + Bootstrap 实例 + + + + + + + + + +
+

基础表格

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FirstnameLastnameEmail
JohnDoejohn@example.com
MaryMoemary@example.com
JulyDooleyjuly@example.com
+
+ + + \ No newline at end of file diff --git a/SpringBootShiroJWT/src/main/resources/static/login1.html b/SpringBootShiroJWT/src/main/resources/static/login1.html new file mode 100644 index 0000000..51dd64e --- /dev/null +++ b/SpringBootShiroJWT/src/main/resources/static/login1.html @@ -0,0 +1,47 @@ + + + + Bootstrap 实例 + + + + + + + + + +
+

堆叠表单

+
+
+ + +
+
+ + +
+
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/SpringBootShiroJWT/src/main/resources/static/register.html b/SpringBootShiroJWT/src/main/resources/static/register.html new file mode 100644 index 0000000..ee87a50 --- /dev/null +++ b/SpringBootShiroJWT/src/main/resources/static/register.html @@ -0,0 +1,47 @@ + + + + Bootstrap 实例 + + + + + + + + + +
+

堆叠表单

+
+
+ + +
+
+ + +
+
+ +
+ +
+
+ + + \ No newline at end of file