✨Feat: 获取文件修改
This commit is contained in:
@@ -6,7 +6,6 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
public class GiteaPushEvent {
|
||||
private String secret;
|
||||
private String ref;
|
||||
private String before;
|
||||
private String after;
|
||||
@@ -35,6 +34,9 @@ public class GiteaPushEvent {
|
||||
private User author;
|
||||
private User committer;
|
||||
private String timestamp;
|
||||
private List<String> added;
|
||||
private List<String> removed;
|
||||
private List<String> modified;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hezhaohui.webhook.entity.GiteaPushEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
public class HookService {
|
||||
@@ -14,6 +15,21 @@ public class HookService {
|
||||
List<String> commitMsgList = event.getCommits().stream()
|
||||
.map(GiteaPushEvent.Commit::getMessage)
|
||||
.toList();
|
||||
|
||||
List<String> addedFiles = event.getCommits().stream()
|
||||
.flatMap(commit -> commit.getAdded().stream())
|
||||
.toList();
|
||||
|
||||
List<String> removedFiles = event.getCommits().stream()
|
||||
.flatMap(commit -> commit.getRemoved().stream())
|
||||
.toList();
|
||||
|
||||
List<String> modifiedFiles = event.getCommits().stream()
|
||||
.flatMap(commit -> commit.getModified().stream())
|
||||
.toList();
|
||||
|
||||
// TODO: 调用 AI 模块
|
||||
|
||||
CardData cardData = CardData.builder()
|
||||
.title("[Gitea] 仓库状态变化")
|
||||
.repo(event.getRepository().getName())
|
||||
|
||||
Reference in New Issue
Block a user