From e754fb41e1b09fa46ef4e94410a663bc29371da4 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Fri, 13 Sep 2024 19:20:59 +0800 Subject: [PATCH] refactor: get ImagePath from ScreenResult --- hrp/pkg/uixt/client.go | 6 +++--- hrp/pkg/uixt/screenshot.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hrp/pkg/uixt/client.go b/hrp/pkg/uixt/client.go index e406e8ae..ac4a91e0 100644 --- a/hrp/pkg/uixt/client.go +++ b/hrp/pkg/uixt/client.go @@ -26,7 +26,7 @@ type DriverSession struct { } func (d *DriverSession) addScreenResult(screenResult *ScreenResult) { - d.screenResults[screenResult.imagePath] = screenResult + d.screenResults[screenResult.ImagePath] = screenResult } func (d *DriverSession) addRequestResult(driverResult *DriverResult) { @@ -43,11 +43,11 @@ func (d *DriverSession) GetAll() map[string]interface{} { screenShots := make([]string, 0) screenShotsUrls := make(map[string]string) for _, screenResult := range d.screenResults { - screenShots = append(screenShots, screenResult.imagePath) + screenShots = append(screenShots, screenResult.ImagePath) if screenResult.UploadedURL == "" { continue } - screenShotsUrls[screenResult.imagePath] = screenResult.UploadedURL + screenShotsUrls[screenResult.ImagePath] = screenResult.UploadedURL } data := map[string]interface{}{ diff --git a/hrp/pkg/uixt/screenshot.go b/hrp/pkg/uixt/screenshot.go index c9b0ea15..5fd1de14 100644 --- a/hrp/pkg/uixt/screenshot.go +++ b/hrp/pkg/uixt/screenshot.go @@ -21,7 +21,7 @@ import ( type ScreenResult struct { bufSource *bytes.Buffer // raw image buffer bytes - imagePath string // image file path + ImagePath string // image file path ImageResult *ImageResult // image result Resolution Size `json:"resolution"` @@ -54,7 +54,7 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S } screenResult = &ScreenResult{ bufSource: bufSource, - imagePath: imagePath, + ImagePath: imagePath, Tags: nil, Resolution: windowSize, }