|
|
@@ -2,11 +2,10 @@ package com.usoftchina.smartschool.school.basic.controller;
|
|
|
|
|
|
import com.usoftchina.smartschool.base.Result;
|
|
|
import com.usoftchina.smartschool.school.basic.service.ClassService;
|
|
|
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
|
|
|
import com.usoftchina.smartschool.school.po.ClassForm;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @author: guq
|
|
|
@@ -19,9 +18,22 @@ public class ClassController {
|
|
|
@Autowired
|
|
|
private ClassService classService;
|
|
|
|
|
|
- @RequestMapping("/read/{id}")
|
|
|
+ @GetMapping("/read/{id}")
|
|
|
public Result getClass(@PathVariable("id") Long id) {
|
|
|
ClassForm classForm = classService.getFormdata(id);
|
|
|
return Result.success(classForm);
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/save")
|
|
|
+ public Result getFormData(@RequestBody ClassForm form) {
|
|
|
+ DocBaseDTO formData = classService.saveFormData(form);
|
|
|
+ return Result.success(formData);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/delete/{id}")
|
|
|
+ public Result delete(@PathVariable("id") Long id) {
|
|
|
+ classService.delete(id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
}
|