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

@@ -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