Skip to content

Commit

Permalink
Merge pull request #36 from Ratnesh-Team/develop
Browse files Browse the repository at this point in the history
api service and env variable change
  • Loading branch information
ratnesh-maurya authored Oct 1, 2024
2 parents c8220a2 + 092a4e3 commit 1603d10
Show file tree
Hide file tree
Showing 15 changed files with 418 additions and 58 deletions.
5 changes: 3 additions & 2 deletions Backend/controllers/auth_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controllers
import (
"log"
"net/http"
"os"

"github.com/Ratnesh-Team/Rehabify/models"
"github.com/Ratnesh-Team/Rehabify/repository"
Expand Down Expand Up @@ -53,7 +54,7 @@ func AddUser(authdb repository.MongoRepository) gin.HandlerFunc {
}
// Continue with user registration
data := user.Password
salt := "E_SALA_CUP_NAMDE"
salt := os.Getenv("SALT")
user.Password = utils.Hash(data, salt)
user.UnencryptedPassword = data

Expand Down Expand Up @@ -81,7 +82,7 @@ func VerifyUser(authdb repository.MongoRepository) gin.HandlerFunc {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
salt := "E_SALA_CUP_NAMDE"
salt := os.Getenv("SALT")
data := user.Password
password := utils.Hash(data, salt)
filter := bson.M{}
Expand Down
131 changes: 131 additions & 0 deletions Backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/Homeremedies": {
"get": {
"description": "Get all Homeremedies details",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Homeremedies"
],
"summary": "Get all Homeremedies details",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Homeremedies"
}
}
}
}
},
"/NMK": {
"get": {
"description": "Get all NMK codes",
Expand All @@ -38,6 +61,29 @@ const docTemplate = `{
}
}
},
"/doctors": {
"get": {
"description": "Get all doctors",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Doctors"
],
"summary": "Get all doctors",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.DoctorData"
}
}
}
}
},
"/users": {
"get": {
"description": "Get users based on query parameters",
Expand Down Expand Up @@ -89,6 +135,70 @@ const docTemplate = `{
}
},
"definitions": {
"models.DoctorData": {
"type": "object",
"properties": {
"ClinicAddress": {
"type": "string"
},
"ContactNumber": {
"type": "integer"
},
"Description": {
"type": "string"
},
"Docter_Code": {
"type": "string"
},
"Email": {
"type": "string"
},
"ImageURL": {
"type": "string"
},
"IsVerified": {
"type": "boolean"
},
"Name": {
"type": "string"
},
"Specialization": {
"type": "string"
},
"_id": {
"type": "string"
}
}
},
"models.Homeremedies": {
"type": "object",
"properties": {
"author": {
"type": "string"
},
"body": {
"type": "string"
},
"category": {
"type": "string"
},
"content": {
"type": "string"
},
"date": {
"type": "string"
},
"id": {
"type": "integer"
},
"image": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"models.NMK": {
"type": "object",
"properties": {
Expand All @@ -98,21 +208,42 @@ const docTemplate = `{
"Contact_Number": {
"type": "integer"
},
"District": {
"type": "string"
},
"Email": {
"type": "string"
},
"Established_Year": {
"type": "integer"
},
"ImageURL": {
"type": "string"
},
"IsVerified": {
"type": "boolean"
},
"NMK_Code": {
"type": "string"
},
"NMK_Image": {
"type": "string"
},
"NMK_Verification_Image": {
"type": "string"
},
"Name": {
"type": "string"
},
"Owner_Name": {
"type": "string"
},
"Pincode": {
"type": "integer"
},
"State": {
"type": "string"
},
"_id": {
"type": "string"
}
Expand Down
131 changes: 131 additions & 0 deletions Backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@
"contact": {}
},
"paths": {
"/Homeremedies": {
"get": {
"description": "Get all Homeremedies details",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Homeremedies"
],
"summary": "Get all Homeremedies details",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Homeremedies"
}
}
}
}
},
"/NMK": {
"get": {
"description": "Get all NMK codes",
Expand All @@ -27,6 +50,29 @@
}
}
},
"/doctors": {
"get": {
"description": "Get all doctors",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Doctors"
],
"summary": "Get all doctors",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.DoctorData"
}
}
}
}
},
"/users": {
"get": {
"description": "Get users based on query parameters",
Expand Down Expand Up @@ -78,6 +124,70 @@
}
},
"definitions": {
"models.DoctorData": {
"type": "object",
"properties": {
"ClinicAddress": {
"type": "string"
},
"ContactNumber": {
"type": "integer"
},
"Description": {
"type": "string"
},
"Docter_Code": {
"type": "string"
},
"Email": {
"type": "string"
},
"ImageURL": {
"type": "string"
},
"IsVerified": {
"type": "boolean"
},
"Name": {
"type": "string"
},
"Specialization": {
"type": "string"
},
"_id": {
"type": "string"
}
}
},
"models.Homeremedies": {
"type": "object",
"properties": {
"author": {
"type": "string"
},
"body": {
"type": "string"
},
"category": {
"type": "string"
},
"content": {
"type": "string"
},
"date": {
"type": "string"
},
"id": {
"type": "integer"
},
"image": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"models.NMK": {
"type": "object",
"properties": {
Expand All @@ -87,21 +197,42 @@
"Contact_Number": {
"type": "integer"
},
"District": {
"type": "string"
},
"Email": {
"type": "string"
},
"Established_Year": {
"type": "integer"
},
"ImageURL": {
"type": "string"
},
"IsVerified": {
"type": "boolean"
},
"NMK_Code": {
"type": "string"
},
"NMK_Image": {
"type": "string"
},
"NMK_Verification_Image": {
"type": "string"
},
"Name": {
"type": "string"
},
"Owner_Name": {
"type": "string"
},
"Pincode": {
"type": "integer"
},
"State": {
"type": "string"
},
"_id": {
"type": "string"
}
Expand Down
Loading

0 comments on commit 1603d10

Please sign in to comment.