add ressource api docs
This commit is contained in:
785
docs/docs.go
785
docs/docs.go
@@ -36,13 +36,27 @@ const docTemplate = `{
|
||||
"category"
|
||||
],
|
||||
"summary": "List all categories",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Language code of language that should be returned. Defaults to 'en'",
|
||||
"name": "lang",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Comma-separated related resources to include",
|
||||
"name": "include",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.Category"
|
||||
"$ref": "#/definitions/models.CategoryLocalizedResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -105,6 +119,18 @@ const docTemplate = `{
|
||||
],
|
||||
"summary": "Retreive a category",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Language code of language that should be returned. Defaults to 'en'",
|
||||
"name": "lang",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Comma-separated related resources to include",
|
||||
"name": "include",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this category.",
|
||||
@@ -117,7 +143,7 @@ const docTemplate = `{
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Category"
|
||||
"$ref": "#/definitions/models.CategoryLocalizedResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
@@ -745,6 +771,525 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ressource/": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "List all ressources",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Language code of language that should be returned. Defaults to 'en'",
|
||||
"name": "lang",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Comma-separated related resources to include",
|
||||
"name": "include",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceLocalizedResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Create a ressource",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "ressource",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Ressource"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ressource/{id}": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Retreive a ressource",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Language code of language that should be returned. Defaults to 'en'",
|
||||
"name": "lang",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Comma-separated related resources to include",
|
||||
"name": "include",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceLocalizedResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Update an existing ressource",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "updated ressource",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Ressource"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Delete an existing ressource",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controllers.EmptyResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Partially update an existing ressource",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "partially updated ressource",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Ressource"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ressource/{id}/translation": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "List all ressource translations",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Create a ressource translation",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "ressource translation",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslationRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ressource/{id}/translation/{id}": {
|
||||
"get": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Retreive a ressource translation",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource translation.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Update an existing ressource translation",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource translation.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "updated ressource translation",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslationRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Delete an existing ressource translation",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource translation.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controllers.EmptyResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ressource"
|
||||
],
|
||||
"summary": "Partially update an existing ressource translation",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying this ressource.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "A unique integer value identifying the ressource translation.",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "partially updated ressource translation",
|
||||
"name": "ressource",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslationRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/httputil.HTTPError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/login": {
|
||||
"post": {
|
||||
"description": "Login user",
|
||||
@@ -977,6 +1522,31 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryLocalizedResponse": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"language",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"language": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"translation": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.CategoryTranslation"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.CategoryRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -1073,6 +1643,217 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.Ressource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"$ref": "#/definitions/models.Category"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"$ref": "#/definitions/gorm.DeletedAt"
|
||||
},
|
||||
"feedback": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceFeedback"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"spokenLanguages": {
|
||||
"type": "string"
|
||||
},
|
||||
"tag": {
|
||||
"type": "string"
|
||||
},
|
||||
"translations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.RessourceFeedback": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"$ref": "#/definitions/gorm.DeletedAt"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"ressourceID": {
|
||||
"type": "integer"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.RessourceLocalizedResponse": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"categoryName",
|
||||
"id",
|
||||
"language",
|
||||
"name",
|
||||
"region",
|
||||
"text"
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"$ref": "#/definitions/models.Category"
|
||||
},
|
||||
"categoryName": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"language": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"spokenLanguages": {
|
||||
"type": "string"
|
||||
},
|
||||
"tag": {
|
||||
"type": "string"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"translations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceTranslation"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.RessourceRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"categoryId",
|
||||
"region",
|
||||
"translations"
|
||||
],
|
||||
"properties": {
|
||||
"categoryId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"spokenLanguages": {
|
||||
"type": "string"
|
||||
},
|
||||
"tag": {
|
||||
"type": "string"
|
||||
},
|
||||
"translations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/models.RessourceTranslationRequest"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.RessourceTranslation": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"deletedAt": {
|
||||
"$ref": "#/definitions/gorm.DeletedAt"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"languageID": {
|
||||
"type": "integer"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"ressourceID": {
|
||||
"type": "integer"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.RessourceTranslationRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"languageId",
|
||||
"name",
|
||||
"ressourceId",
|
||||
"text"
|
||||
],
|
||||
"properties": {
|
||||
"languageId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"ressourceId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
|
||||
Reference in New Issue
Block a user