update terbaru

This commit is contained in:
2025-07-01 12:42:28 +07:00
parent fd30463082
commit b01c88e7f5
24 changed files with 759 additions and 134 deletions
@@ -72,3 +72,31 @@ func Getdatadokter(c *gin.Context) {
"message": "Practitioner Dengan SMF berhasil di cari",
})
}
func GetPractitionerbyID(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
}
id := c.Param("id")
if id == "" {
c.JSON(http.StatusBadRequest, gin.H{"message": "Parameter 'id' dibutuhkan"})
return
}
mongoDB := mongo.NewDatabaseServiceMongo(db)
dataID, err := mongoDB.GetDokterByid(id)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{
"data": dataID,
"message": "Practitioner Dengan ID berhasil di cari",
})
}