This commit is contained in:
@@ -112,6 +112,7 @@ func (h *CommitController) RestoreCommit(c fiber.Ctx) error {
|
||||
// @Tags Commits
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param id path string true "Project ID"
|
||||
// @Success 200 {object} response.CommonResponse
|
||||
// @Failure 400 {object} response.CommonResponse
|
||||
|
||||
@@ -28,6 +28,7 @@ func NewProjectController(service services.ProjectService) *ProjectController {
|
||||
// @Tags Projects
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param id path string true "Project ID"
|
||||
// @Success 200 {object} response.CommonResponse
|
||||
// @Failure 400 {object} response.CommonResponse
|
||||
@@ -59,6 +60,7 @@ func (h *ProjectController) GetProjectByID(c fiber.Ctx) error {
|
||||
// @Tags Projects
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security BearerAuth
|
||||
// @Param query query request.SearchProjectDto false "Search Query"
|
||||
// @Success 200 {object} response.PaginatedResponse
|
||||
// @Failure 400 {object} response.CommonResponse
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"history-api/internal/controllers"
|
||||
"history-api/internal/middlewares"
|
||||
"history-api/internal/repositories"
|
||||
"history-api/pkg/constants"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
@@ -30,6 +31,7 @@ func ProjectRoutes(
|
||||
|
||||
route.Get(
|
||||
"/:id/commits",
|
||||
middlewares.JwtAccess(userRepo),
|
||||
commitController.GetProjectCommits,
|
||||
)
|
||||
|
||||
@@ -59,6 +61,7 @@ func ProjectRoutes(
|
||||
|
||||
route.Get(
|
||||
"/:id",
|
||||
middlewares.JwtAccess(userRepo),
|
||||
controller.GetProjectByID,
|
||||
)
|
||||
|
||||
@@ -76,6 +79,7 @@ func ProjectRoutes(
|
||||
|
||||
route.Get(
|
||||
"/",
|
||||
middlewares.RequireAnyRole(constants.RoleTypeAdmin, constants.RoleTypeMod),
|
||||
controller.SearchProject,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user