mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-19 15:40:50 +08:00
specifized route mappings
This commit is contained in:
parent
fc3d83018d
commit
e170d5369a
@ -81,24 +81,24 @@ public class Apiv1Controller extends HangarController {
|
||||
this.v1ApiService = v1ApiService;
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/projects")
|
||||
@GetMapping("/v1/projects")
|
||||
public Object listProjects(@RequestParam Object categories, @RequestParam Object sort, @RequestParam Object q, @RequestParam Object limit, @RequestParam Object offset) {
|
||||
return null; // TODO implement listProjects request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/projects/{pluginId}")
|
||||
@GetMapping("/v1/projects/{pluginId}")
|
||||
public Object showProject(@PathVariable Object pluginId) {
|
||||
return null; // TODO implement showProject request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/v1/projects/{pluginId}/keys/new")
|
||||
@PostMapping("/v1/projects/{pluginId}/keys/new")
|
||||
public Object createKey(@PathVariable Object pluginId) {
|
||||
return null; // TODO implement createKey request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/v1/projects/{pluginId}/keys/revoke")
|
||||
@PostMapping("/v1/projects/{pluginId}/keys/revoke")
|
||||
public Object revokeKey(@PathVariable Object pluginId) {
|
||||
return null; // TODO implement revokeKey request controller
|
||||
}
|
||||
@ -126,12 +126,12 @@ public class Apiv1Controller extends HangarController {
|
||||
return ResponseEntity.ok(pagesArray);
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/projects/{pluginId}/versions")
|
||||
@GetMapping("/v1/projects/{pluginId}/versions")
|
||||
public Object listVersions(@PathVariable Object pluginId, @RequestParam Object channels, @RequestParam Object limit, @RequestParam Object offset) {
|
||||
return null; // TODO implement listVersions request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/projects/{pluginId}/versions/{name}")
|
||||
@GetMapping("/v1/projects/{pluginId}/versions/{name}")
|
||||
public Object showVersion(@PathVariable Object pluginId, @PathVariable Object name) {
|
||||
return null; // TODO implement showVersion request controller
|
||||
}
|
||||
@ -142,12 +142,12 @@ public class Apiv1Controller extends HangarController {
|
||||
return null; // TODO implement deployVersion request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/projects/{plugin}/tags/{versionName}")
|
||||
@GetMapping("/v1/projects/{plugin}/tags/{versionName}")
|
||||
public Object listTags(@PathVariable Object plugin, @PathVariable Object versionName) {
|
||||
return null; // TODO implement listTags request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/tags/{tagId}")
|
||||
@GetMapping("/v1/tags/{tagId}")
|
||||
public ResponseEntity<ObjectNode> tagColor(@PathVariable("tagId") TagColor tag) {
|
||||
ObjectNode tagColor = mapper.createObjectNode();
|
||||
tagColor.set("id", mapper.valueToTree(tag.ordinal()));
|
||||
@ -156,12 +156,12 @@ public class Apiv1Controller extends HangarController {
|
||||
return ResponseEntity.of(Optional.of(tagColor));
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/users")
|
||||
@GetMapping("/v1/users")
|
||||
public ResponseEntity<ArrayNode> listUsers(@RequestParam(defaultValue = "0") int offset, @RequestParam(required = false) Integer limit) {
|
||||
return ResponseEntity.of(Optional.of(writeUsers(v1ApiService.getUsers(offset, limit))));
|
||||
}
|
||||
|
||||
@RequestMapping("/v1/users/{user}")
|
||||
@GetMapping("/v1/users/{user}")
|
||||
@ResponseBody
|
||||
public ResponseEntity<ObjectNode> showUser(@PathVariable String user) {
|
||||
UserData userData = userService.getUserData(user);
|
||||
|
@ -11,6 +11,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@ -74,7 +75,7 @@ public class ApplicationController extends HangarController {
|
||||
this.statsService = statsService;
|
||||
}
|
||||
|
||||
@RequestMapping("/")
|
||||
@GetMapping("/")
|
||||
public ModelAndView showHome(ModelMap modelMap) {
|
||||
ModelAndView mav = new ModelAndView("home");
|
||||
AlertUtil.transferAlerts(mav, modelMap);
|
||||
@ -95,7 +96,7 @@ public class ApplicationController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.REVIEWER)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/approval/projects")
|
||||
@GetMapping("/admin/approval/projects")
|
||||
public Object showProjectVisibility() {
|
||||
ModelAndView mv = new ModelAndView("users/admin/visibility");
|
||||
mv.addObject("needsApproval", projectService.getProjectsNeedingApproval());
|
||||
@ -104,7 +105,7 @@ public class ApplicationController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/approval/versions")
|
||||
@GetMapping("/admin/approval/versions")
|
||||
public ModelAndView showQueue() {
|
||||
ModelAndView mv = new ModelAndView("users/admin/queue");
|
||||
List<ReviewQueueEntry> reviewQueueEntries = new ArrayList<>();
|
||||
@ -142,7 +143,7 @@ public class ApplicationController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.VIEW_HEALTH)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/health")
|
||||
@GetMapping("/admin/health")
|
||||
public ModelAndView showHealth() {
|
||||
ModelAndView mav = new ModelAndView("users/admin/health");
|
||||
List<UnhealthyProject> unhealthyProjects = projectService.getUnhealthyProjects();
|
||||
@ -155,7 +156,7 @@ public class ApplicationController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/log")
|
||||
@GetMapping("/admin/log")
|
||||
public ModelAndView showLog(@RequestParam(required = false) Integer oPage,
|
||||
@RequestParam(required = false) Object userFilter,
|
||||
@RequestParam(required = false) Object projectFilter,
|
||||
@ -184,7 +185,7 @@ public class ApplicationController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/stats")
|
||||
@GetMapping("/admin/stats")
|
||||
public ModelAndView showStats(@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate from, @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate to) {
|
||||
ModelAndView mav = new ModelAndView("users/admin/stats");
|
||||
if(from == null){
|
||||
@ -212,7 +213,7 @@ public class ApplicationController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.EDIT_ALL_USER_SETTINGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/user/{user}")
|
||||
@GetMapping("/admin/user/{user}")
|
||||
public ModelAndView userAdmin(@PathVariable String user) {
|
||||
ModelAndView mav = new ModelAndView("users/admin/userAdmin");
|
||||
UserData userData = userService.getUserData(user);
|
||||
@ -223,23 +224,23 @@ public class ApplicationController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/admin/user/{user}/update")
|
||||
@PostMapping("/admin/user/{user}/update")
|
||||
public Object updateUser(@PathVariable Object user) {
|
||||
return null; // TODO implement updateUser request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/api")
|
||||
@GetMapping("/api") // TODO move to Apiv1Controller maybe
|
||||
public ModelAndView swagger() {
|
||||
return fillModel(new ModelAndView("swagger"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/favicon.ico", produces = "images/x-icon")
|
||||
@GetMapping(value = "/favicon.ico", produces = "images/x-icon")
|
||||
@ResponseBody
|
||||
public ClassPathResource faviconRedirect() {
|
||||
return new ClassPathResource("public/images/favicon.ico");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/global-sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@GetMapping(value = "/global-sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@ResponseBody
|
||||
public String globalSitemap() {
|
||||
return sitemapService.getGlobalSitemap();
|
||||
@ -277,7 +278,7 @@ public class ApplicationController extends HangarController {
|
||||
"})(jsRoutes)"; // TODO implement javaScriptRoutes request controller
|
||||
}
|
||||
|
||||
@RequestMapping("/linkout")
|
||||
@GetMapping("/linkout")
|
||||
public ModelAndView linkOut(@RequestParam(defaultValue = "") String remoteUrl) {
|
||||
ModelAndView view = new ModelAndView("linkout");
|
||||
view.addObject("remoteUrl", remoteUrl);
|
||||
@ -285,24 +286,24 @@ public class ApplicationController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/pantopticon/actor-count")
|
||||
@GetMapping("/pantopticon/actor-count")
|
||||
public Object actorCount(@RequestParam Object timeoutMs) {
|
||||
return null; // TODO implement actorCount request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/pantopticon/actor-tree")
|
||||
@GetMapping("/pantopticon/actor-tree")
|
||||
public Object actorTree(@RequestParam Object timeoutMs) {
|
||||
return null; // TODO implement actorTree request controller
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/robots.txt", produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@GetMapping(value = "/robots.txt", produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
@ResponseBody
|
||||
public Object robots() {
|
||||
return new ClassPathResource("public/robots.txt");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@GetMapping(value = "/sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@ResponseBody
|
||||
public String sitemapIndex() {
|
||||
return sitemapService.getSitemap();
|
||||
|
@ -47,7 +47,7 @@ public class OrgController extends HangarController {
|
||||
this.routeHelper = routeHelper;
|
||||
}
|
||||
|
||||
@RequestMapping("/organizations/invite/{id}/{status}")
|
||||
@PostMapping("/organizations/invite/{id}/{status}")
|
||||
public Object setInviteStatus(@PathVariable Object id, @PathVariable Object status) {
|
||||
return null; // TODO implement setInviteStatus request controller
|
||||
}
|
||||
@ -93,19 +93,19 @@ public class OrgController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/organizations/{organization}/settings/avatar")
|
||||
@GetMapping("/organizations/{organization}/settings/avatar")
|
||||
public Object updateAvatar(@PathVariable Object organization) {
|
||||
return null; // TODO implement updateAvatar request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/organizations/{organization}/settings/members")
|
||||
@PostMapping("/organizations/{organization}/settings/members")
|
||||
public Object updateMembers(@PathVariable Object organization) {
|
||||
return null; // TODO implement updateMembers request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/organizations/{organization}/settings/members/remove")
|
||||
@PostMapping("/organizations/{organization}/settings/members/remove")
|
||||
public Object removeMember(@PathVariable Object organization) {
|
||||
return null; // TODO implement removeMember request controller
|
||||
}
|
||||
|
@ -177,13 +177,13 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/invite/{id}/{status}")
|
||||
@PostMapping("/invite/{id}/{status}")
|
||||
public Object setInviteStatus(@PathVariable Object id, @PathVariable Object status) {
|
||||
return null; // TODO implement setInviteStatus request controller
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/invite/{id}/{status}/{behalf}")
|
||||
@PostMapping("/invite/{id}/{status}/{behalf}")
|
||||
public Object setInviteStatusOnBehalf(@PathVariable Object id, @PathVariable Object status, @PathVariable Object behalf) {
|
||||
return null; // TODO implement setInviteStatusOnBehalf request controller
|
||||
}
|
||||
@ -210,7 +210,7 @@ public class ProjectsController extends HangarController {
|
||||
return fillModel(mav);
|
||||
}
|
||||
|
||||
@RequestMapping("/{author}/{slug}/discuss")
|
||||
@GetMapping("/{author}/{slug}/discuss")
|
||||
public ModelAndView showDiscussion(@PathVariable String author, @PathVariable String slug) {
|
||||
ModelAndView mv = new ModelAndView("projects/discuss");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
@ -221,7 +221,7 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/discuss/reply")
|
||||
@PostMapping("/{author}/{slug}/discuss/reply")
|
||||
public Object postDiscussionReply(@PathVariable Object author, @PathVariable Object slug) {
|
||||
return null; // TODO implement postDiscussionReply request controller
|
||||
}
|
||||
@ -320,7 +320,7 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/manage")
|
||||
@GetMapping("/{author}/{slug}/manage")
|
||||
public ModelAndView showSettings(@PathVariable String author, @PathVariable String slug) {
|
||||
ModelAndView mav = new ModelAndView("projects/settings");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
@ -345,7 +345,7 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/manage/hardDelete")
|
||||
@PostMapping("/{author}/{slug}/manage/hardDelete")
|
||||
public RedirectView delete(@PathVariable String author, @PathVariable String slug, RedirectAttributes ra) {
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
projectFactory.hardDeleteProject(projectData);
|
||||
@ -356,7 +356,7 @@ public class ProjectsController extends HangarController {
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@ProjectPermission(NamedPermission.MANAGE_SUBJECT_MEMBERS)
|
||||
@RequestMapping("/{author}/{slug}/manage/members/remove")
|
||||
@PostMapping("/{author}/{slug}/manage/members/remove")
|
||||
public ModelAndView removeMember(@PathVariable String author, @PathVariable String slug, @RequestParam String username) {
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
UserData user = userService.getUserData(username);
|
||||
@ -470,7 +470,7 @@ public class ProjectsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/manage/sendforapproval")
|
||||
@GetMapping("/{author}/{slug}/manage/sendforapproval")
|
||||
public ModelAndView sendForApproval(@PathVariable String author, @PathVariable String slug) {
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
if (projectData.getVisibility() == Visibility.NEEDSCHANGES) {
|
||||
@ -482,7 +482,7 @@ public class ProjectsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/notes")
|
||||
@GetMapping("/{author}/{slug}/notes")
|
||||
public ModelAndView showNotes(@PathVariable String author, @PathVariable String slug) {
|
||||
ModelAndView mv = new ModelAndView("projects/admin/notes");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
@ -505,7 +505,7 @@ public class ProjectsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.MOD_NOTES_AND_FLAGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/notes/addmessage")
|
||||
@PostMapping("/{author}/{slug}/notes/addmessage")
|
||||
public ModelAndView addMessage(@PathVariable String author, @PathVariable String slug, @RequestParam String content) {
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
ArrayNode messages = projectData.getProject().getNotes().getJson().withArray("messages");
|
||||
|
@ -105,7 +105,7 @@ public class ReviewsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.REVIEWER)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/reviews/edit/{review}") // Pretty sure this isn't implemented
|
||||
@PostMapping("/{author}/{slug}/versions/{version}/reviews/edit/{review}") // Pretty sure this isn't implemented
|
||||
public ResponseEntity<String> editReview(@PathVariable String author, @PathVariable String slug, @PathVariable String version, @PathVariable("review") long reviewId, @RequestParam String content) {
|
||||
ProjectVersionsTable versionsTable = versionService.getVersion(author, slug, version);
|
||||
VersionReview review = reviewService.getById(reviewId);
|
||||
@ -132,7 +132,7 @@ public class ReviewsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.REVIEWER)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/reviews/reopen")
|
||||
@PostMapping("/{author}/{slug}/versions/{version}/reviews/reopen")
|
||||
public ModelAndView reopenReview(@PathVariable String author, @PathVariable String slug, @PathVariable String version) {
|
||||
ProjectVersionsTable versionsTable = versionService.getVersion(author, slug, version);
|
||||
VersionReview review = reviewService.getRecentReviews(versionsTable.getId()).stream().findFirst().orElse(null);
|
||||
@ -152,7 +152,7 @@ public class ReviewsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.REVIEWER)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/reviews/reviewtoggle")
|
||||
@PostMapping("/{author}/{slug}/versions/{version}/reviews/reviewtoggle")
|
||||
public ModelAndView backlogToggle(@PathVariable String author, @PathVariable String slug, @PathVariable String version) {
|
||||
ProjectVersionsTable versionsTable = versionService.getVersion(author, slug, version);
|
||||
if (versionsTable.getReviewState() != ReviewState.BACKLOG && versionsTable.getReviewState() != ReviewState.UNREVIEWED) {
|
||||
@ -184,7 +184,7 @@ public class ReviewsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.REVIEWER)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/reviews/takeover")
|
||||
@PostMapping("/{author}/{slug}/versions/{version}/reviews/takeover")
|
||||
public ModelAndView takeoverReview(@PathVariable String author, @PathVariable String slug, @PathVariable String version, @RequestParam String content) {
|
||||
ProjectVersionsTable versionsTable = versionService.getVersion(author, slug, version);
|
||||
VersionReview oldReview = reviewService.getMostRecentUnfinishedReview(versionsTable.getId());
|
||||
|
@ -94,7 +94,7 @@ public class UsersController extends HangarController {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
@RequestMapping("/authors")
|
||||
@GetMapping("/authors")
|
||||
public ModelAndView showAuthors(@RequestParam(required = false, defaultValue = "projects") String sort, @RequestParam(required = false, defaultValue = "1") int page) {
|
||||
ModelAndView mav = new ModelAndView("users/authors");
|
||||
mav.addObject("authors", userService.getAuthors(page, sort));
|
||||
@ -104,7 +104,7 @@ public class UsersController extends HangarController {
|
||||
return fillModel(mav);
|
||||
}
|
||||
|
||||
@RequestMapping("/login")
|
||||
@GetMapping("/login")
|
||||
public ModelAndView login(@RequestParam(defaultValue = "") String sso, @RequestParam(defaultValue = "") String sig, @RequestParam(defaultValue = "") String returnUrl, @CookieValue(value = "url", required = false) String redirectUrl, RedirectAttributes attributes) {
|
||||
if (hangarConfig.fakeUser.isEnabled()) {
|
||||
hangarConfig.checkDebug();
|
||||
@ -149,7 +149,7 @@ public class UsersController extends HangarController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/logout")
|
||||
@GetMapping("/logout")
|
||||
public ModelAndView logout(HttpSession session) {
|
||||
// TODO flash
|
||||
session.invalidate();
|
||||
@ -180,7 +180,7 @@ public class UsersController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/prompts/read/{id}")
|
||||
@PostMapping("/prompts/read/{id}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public void markPromptRead(@PathVariable("id") Prompt prompt) {
|
||||
if (prompt == null) {
|
||||
@ -189,7 +189,7 @@ public class UsersController extends HangarController {
|
||||
userService.markPromptAsRead(prompt);
|
||||
}
|
||||
|
||||
@RequestMapping("/signup")
|
||||
@GetMapping("/signup")
|
||||
public ModelAndView signUp(@RequestParam(defaultValue = "") String returnUrl, RedirectAttributes attributes) {
|
||||
try {
|
||||
return redirectToSso(ssoService.getSignupUrl(returnUrl), attributes);
|
||||
@ -209,7 +209,7 @@ public class UsersController extends HangarController {
|
||||
return fillModel(mav);
|
||||
}
|
||||
|
||||
@RequestMapping("/verify")
|
||||
@PostMapping("/verify")
|
||||
public ModelAndView verify(@RequestParam String returnPath, RedirectAttributes attributes) {
|
||||
try {
|
||||
return redirectToSso(ssoService.getVerifyUrl(returnPath), attributes);
|
||||
@ -219,7 +219,7 @@ public class UsersController extends HangarController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{user}")
|
||||
@GetMapping("/{user}")
|
||||
public ModelAndView showProjects(@PathVariable String user) {
|
||||
ModelAndView mav = new ModelAndView("users/projects");
|
||||
OrganizationsTable organizationsTable = orgService.getOrganization(user);
|
||||
@ -244,7 +244,7 @@ public class UsersController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{user}/settings/lock/{locked}")
|
||||
@PostMapping("/{user}/settings/lock/{locked}")
|
||||
public RedirectView setLocked(@PathVariable String user, @PathVariable boolean locked, @RequestParam String sso, @RequestParam String sig) {
|
||||
// TODO auth
|
||||
userService.setLocked(user, locked);
|
||||
@ -266,7 +266,7 @@ public class UsersController extends HangarController {
|
||||
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("users.showProjects", user));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{user}/sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@GetMapping(value = "/{user}/sitemap.xml", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
@ResponseBody
|
||||
public String userSitemap(@PathVariable String user) {
|
||||
UsersTable usersTable = userDao.get().getByName(user);
|
||||
|
@ -103,7 +103,7 @@ public class VersionsController extends HangarController {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/api/project/{pluginId}/versions/recommended/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/api/project/{pluginId}/versions/recommended/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object downloadRecommendedJarById(@PathVariable String pluginId, @RequestParam(required = false) String token) {
|
||||
ProjectsTable project = projectDao.get().getByPluginId(pluginId);
|
||||
@ -117,7 +117,7 @@ public class VersionsController extends HangarController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/api/project/{pluginId}/versions/{name}/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/api/project/{pluginId}/versions/{name}/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object downloadJarById(@PathVariable String pluginId, @PathVariable String name, @RequestParam(required = false) String token) {
|
||||
ProjectsTable project = projectDao.get().getByPluginId(pluginId);
|
||||
@ -132,7 +132,7 @@ public class VersionsController extends HangarController {
|
||||
|
||||
@GlobalPermission(NamedPermission.VIEW_LOGS)
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versionLog")
|
||||
@GetMapping("/{author}/{slug}/versionLog")
|
||||
public ModelAndView showLog(@PathVariable String author, @PathVariable String slug, @RequestParam String versionString) {
|
||||
ModelAndView mv = new ModelAndView("projects/versions/log");
|
||||
ProjectData projectData = projectService.getProjectData(author, slug);
|
||||
@ -218,7 +218,7 @@ public class VersionsController extends HangarController {
|
||||
return fillModel(mav);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{author}/{slug}/versions/recommended/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/{author}/{slug}/versions/recommended/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object downloadRecommended(@PathVariable String author, @PathVariable String slug, @RequestParam(required = false) String token) {
|
||||
ProjectsTable project = projectDao.get().getBySlug(author, slug);
|
||||
@ -232,7 +232,7 @@ public class VersionsController extends HangarController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{author}/{slug}/versions/recommended/jar", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/{author}/{slug}/versions/recommended/jar", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object downloadRecommendedJar(@PathVariable String author, @PathVariable String slug, @RequestParam(required = false) String token) {
|
||||
ProjectsTable project = projectDao.get().getBySlug(author, slug);
|
||||
@ -341,7 +341,7 @@ public class VersionsController extends HangarController {
|
||||
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("versions.show", author, slug, version));
|
||||
}
|
||||
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/confirm")
|
||||
@GetMapping("/{author}/{slug}/versions/{version}/confirm")
|
||||
public Object showDownloadConfirm(@PathVariable Object author, @PathVariable Object slug, @PathVariable Object version, @RequestParam Object downloadType, @RequestParam Object api, @RequestParam Object dummy) {
|
||||
return null; // TODO implement showDownloadConfirm request controller
|
||||
}
|
||||
@ -369,7 +369,7 @@ public class VersionsController extends HangarController {
|
||||
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("versions.showList", author, slug));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{author}/{slug}/versions/{version}/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/{author}/{slug}/versions/{version}/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object download(@PathVariable String author, @PathVariable String slug, @PathVariable String version, @RequestParam(required = false) String token, @RequestParam(defaultValue = "false") boolean confirm) {
|
||||
ProjectsTable project = projectDao.get().getBySlug(author, slug);
|
||||
@ -424,12 +424,12 @@ public class VersionsController extends HangarController {
|
||||
}
|
||||
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/{author}/{slug}/versions/{version}/hardDelete")
|
||||
@PostMapping("/{author}/{slug}/versions/{version}/hardDelete")
|
||||
public Object delete(@PathVariable Object author, @PathVariable Object slug, @PathVariable Object version) {
|
||||
return null; // TODO implement delete request controller
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{author}/{slug}/versions/{version}/jar", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value = "/{author}/{slug}/versions/{version}/jar", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
public Object downloadJar(@PathVariable String author, @PathVariable String slug, @PathVariable String version, @RequestParam(required = false) String token) {
|
||||
ProjectsTable project = projectDao.get().getBySlug(author, slug);
|
||||
|
Loading…
x
Reference in New Issue
Block a user