修改新增工作空间接口
This commit is contained in:
parent
4896115c1c
commit
b169fb86da
|
@ -0,0 +1,6 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public class UserStatus {
|
||||
public static final String NORMAL = "1";
|
||||
public static final String DISABLED = "0";
|
||||
}
|
|
@ -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")
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue