penambahan template selanjutnya

This commit is contained in:
2025-07-25 11:00:19 +07:00
parent 6c23369c06
commit 3af7a7ecbb
12 changed files with 63 additions and 73 deletions

View File

@@ -19,7 +19,7 @@ func InsertDataMaster(c *gin.Context) {
"code": 400,
})
}
db := database.New(master).GetDB()
db := database.New(master).GetMongoDB()
mongoDB := mongo.NewDatabaseService(db)
ReqInsertData.ID = uuid.New().String()
errInsert := mongoDB.InsertDataMaster(ReqInsertData)

View File

@@ -15,7 +15,7 @@ import (
func GetDataLog(c *gin.Context) {
locals := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(locals).GetDB()
db := database.New(locals).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return

View File

@@ -12,7 +12,7 @@ import (
func InsertPatient(c *gin.Context) {
local := os.Getenv("MONGODB_DEV_LOCAL")
db := database.New(local).GetDB()
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return
@@ -39,7 +39,7 @@ func InsertPatient(c *gin.Context) {
func GetAllPatient(c *gin.Context) {
local := os.Getenv("MONGODB_DEV_LOCAL")
db := database.New(local).GetDB()
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return

View File

@@ -1,7 +1,6 @@
package poliklinik
import (
""
"github.com/gin-gonic/gin"
"log"
"net/http"

View File

@@ -23,8 +23,8 @@ import (
// @Failure 500 {object} map[string]string "Database connection failed"
// @Router /api/localinsertuser [post]
func InsertUser(c *gin.Context) {
local := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(local).GetDB()
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
@@ -60,8 +60,8 @@ func InsertUser(c *gin.Context) {
// @Failure 500 {object} map[string]string "Database connection failed"
// @Router /api/local/getalluser [get]
func GetAllUser(c *gin.Context) {
local := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(local).GetDB()
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
@@ -88,7 +88,7 @@ func GetAllUser(c *gin.Context) {
// @Router /api/local/getuser/{id} [get]
func GetUserByID(c *gin.Context) {
local := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(local).GetDB()
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return
@@ -119,7 +119,7 @@ func GetUserByID(c *gin.Context) {
// @Router /users [put]
func UpdateUser(c *gin.Context) {
local := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(local).GetDB()
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return
@@ -146,7 +146,7 @@ func UpdateUser(c *gin.Context) {
func DeleteUser(c *gin.Context) {
local := os.Getenv("BLUEPRINT_DB_LOCAL")
db := database.New(local).GetDB()
db := database.New(local).GetMongoDB()
if db == nil {
c.JSON(http.StatusInternalServerError, gin.H{"message": "Database connection failed"})
return