重构项目结构,移除旧Java客户端,添加前后端目录
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
95
backend/src/main/java/com/svnmanager/model/SvnStatus.java
Normal file
95
backend/src/main/java/com/svnmanager/model/SvnStatus.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.svnmanager.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SVN状态模型
|
||||
*/
|
||||
public class SvnStatus {
|
||||
private String workingCopyPath;
|
||||
private String revision;
|
||||
private List<SvnFileStatus> files;
|
||||
private int modifiedCount;
|
||||
private int addedCount;
|
||||
private int deletedCount;
|
||||
private int conflictedCount;
|
||||
|
||||
public SvnStatus() {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String getWorkingCopyPath() {
|
||||
return workingCopyPath;
|
||||
}
|
||||
|
||||
public void setWorkingCopyPath(String workingCopyPath) {
|
||||
this.workingCopyPath = workingCopyPath;
|
||||
}
|
||||
|
||||
public String getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
public void setRevision(String revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public List<SvnFileStatus> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<SvnFileStatus> files) {
|
||||
this.files = files;
|
||||
updateCounts();
|
||||
}
|
||||
|
||||
public void addFile(SvnFileStatus file) {
|
||||
this.files.add(file);
|
||||
updateCounts();
|
||||
}
|
||||
|
||||
public int getModifiedCount() {
|
||||
return modifiedCount;
|
||||
}
|
||||
|
||||
public int getAddedCount() {
|
||||
return addedCount;
|
||||
}
|
||||
|
||||
public int getDeletedCount() {
|
||||
return deletedCount;
|
||||
}
|
||||
|
||||
public int getConflictedCount() {
|
||||
return conflictedCount;
|
||||
}
|
||||
|
||||
public int getTotalChangedFiles() {
|
||||
return modifiedCount + addedCount + deletedCount + conflictedCount;
|
||||
}
|
||||
|
||||
private void updateCounts() {
|
||||
modifiedCount = 0;
|
||||
addedCount = 0;
|
||||
deletedCount = 0;
|
||||
conflictedCount = 0;
|
||||
|
||||
for (SvnFileStatus file : files) {
|
||||
switch (file.getStatus()) {
|
||||
case MODIFIED:
|
||||
modifiedCount++;
|
||||
break;
|
||||
case ADDED:
|
||||
addedCount++;
|
||||
break;
|
||||
case DELETED:
|
||||
deletedCount++;
|
||||
break;
|
||||
case CONFLICTED:
|
||||
conflictedCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user