penambahan template selanjutnya
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user