Skip to content

Commit

Permalink
admin: genre & tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kayprogrammer committed Dec 7, 2024
1 parent 6b41428 commit 98d66fb
Show file tree
Hide file tree
Showing 8 changed files with 830 additions and 8 deletions.
248 changes: 247 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const docTemplate = `{
}
}
},
"/admin/contracts": {
"/admin/books/contracts": {
"get": {
"security": [
{
Expand Down Expand Up @@ -131,6 +131,224 @@ const docTemplate = `{
}
}
},
"/admin/books/genres": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Add a new genre to the app.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin | Books"
],
"summary": "Add Genre",
"parameters": [
{
"description": "Genre",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schemas.GenreAddSchema"
}
}
],
"responses": {
"201": {
"description": "Genre Added Successfully",
"schema": {
"$ref": "#/definitions/schemas.ResponseSchema"
}
},
"400": {
"description": "Invalid request data",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/admin/books/genres/{slug}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update a genre.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin | Books"
],
"summary": "Update Genre",
"parameters": [
{
"type": "string",
"description": "Genre slug",
"name": "slug",
"in": "path",
"required": true
},
{
"description": "Genre",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schemas.GenreAddSchema"
}
}
],
"responses": {
"200": {
"description": "Genre Updated Successfully",
"schema": {
"$ref": "#/definitions/schemas.ResponseSchema"
}
},
"400": {
"description": "Invalid request data",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/admin/books/tags": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Add a new tag to the app.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin | Books"
],
"summary": "Add Tags",
"parameters": [
{
"description": "Tag",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schemas.TagsAddSchema"
}
}
],
"responses": {
"201": {
"description": "Tag added successfully",
"schema": {
"$ref": "#/definitions/schemas.ResponseSchema"
}
},
"400": {
"description": "Invalid request data",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/admin/books/tags/{slug}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update a tag to the app.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin | Books"
],
"summary": "Update Tags",
"parameters": [
{
"type": "string",
"description": "Tag slug",
"name": "slug",
"in": "path",
"required": true
},
{
"description": "Tag",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schemas.TagsAddSchema"
}
}
],
"responses": {
"200": {
"description": "Tag updated successfully",
"schema": {
"$ref": "#/definitions/schemas.ResponseSchema"
}
},
"400": {
"description": "Invalid request data",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/utils.ErrorResponse"
}
}
}
}
},
"/admin/payments/transactions": {
"get": {
"security": [
Expand Down Expand Up @@ -3565,6 +3783,23 @@ const docTemplate = `{
}
}
},
"schemas.GenreAddSchema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"tag_slugs": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"schemas.GenreSchema": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -4298,6 +4533,17 @@ const docTemplate = `{
}
}
},
"schemas.TagsAddSchema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
"schemas.TagsResponseSchema": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 98d66fb

Please sign in to comment.