diff --git a/Vue/Vue001/src/App.vue b/Vue/Vue001/src/App.vue
index b590534..37bd8a7 100644
--- a/Vue/Vue001/src/App.vue
+++ b/Vue/Vue001/src/App.vue
@@ -1,41 +1,302 @@
+
+
+
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 更新
+ 删除
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/Controllor/JsaonControllor.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/Controllor/JsaonControllor.java
index 8025fda..de2f32b 100644
--- a/springboot/src/main/java/com/zhangzihao/springboot/springboot/Controllor/JsaonControllor.java
+++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/Controllor/JsaonControllor.java
@@ -1,20 +1,68 @@
package com.zhangzihao.springboot.springboot.Controllor;
+import com.zhangzihao.springboot.springboot.model.Student;
import com.zhangzihao.springboot.springboot.model.User;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.xml.transform.Result;
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
@Controller
-public class JsaonControllor {
- //返回Json数据,App/小程序 前端分离
+public class JsonController {
+ // @RequestMapping("getUser")
+// //@RequestMapping("getUser") 表明这个方法处理 getUser 的请求
+// @ResponseBody
+// public User getUser(){
+// User user = new User();
+// user.setUsername("Lala");
+// user.setClassname("医信1班");
+// return user;
+// }
+ @Autowired
+ IStudentService studentService;
+ @RequestMapping("getstudents")
+ public Result getstudents(){
+ return Result.ok(studentService.list());
+ }
+
+ @RequestMapping("login1")
+ public Result login1(String username,String password){
+ if(username.equals("admin")&& password.equals("123456"))
+ return Result.ok("登录成功");
+ return Result.error("登录失败");
+ }
+
@RequestMapping("getuser")
- @ResponseBody
- public User getUser()
- {
+ public User getuser(){
User user = new User();
- user.setUsername("张三");
- user.setClassname("21医信");
+ user.setUsername("Lala");
+ user.setClassname("医信1班");
return user;
}
-}
+
+ @RequestMapping("uploadcommit1")
+ public Result uploadSuccess(MultipartFile file) throws IOException
+ {
+ File file1 = new File("D:\\data");
+ String fileName = UUID.randomUUID().toString()+file.getOriginalFilename();
+ file.transferTo(new File(file1,fileName));
+ return Result.ok().put("data","http://127.0.0.1:8080/"+fileName);
+ }
+ @RequestMapping("/deletestudentbyid/{id}")
+ public Result deleteStudentById(@PathVariable Integer id)
+ {
+ return Result.ok(studentService.removeById(id));
+ }
+ @RequestMapping("")
+ public Result saveDate(Student student)
+ {
+ return Result.ok(studentService.saveOrUpdate(student));
+ }
+}
\ No newline at end of file