update dev
This commit is contained in:
+1
-1
@@ -24,5 +24,5 @@ WORKDIR /root/
|
||||
|
||||
COPY --from=builder /app/main .
|
||||
COPY --from=builder /app/.env .
|
||||
EXPOSE 8080
|
||||
EXPOSE 8082
|
||||
CMD ["./main"]
|
||||
+12
-12
@@ -36,20 +36,20 @@ func ConnectDB() {
|
||||
log.Println("Successfully connected to the database")
|
||||
}
|
||||
|
||||
hostSimrs := os.Getenv("SIMRS_HOST")
|
||||
userNameSimrs := os.Getenv("SIMRS_USERNAME")
|
||||
passwordSimrs := os.Getenv("SIMRS_PASSWORD")
|
||||
dbNameSimrs := os.Getenv("SIMRS_NAME")
|
||||
portSimrs := os.Getenv("SIMRS_PORT")
|
||||
// hostSimrs := os.Getenv("SIMRS_HOST")
|
||||
// userNameSimrs := os.Getenv("SIMRS_USERNAME")
|
||||
// passwordSimrs := os.Getenv("SIMRS_PASSWORD")
|
||||
// dbNameSimrs := os.Getenv("SIMRS_NAME")
|
||||
// portSimrs := os.Getenv("SIMRS_PORT")
|
||||
|
||||
simrs := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Jakarta", hostSimrs, userNameSimrs, passwordSimrs, dbNameSimrs, portSimrs)
|
||||
// simrs := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Jakarta", hostSimrs, userNameSimrs, passwordSimrs, dbNameSimrs, portSimrs)
|
||||
|
||||
SimrsDB, err = gorm.Open(postgres.Open(simrs), &gorm.Config{})
|
||||
if err != nil {
|
||||
log.Fatal("Failed to connect to Satu Data database: ", err)
|
||||
} else {
|
||||
log.Println("Successfully connected to the database")
|
||||
}
|
||||
// SimrsDB, err = gorm.Open(postgres.Open(simrs), &gorm.Config{})
|
||||
// if err != nil {
|
||||
// log.Fatal("Failed to connect to Satu Data database: ", err)
|
||||
// } else {
|
||||
// log.Println("Successfully connected to the database")
|
||||
// }
|
||||
}
|
||||
|
||||
func SetHeader(isIcare bool, cfg config.ConfigBpjs) *config.Header {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ services:
|
||||
container_name: api-rssa
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 8082:8082
|
||||
volumes:
|
||||
- .:/app
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
@@ -510,21 +510,21 @@ func GetAllJadwalDokter(c *gin.Context) {
|
||||
var res *[]jadwal_dokter.ListDokter
|
||||
|
||||
for _, value := range spesialis {
|
||||
// tanggal := time.Now().Format("2006-01-02")
|
||||
tanggal := "2025-01-08"
|
||||
// for i := 0; i < 7; i++ {
|
||||
tanggal := time.Now().Format("2006-01-02")
|
||||
// tanggal := "2025-01-08"
|
||||
for i := 0; i < 7; i++ {
|
||||
kdPoly := value.Kode
|
||||
res, err = JadwalDokterGetResponseApi(url, header, kdPoly, tanggal, headers)
|
||||
if err != nil {
|
||||
log.Println("Error making external API request: %v", err)
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
}
|
||||
// date, errParse := time.Parse("2006-01-02", tanggal)
|
||||
// if errParse != nil {
|
||||
// c.JSON(http.StatusInternalServerError, errParse)
|
||||
// return
|
||||
// }
|
||||
// tanggal = date.AddDate(0, 0, 1).Format("2006-01-02")
|
||||
date, errParse := time.Parse("2006-01-02", tanggal)
|
||||
if errParse != nil {
|
||||
c.JSON(http.StatusInternalServerError, errParse)
|
||||
return
|
||||
}
|
||||
tanggal = date.AddDate(0, 0, 1).Format("2006-01-02")
|
||||
log.Println("Tanggal :", tanggal)
|
||||
if res == nil {
|
||||
log.Println("Skip Proses")
|
||||
@@ -558,7 +558,7 @@ func GetAllJadwalDokter(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
c.JSON(http.StatusOK, res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user