|
|
@@ -0,0 +1,55 @@
|
|
|
+package com.zhongshu.card.server.core.controller.school;
|
|
|
+
|
|
|
+import com.github.microservice.auth.security.annotations.ResourceAuth;
|
|
|
+import com.github.microservice.auth.security.type.AuthType;
|
|
|
+import com.zhongshu.card.client.model.base.IDParam;
|
|
|
+import com.zhongshu.card.client.model.base.IDsParam;
|
|
|
+import com.zhongshu.card.client.model.base.OidModel;
|
|
|
+import com.zhongshu.card.client.model.school.AreaParam;
|
|
|
+import com.zhongshu.card.client.ret.ResultContent;
|
|
|
+import com.zhongshu.card.client.service.school.AreaService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/school/area")
|
|
|
+@Tag(name = "学校-区域管理")
|
|
|
+public class AreaController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ AreaService areaService;
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "添加-编辑区域-通用", description = "添加-编辑区域")
|
|
|
+ @RequestMapping(value = "addArea", method = {RequestMethod.POST})
|
|
|
+ public ResultContent addArea(@RequestBody AreaParam param) {
|
|
|
+ return this.areaService.addArea(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "得到机构区域树-通用", description = "得到机构区域树")
|
|
|
+ @RequestMapping(value = "getAreaTree", method = {RequestMethod.POST})
|
|
|
+ public ResultContent getAreaTree(@RequestBody OidModel param) {
|
|
|
+ return this.areaService.getAreaTree(param.getOid());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "删除区域-通用", description = "删除区域")
|
|
|
+ @RequestMapping(value = "deleteArea", method = {RequestMethod.POST})
|
|
|
+ public ResultContent deleteArea(@RequestBody IDParam param) {
|
|
|
+ return this.areaService.deleteArea(param.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "删除区域(多个)-通用", description = "删除区域(多个)")
|
|
|
+ @RequestMapping(value = "deleteAreas", method = {RequestMethod.POST})
|
|
|
+ public ResultContent deleteAreas(@RequestBody IDsParam param) {
|
|
|
+ return this.areaService.deleteAreas(param);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|