Skip to content

Commit

Permalink
Feat gitlab 0227 (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
caochengxiang authored Mar 5, 2024
2 parents 078c6a1 + 7c14635 commit 15a73f5
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<GitTreeItem> treeItemList = gitlab.getProjectStructureTree("master", "git.xxx.com", "", "83504");
System.out.println(new Gson().toJson(treeItemList));
}

}

0 comments on commit 15a73f5

Please sign in to comment.