comment log
This commit is contained in:
@@ -15,7 +15,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
baseUrl := os.Getenv("LIS_MIKROBIOLOGI_URL")
|
||||
endpoint := os.Getenv("LIS_REGISTERPASIEN")
|
||||
url := baseUrl + endpoint
|
||||
log.Println("URL", url)
|
||||
//log.Println("URL", url)
|
||||
|
||||
reqMarshall, err := json.Marshal(request)
|
||||
if err != nil {
|
||||
@@ -26,7 +26,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
log.Println("REQUEST: ", string(reqMarshall))
|
||||
//log.Println("REQUEST: ", string(reqMarshall))
|
||||
|
||||
req, err := http.NewRequest("POST", url, bytes.NewReader(reqMarshall))
|
||||
if err != nil {
|
||||
@@ -46,13 +46,13 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Println("dari LIS", response)
|
||||
//log.Println("dari LIS", response)
|
||||
|
||||
res, err := io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
//log.Println("code:", response.StatusCode)
|
||||
if response.StatusCode != 201 {
|
||||
var responseError *mikrobiologi.ResponseError
|
||||
err = json.Unmarshal(res, &responseError)
|
||||
@@ -68,7 +68,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
|
||||
var responses *mikrobiologi.Response
|
||||
|
||||
log.Println("RESPONSE: ", string(res))
|
||||
//log.Println("RESPONSE: ", string(res))
|
||||
err = json.Unmarshal(res, &responses)
|
||||
if err != nil {
|
||||
log.Printf("Error unmarshalling response: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user