修改新增工作空间接口

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")
@RequiresRoles(RoleConstants.ADMIN)
public void addWorkspaceByAdmin(@RequestBody Workspace workspace) {
workspaceService.addWorkspaceByAdmin(workspace);
public Workspace addWorkspaceByAdmin(@RequestBody Workspace workspace) {
return workspaceService.addWorkspaceByAdmin(workspace);
}
@PostMapping("update")

View File

@ -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) {