|
@@ -3,9 +3,11 @@ package com.ym.mec.web.controller;
|
|
|
import com.ym.mec.biz.dal.dto.TenantInfoDto;
|
|
|
import com.ym.mec.biz.service.TenantInfoService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.util.validator.ValidationKit;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
@@ -25,7 +27,7 @@ public class TenantInfoController extends BaseController {
|
|
|
|
|
|
@ApiOperation("添加机构信息")
|
|
|
@PostMapping(value = "/add")
|
|
|
-// @PreAuthorize("@pcs.hasPermissions('tenantInfo/add')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('tenantInfo/add')")
|
|
|
public Object addTenantInfo(@Valid @RequestBody TenantInfoDto dto) {
|
|
|
tenantInfoService.addTenantInfo(dto);
|
|
|
return succeed();
|
|
@@ -33,8 +35,9 @@ public class TenantInfoController extends BaseController {
|
|
|
|
|
|
@ApiOperation("修改机构信息")
|
|
|
@PostMapping(value = "/update")
|
|
|
-// @PreAuthorize("@pcs.hasPermissions('tenantInfo/update')")
|
|
|
- public Object updateTenantInfo(@Valid @RequestBody TenantInfoDto dto) {
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('tenantInfo/update')")
|
|
|
+ public Object updateTenantInfo(@Valid @RequestBody TenantInfoDto dto, BindingResult bindingResult) {
|
|
|
+ ValidationKit.ignoreFields(bindingResult,"productInfo","config");
|
|
|
tenantInfoService.updateTenantInfo(dto);
|
|
|
return succeed();
|
|
|
}
|
|
@@ -49,12 +52,10 @@ public class TenantInfoController extends BaseController {
|
|
|
|
|
|
@ApiOperation("查询单个机构详情")
|
|
|
@GetMapping(value = "/info/{id}")
|
|
|
-// @PreAuthorize("@pcs.hasPermissions('tenantInfo/info')")
|
|
|
public Object queryTenantInfo(@ApiParam(value = "机构ID", required = true) @PathVariable("id") Integer id) {
|
|
|
return succeed(tenantInfoService.queryTenantInfo(id));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
|
|
|
@ApiImplicitParam(name = "createdName", dataType = "String", value = "创建人"),
|
|
@@ -67,7 +68,7 @@ public class TenantInfoController extends BaseController {
|
|
|
})
|
|
|
@ApiOperation("分页查询")
|
|
|
@PostMapping(value = "/queryPage")
|
|
|
-// @PreAuthorize("@pcs.hasPermissions('tenantInfo/queryPage')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('tenantInfo/queryPage')")
|
|
|
public Object queryPage(@RequestBody Map<String, Object> param) {
|
|
|
return succeed(tenantInfoService.queryPage(param));
|
|
|
}
|