This commit is contained in:
15
docs/docs.go
15
docs/docs.go
@@ -1307,6 +1307,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/projects": {
|
"/projects": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Search and filter projects with pagination",
|
"description": "Search and filter projects with pagination",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -1459,6 +1464,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/projects/{id}": {
|
"/projects/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Retrieve project details by specific ID",
|
"description": "Retrieve project details by specific ID",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -1688,6 +1698,11 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"/projects/{id}/commits": {
|
"/projects/{id}/commits": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Retrieve all commits for a specific project",
|
"description": "Retrieve all commits for a specific project",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
|
|||||||
@@ -1300,6 +1300,11 @@
|
|||||||
},
|
},
|
||||||
"/projects": {
|
"/projects": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Search and filter projects with pagination",
|
"description": "Search and filter projects with pagination",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -1452,6 +1457,11 @@
|
|||||||
},
|
},
|
||||||
"/projects/{id}": {
|
"/projects/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Retrieve project details by specific ID",
|
"description": "Retrieve project details by specific ID",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -1681,6 +1691,11 @@
|
|||||||
},
|
},
|
||||||
"/projects/{id}/commits": {
|
"/projects/{id}/commits": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"description": "Retrieve all commits for a specific project",
|
"description": "Retrieve all commits for a specific project",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
|
|||||||
@@ -1246,6 +1246,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
summary: Search projects
|
summary: Search projects
|
||||||
tags:
|
tags:
|
||||||
- Projects
|
- Projects
|
||||||
@@ -1344,6 +1346,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
summary: Get project by ID
|
summary: Get project by ID
|
||||||
tags:
|
tags:
|
||||||
- Projects
|
- Projects
|
||||||
@@ -1455,6 +1459,8 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
summary: Get project commits
|
summary: Get project commits
|
||||||
tags:
|
tags:
|
||||||
- Commits
|
- Commits
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ func (h *CommitController) RestoreCommit(c fiber.Ctx) error {
|
|||||||
// @Tags Commits
|
// @Tags Commits
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
|
// @Security BearerAuth
|
||||||
// @Param id path string true "Project ID"
|
// @Param id path string true "Project ID"
|
||||||
// @Success 200 {object} response.CommonResponse
|
// @Success 200 {object} response.CommonResponse
|
||||||
// @Failure 400 {object} response.CommonResponse
|
// @Failure 400 {object} response.CommonResponse
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ func NewProjectController(service services.ProjectService) *ProjectController {
|
|||||||
// @Tags Projects
|
// @Tags Projects
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
|
// @Security BearerAuth
|
||||||
// @Param id path string true "Project ID"
|
// @Param id path string true "Project ID"
|
||||||
// @Success 200 {object} response.CommonResponse
|
// @Success 200 {object} response.CommonResponse
|
||||||
// @Failure 400 {object} response.CommonResponse
|
// @Failure 400 {object} response.CommonResponse
|
||||||
@@ -59,6 +60,7 @@ func (h *ProjectController) GetProjectByID(c fiber.Ctx) error {
|
|||||||
// @Tags Projects
|
// @Tags Projects
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
|
// @Security BearerAuth
|
||||||
// @Param query query request.SearchProjectDto false "Search Query"
|
// @Param query query request.SearchProjectDto false "Search Query"
|
||||||
// @Success 200 {object} response.PaginatedResponse
|
// @Success 200 {object} response.PaginatedResponse
|
||||||
// @Failure 400 {object} response.CommonResponse
|
// @Failure 400 {object} response.CommonResponse
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"history-api/internal/controllers"
|
"history-api/internal/controllers"
|
||||||
"history-api/internal/middlewares"
|
"history-api/internal/middlewares"
|
||||||
"history-api/internal/repositories"
|
"history-api/internal/repositories"
|
||||||
|
"history-api/pkg/constants"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v3"
|
"github.com/gofiber/fiber/v3"
|
||||||
)
|
)
|
||||||
@@ -30,6 +31,7 @@ func ProjectRoutes(
|
|||||||
|
|
||||||
route.Get(
|
route.Get(
|
||||||
"/:id/commits",
|
"/:id/commits",
|
||||||
|
middlewares.JwtAccess(userRepo),
|
||||||
commitController.GetProjectCommits,
|
commitController.GetProjectCommits,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,6 +61,7 @@ func ProjectRoutes(
|
|||||||
|
|
||||||
route.Get(
|
route.Get(
|
||||||
"/:id",
|
"/:id",
|
||||||
|
middlewares.JwtAccess(userRepo),
|
||||||
controller.GetProjectByID,
|
controller.GetProjectByID,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -76,6 +79,7 @@ func ProjectRoutes(
|
|||||||
|
|
||||||
route.Get(
|
route.Get(
|
||||||
"/",
|
"/",
|
||||||
|
middlewares.RequireAnyRole(constants.RoleTypeAdmin, constants.RoleTypeMod),
|
||||||
controller.SearchProject,
|
controller.SearchProject,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user