update dev

This commit is contained in:
2025-04-25 14:43:13 +07:00
parent be13b428f1
commit dfdf5c887d
5 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -24,5 +24,5 @@ WORKDIR /root/
COPY --from=builder /app/main .
COPY --from=builder /app/.env .
EXPOSE 8080
EXPOSE 8082
CMD ["./main"]
+12 -12
View File
@@ -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
View File
@@ -7,7 +7,7 @@ services:
container_name: api-rssa
restart: always
ports:
- 8080:8080
- 8082:8082
volumes:
- .:/app
- /etc/localtime:/etc/localtime:ro
+10 -10
View File
@@ -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)
}
+2 -2
View File
@@ -142,8 +142,8 @@ func main() {
url := baseUrl + endpoint
log.Println("url", url)
log.Println("JALAN DI PORT : 8083")
err = r.Run(":8083")
log.Println("JALAN DI PORT : 8082")
err = r.Run(":8082")
if err != nil {
log.Fatal(err)
}