完成阶段5前端重构并固定后端JDK
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
AppConfig,
|
||||
AddMappingData,
|
||||
AddMappingRequest,
|
||||
ApplyConflictChoiceRequest,
|
||||
CheckinData,
|
||||
CheckinRequest,
|
||||
ChangesetFilesData,
|
||||
@@ -16,6 +17,8 @@ import type {
|
||||
ConnectData,
|
||||
DiffLocalLatestRequest,
|
||||
DiffRevisionsRequest,
|
||||
FileContentData,
|
||||
FileContentRequest,
|
||||
GetLatestData,
|
||||
GetLatestRequest,
|
||||
HistoryData,
|
||||
@@ -26,6 +29,8 @@ import type {
|
||||
PendingChangesRequest,
|
||||
ServerTreeData,
|
||||
TextDiffData,
|
||||
WorkspaceContextData,
|
||||
WorkspaceContextRequest,
|
||||
} from "./types"
|
||||
|
||||
/**
|
||||
@@ -52,6 +57,16 @@ export function listCollections() {
|
||||
return apiRequest<CollectionsData>("/api/collections")
|
||||
}
|
||||
|
||||
/**
|
||||
* 固定当前 Collection 并自动使用或创建本机默认 Workspace。
|
||||
*/
|
||||
export function ensureWorkspaceContext(request: WorkspaceContextRequest) {
|
||||
return apiRequest<WorkspaceContextData>("/api/workspace/context", {
|
||||
method: "POST",
|
||||
body: request,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载指定 Collection 和服务端路径下的目录节点。
|
||||
*/
|
||||
@@ -141,6 +156,16 @@ export function getLatest(request: GetLatestRequest) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取映射目录内本地文件或未映射文件的服务器 latest 内容。
|
||||
*/
|
||||
export function getFileContent(request: FileContentRequest) {
|
||||
return apiRequest<FileContentData>("/api/files/content", {
|
||||
method: "POST",
|
||||
body: request,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 对已映射且本地存在的文件或目录执行 checkout。
|
||||
*/
|
||||
@@ -181,6 +206,16 @@ export function undoFiles(request: FileOperationRequest) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用 Get Latest / Checkout 冲突弹窗中的单文件选择。
|
||||
*/
|
||||
export function applyConflictChoice(request: ApplyConflictChoiceRequest) {
|
||||
return apiRequest<FileOperationData>("/api/conflicts/apply", {
|
||||
method: "POST",
|
||||
body: request,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 Included Changes 对应的 serverPaths 提交到 TFS。
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,15 @@ export interface TfsMappingInfo {
|
||||
localPath: string
|
||||
}
|
||||
|
||||
export interface TfsWorkspaceInfo {
|
||||
name: string
|
||||
ownerName: string
|
||||
computer: string
|
||||
comment: string
|
||||
created: boolean
|
||||
mappings: TfsMappingInfo[]
|
||||
}
|
||||
|
||||
export interface AppConfig {
|
||||
serverUri?: string
|
||||
authType?: string
|
||||
@@ -49,6 +58,16 @@ export interface ConnectData {
|
||||
collectionCount?: number
|
||||
}
|
||||
|
||||
export interface WorkspaceContextRequest {
|
||||
collection: string
|
||||
}
|
||||
|
||||
export interface WorkspaceContextData {
|
||||
collection: string
|
||||
workspace?: TfsWorkspaceInfo
|
||||
mappings: TfsMappingInfo[]
|
||||
}
|
||||
|
||||
export interface TfsCollectionInfo {
|
||||
name: string
|
||||
id: string
|
||||
@@ -161,6 +180,8 @@ export interface TfsGetLatestResult {
|
||||
operations: number
|
||||
conflicts: number
|
||||
failures: number
|
||||
skipped?: string[]
|
||||
conflictDetails?: TfsConflictInfo[]
|
||||
}
|
||||
|
||||
export interface GetLatestData {
|
||||
@@ -176,6 +197,8 @@ export interface TfsFileOperationResult {
|
||||
operation: string
|
||||
affected: number
|
||||
failures: string[]
|
||||
skipped?: string[]
|
||||
conflictDetails?: TfsConflictInfo[]
|
||||
}
|
||||
|
||||
export interface FileOperationData {
|
||||
@@ -236,6 +259,43 @@ export interface TextDiffData {
|
||||
diff?: TfsTextDiff
|
||||
}
|
||||
|
||||
export interface TfsFileContent {
|
||||
serverPath: string
|
||||
localPath?: string
|
||||
changeset: number
|
||||
source: "local" | "server"
|
||||
size: number
|
||||
binary: boolean
|
||||
renderable: boolean
|
||||
encoding: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export interface FileContentRequest {
|
||||
serverPath: string
|
||||
localPath?: string
|
||||
preferLocal?: boolean
|
||||
}
|
||||
|
||||
export interface FileContentData {
|
||||
file?: TfsFileContent
|
||||
}
|
||||
|
||||
export interface TfsConflictInfo {
|
||||
serverPath: string
|
||||
localPath?: string
|
||||
fileSize: number
|
||||
binary: boolean
|
||||
renderable: boolean
|
||||
autoMergeable: boolean
|
||||
reason: string
|
||||
}
|
||||
|
||||
export interface ApplyConflictChoiceRequest {
|
||||
serverPath: string
|
||||
choice: "useServer" | "keepLocal" | "autoMerge"
|
||||
}
|
||||
|
||||
export interface TfsOperationLogEntry {
|
||||
operation: string
|
||||
summary: string
|
||||
|
||||
Reference in New Issue
Block a user