MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / GetSingleWorkspace

Function GetSingleWorkspace

cli/internal/dal/worksapce.go:422–447  ·  view source on GitHub ↗

获取工作空间的详情数据

(workspaceid int)

Source from the content-addressed store, hash-verified

420
421// 获取工作空间的详情数据
422func GetSingleWorkspace(workspaceid int) (workspaceInfo workspace.WorkspaceInfo, err error) {
423
424 db := getDb()
425 defer db.Close()
426
427 do := workspaceDo{}
428 row := db.QueryRow(`select w_id, w_name, w_workingdir, w_docker_compose_file_path, w_mode, w_config_file,
429 w_git_clone_repo_url, w_git_auth_type, w_branch, r_id, k_id,
430 w_json, w_config_content, w_link_compose_content, w_temp_compose_content,
431 w_created
432 from workspace
433 where w_id=? and w_is_del = 0`, workspaceid)
434 switch err := row.Scan(&do.w_id, &do.w_name, &do.w_workingdir, &do.w_docker_compose_file_path, &do.w_mode, &do.w_config_file,
435 &do.w_git_clone_repo_url, &do.w_git_auth_type, &do.w_branch, &do.r_id, &do.k_id,
436 &do.w_json, &do.w_config_content, &do.w_link_compose_content, &do.w_temp_compose_content,
437 &do.w_created); err {
438 case sql.ErrNoRows:
439 common.SmartIDELog.WarningF(i18nInstance.Common.Warn_dal_record_not_exit_condition, "workspaceid ("+strconv.Itoa(workspaceid)+")") // 没有查询到数据
440 case nil:
441 err = workspaceDataMap(&workspaceInfo, do)
442 default:
443 panic(err)
444 }
445
446 return workspaceInfo, err
447}
448
449// @title RemoveWorkspace
450// @description 删除工作区

Callers

nothing calls this directly

Calls 3

getDbFunction · 0.85
workspaceDataMapFunction · 0.85
WarningFMethod · 0.80

Tested by

no test coverage detected