diff --git a/jcommon/gitlab/src/main/java/com/xiaomi/youpin/gitlab/bo/GitTreeItem.java b/jcommon/gitlab/src/main/java/com/xiaomi/youpin/gitlab/bo/GitTreeItem.java new file mode 100644 index 000000000..ff872105f --- /dev/null +++ b/jcommon/gitlab/src/main/java/com/xiaomi/youpin/gitlab/bo/GitTreeItem.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Xiaomi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.xiaomi.youpin.gitlab.bo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author shanwb + * @date 2024-02-27 + */ +@Data +public class GitTreeItem implements Serializable { + private static final long serialVersionUID = 1L; + + private String id; + + private String parentId; + + private String mode; + + private String name; + + private String path; + + private String type; +} diff --git a/jcommon/gitlab/src/test/java/com/xiaomi/youpin/gitlab/GitlabTest.java b/jcommon/gitlab/src/test/java/com/xiaomi/youpin/gitlab/GitlabTest.java index d24b74de6..4a1ae45d9 100644 --- a/jcommon/gitlab/src/test/java/com/xiaomi/youpin/gitlab/GitlabTest.java +++ b/jcommon/gitlab/src/test/java/com/xiaomi/youpin/gitlab/GitlabTest.java @@ -1,9 +1,11 @@ package com.xiaomi.youpin.gitlab; +import com.google.gson.Gson; import com.xiaomi.youpin.gitlab.bo.*; import org.junit.Test; import java.util.Arrays; +import java.util.List; /** * @Author wmin @@ -130,5 +132,16 @@ public void getProjectCode() { gitlab.getDomainByIP("https://xxx.com","xx","", Arrays.asList("127.0.0.1"),"token"); } + @Test + public void getFileContentTest() { + String content = gitlab.getFileContent("master", "git.xxx.com", "", "83504", "file path"); + System.out.println(content); + } + + @Test + public void getProjectStructureTreeTest() { + List treeItemList = gitlab.getProjectStructureTree("master", "git.xxx.com", "", "83504"); + System.out.println(new Gson().toJson(treeItemList)); + } }