修改新增工作空间接口
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")
|
@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")
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue