修改新增工作空间接口

This commit is contained in:
shiziyuan9527 2020-05-22 14:16:15 +08:00
parent 4896115c1c
commit b169fb86da
3 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1,6 @@
package io.metersphere.commons.constants;
public class UserStatus {
public static final String NORMAL = "1";
public static final String DISABLED = "0";
}

View File

@ -45,8 +45,8 @@ public class WorkspaceController {
@PostMapping("special/add") @PostMapping("special/add")
@RequiresRoles(RoleConstants.ADMIN) @RequiresRoles(RoleConstants.ADMIN)
public void addWorkspaceByAdmin(@RequestBody Workspace workspace) { public Workspace addWorkspaceByAdmin(@RequestBody Workspace workspace) {
workspaceService.addWorkspaceByAdmin(workspace); return workspaceService.addWorkspaceByAdmin(workspace);
} }
@PostMapping("update") @PostMapping("update")

View File

@ -243,12 +243,13 @@ public class WorkspaceService {
workspaceMapper.updateByPrimaryKeySelective(workspace); workspaceMapper.updateByPrimaryKeySelective(workspace);
} }
public void addWorkspaceByAdmin(Workspace workspace) { public Workspace addWorkspaceByAdmin(Workspace workspace) {
checkWorkspace(workspace); checkWorkspace(workspace);
workspace.setId(UUID.randomUUID().toString()); workspace.setId(UUID.randomUUID().toString());
workspace.setCreateTime(System.currentTimeMillis()); workspace.setCreateTime(System.currentTimeMillis());
workspace.setUpdateTime(System.currentTimeMillis()); workspace.setUpdateTime(System.currentTimeMillis());
workspaceMapper.insertSelective(workspace); workspaceMapper.insertSelective(workspace);
return workspace;
} }
private void checkWorkspace(Workspace workspace) { private void checkWorkspace(Workspace workspace) {