diff --git a/backend/src/main/java/io/metersphere/commons/constants/UserStatus.java b/backend/src/main/java/io/metersphere/commons/constants/UserStatus.java new file mode 100644 index 0000000000..ee8baf418f --- /dev/null +++ b/backend/src/main/java/io/metersphere/commons/constants/UserStatus.java @@ -0,0 +1,6 @@ +package io.metersphere.commons.constants; + +public class UserStatus { + public static final String NORMAL = "1"; + public static final String DISABLED = "0"; +} diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index 64df81ab7c..2a0479848e 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -45,8 +45,8 @@ public class WorkspaceController { @PostMapping("special/add") @RequiresRoles(RoleConstants.ADMIN) - public void addWorkspaceByAdmin(@RequestBody Workspace workspace) { - workspaceService.addWorkspaceByAdmin(workspace); + public Workspace addWorkspaceByAdmin(@RequestBody Workspace workspace) { + return workspaceService.addWorkspaceByAdmin(workspace); } @PostMapping("update") diff --git a/backend/src/main/java/io/metersphere/service/WorkspaceService.java b/backend/src/main/java/io/metersphere/service/WorkspaceService.java index 9cd4c05719..f3e656fa0d 100644 --- a/backend/src/main/java/io/metersphere/service/WorkspaceService.java +++ b/backend/src/main/java/io/metersphere/service/WorkspaceService.java @@ -243,12 +243,13 @@ public class WorkspaceService { workspaceMapper.updateByPrimaryKeySelective(workspace); } - public void addWorkspaceByAdmin(Workspace workspace) { + public Workspace addWorkspaceByAdmin(Workspace workspace) { checkWorkspace(workspace); workspace.setId(UUID.randomUUID().toString()); workspace.setCreateTime(System.currentTimeMillis()); workspace.setUpdateTime(System.currentTimeMillis()); workspaceMapper.insertSelective(workspace); + return workspace; } private void checkWorkspace(Workspace workspace) {