lengkap belum account

This commit is contained in:
2025-05-15 13:45:45 +07:00
parent 1fb1caaf19
commit fd30463082
28 changed files with 1571 additions and 639 deletions
@@ -44,3 +44,31 @@ func GetDataPractitioner(c *gin.Context) {
"data": dataPractitioner,
})
}
func Getdatadokter(c *gin.Context) {
local := os.Getenv("MONGODB_DEV_LOCAL")
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return
}
display := c.Param("display")
value := c.Param("value")
if display == "" || value == "" {
c.JSON(http.StatusBadRequest, gin.H{"message": "Parameter 'display' dan 'value' dibutuhkan"})
return
}
mongoDB := mongo.NewDatabaseServiceMongo(db)
dataSMF, err := mongoDB.GetDokterBySMF(display, value)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{
"data": dataSMF,
"message": "Practitioner Dengan SMF berhasil di cari",
})
}