Skip to content

Commit 8334300

Browse files
committed
#7 #8 New redirects
1 parent 4c804c7 commit 8334300

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

src/main/java/com/dkaedv/glghproxy/controller/RedirectsController.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ public class RedirectsController {
1010

1111
@Value("${gitlabUrl}")
1212
private String gitlabUrl;
13-
13+
14+
@RequestMapping("/{namespace}")
15+
public String namespace(
16+
@PathVariable String namespace
17+
) {
18+
19+
return "redirect:" + gitlabUrl + "/" + namespace;
20+
}
21+
1422
@RequestMapping("/{namespace}/{repo}")
1523
public String repoHomepage(
1624
@PathVariable String namespace,
@@ -29,5 +37,15 @@ public String commit(
2937

3038
return "redirect:" + gitlabUrl + "/" + namespace + "/" + repo + "/commit/" + sha;
3139
}
32-
40+
41+
@RequestMapping("/{namespace}/{repo}/tree/{branch}")
42+
public String repoTree(
43+
@PathVariable String namespace,
44+
@PathVariable String repo,
45+
@PathVariable String branch
46+
) {
47+
48+
return "redirect:" + gitlabUrl + "/" + namespace + "/" + repo + "/tree/" + branch;
49+
}
50+
3351
}

0 commit comments

Comments
 (0)