|
@@ -0,0 +1,62 @@
|
|
|
+package com.ym.mec.web.controller;
|
|
|
+
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.web.dal.entity.MusicGroup;
|
|
|
+import com.ym.mec.web.dal.entity.School;
|
|
|
+import com.ym.mec.web.dal.page.MusicGroupQueryInfo;
|
|
|
+import com.ym.mec.web.dal.page.SchoolQueryInfo;
|
|
|
+import com.ym.mec.web.service.MusicGroupService;
|
|
|
+import com.ym.mec.web.service.SchoolService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+@RequestMapping("school")
|
|
|
+@Api(tags = "学校(教学点)服务")
|
|
|
+@RestController
|
|
|
+public class SchoolController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SchoolService schoolService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "新增学校")
|
|
|
+ @PostMapping("/add")
|
|
|
+ public Object add(School school){
|
|
|
+ Date date = new Date();
|
|
|
+ school.setCreateTime(date);
|
|
|
+ school.setUpdateTime(date);
|
|
|
+ schoolService.insert(school);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除学校")
|
|
|
+ @DeleteMapping("/del/{id}")
|
|
|
+ public Object del(@ApiParam(value = "学校编号", required = true) @PathVariable("id") Integer id){
|
|
|
+ schoolService.delete(id);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "修改学校")
|
|
|
+ @PutMapping("/update")
|
|
|
+ public Object update(School school){
|
|
|
+ school.setUpdateTime(new Date());
|
|
|
+ schoolService.update(school);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据学校编号查询学校")
|
|
|
+ @DeleteMapping("/get/{id}")
|
|
|
+ public Object update(@ApiParam(value = "学校编号", required = true) @PathVariable("id") Integer id){
|
|
|
+ return succeed(schoolService.get(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分页查询学校列表")
|
|
|
+ @PostMapping("/queryPage")
|
|
|
+ public Object queryPage(SchoolQueryInfo queryInfo){
|
|
|
+ return succeed(schoolService.queryPage(queryInfo));
|
|
|
+ }
|
|
|
+}
|