Skip to content

Commit

Permalink
swagger update
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMaster482 committed Dec 25, 2023
1 parent 221d695 commit dfa7df6
Show file tree
Hide file tree
Showing 3 changed files with 868 additions and 0 deletions.
329 changes: 329 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,118 @@ const docTemplate = `{
}
}
},
"/api/goals": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Update an existing goal for the authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Goals"
],
"summary": "Update Goal",
"parameters": [
{
"description": "Updated goal information",
"name": "goalInput",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Goal"
}
}
],
"responses": {
"200": {
"description": "Successfully updated goal",
"schema": {
"$ref": "#/definitions/http.Response"
}
},
"400": {
"description": "Bad Request: Invalid request body",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"401": {
"description": "Unauthorized: Invalid or expired token",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"404": {
"description": "Not Found: Goal not found",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"500": {
"description": "Internal Server Error: Failed to update goal",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
}
}
}
},
"/api/goals/checkState": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Check the state of goals for the authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Goals"
],
"summary": "Check Goals State",
"parameters": [
{
"type": "string",
"description": "JWT token for authentication",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully checked goals state",
"schema": {
"$ref": "#/definitions/http.Response"
}
},
"400": {
"description": "Bad Request: Failed to check goals state",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"401": {
"description": "Unauthorized: Invalid or expired token",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
}
}
}
},
"/api/tag/all": {
"get": {
"description": "Get all tags for user",
Expand Down Expand Up @@ -1405,6 +1517,180 @@ const docTemplate = `{
}
}
},
"/api/user/goal/": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Retrieve goals for the authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Goals"
],
"summary": "Get User Goals",
"parameters": [
{
"type": "string",
"description": "JWT token for authentication",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully retrieved user goals",
"schema": {
"$ref": "#/definitions/http.Response"
}
},
"401": {
"description": "Unauthorized: Invalid or expired token",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"500": {
"description": "Internal Server Error: Failed to get user goals",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
}
}
}
},
"/api/user/goal/add": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Create a new goal for the authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Goals"
],
"summary": "Create Goal",
"parameters": [
{
"description": "Goal creation input",
"name": "goalInput",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/goal.GoalCreateRequest"
}
}
],
"responses": {
"200": {
"description": "Successfully created goal",
"schema": {
"$ref": "#/definitions/http.Response"
}
},
"400": {
"description": "Bad Request: Invalid request body",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"401": {
"description": "Unauthorized: Invalid or expired token",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"500": {
"description": "Internal Server Error: Failed to create goal",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
}
}
}
},
"/api/user/goal/{goalID}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Delete an existing goal for the authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Goals"
],
"summary": "Delete Goal",
"parameters": [
{
"type": "string",
"description": "JWT token for authentication",
"name": "Authorization",
"in": "header",
"required": true
},
{
"type": "string",
"description": "ID of the goal to delete",
"name": "goalID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully deleted goal",
"schema": {
"$ref": "#/definitions/http.Response"
}
},
"400": {
"description": "Bad Request: Invalid request body",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"401": {
"description": "Unauthorized: Invalid or expired token",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"404": {
"description": "Not Found: Goal not found",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
},
"500": {
"description": "Internal Server Error: Failed to delete goal",
"schema": {
"$ref": "#/definitions/http.ResponseError"
}
}
}
}
},
"/api/user/plannedBudget": {
"get": {
"description": "Get User planned budget",
Expand Down Expand Up @@ -1672,6 +1958,26 @@ const docTemplate = `{
}
}
},
"goal.GoalCreateRequest": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"total": {
"type": "number"
},
"user_id": {
"type": "string"
}
}
},
"http.CreateAccount": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1858,6 +2164,29 @@ const docTemplate = `{
}
}
},
"models.Goal": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"total": {
"type": "number"
},
"user_id": {
"type": "string"
}
}
},
"models.User": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit dfa7df6

Please sign in to comment.