From 4c4305eb11e6a450dfaf9e2be261eebdb6288f48 Mon Sep 17 00:00:00 2001 From: yutao <2678060651@qq.com> Date: Sun, 27 Nov 2022 20:52:50 +0800 Subject: [PATCH] dm --- src/ZhuController.java | 27 ++++++++++++++ src/ZhuDAO.java | 12 ++++++ src/ZhuService.java | 23 ++++++++++++ src/Zhuce.java | 52 ++++++++++++++++++++++++++ src/zhu/ZhuceIndex.vue | 83 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 197 insertions(+) create mode 100644 src/ZhuController.java create mode 100644 src/ZhuDAO.java create mode 100644 src/ZhuService.java create mode 100644 src/Zhuce.java create mode 100644 src/zhu/ZhuceIndex.vue diff --git a/src/ZhuController.java b/src/ZhuController.java new file mode 100644 index 0000000..279da7f --- /dev/null +++ b/src/ZhuController.java @@ -0,0 +1,27 @@ +package com.example.hosdata.controller; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.InService; +import com.example.hosdata.service.RegisterService; + +import com.example.hosdata.service.ZhuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class ZhuController { + @Autowired + ZhuService zhuService; + + @CrossOrigin + @PostMapping("/api/zhu") + public Zhuce add(@RequestBody Zhuce zhuce) throws Exception { + zhuService.add(zhuce); + return zhuce; + } +} diff --git a/src/ZhuDAO.java b/src/ZhuDAO.java new file mode 100644 index 0000000..140051d --- /dev/null +++ b/src/ZhuDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface ZhuDAO extends JpaRepository{ +} diff --git a/src/ZhuService.java b/src/ZhuService.java new file mode 100644 index 0000000..668682f --- /dev/null +++ b/src/ZhuService.java @@ -0,0 +1,23 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.InDAO; +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.dao.ZhuDAO; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ZhuService { + @Autowired + ZhuDAO zhuDAO; + + public void add(Zhuce zhuce) { + zhuDAO.save(zhuce); + } +} diff --git a/src/Zhuce.java b/src/Zhuce.java new file mode 100644 index 0000000..9ad6b5a --- /dev/null +++ b/src/Zhuce.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Zhuce { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/zhu/ZhuceIndex.vue b/src/zhu/ZhuceIndex.vue new file mode 100644 index 0000000..615f01a --- /dev/null +++ b/src/zhu/ZhuceIndex.vue @@ -0,0 +1,83 @@ + + + + +