change: add server ext

This commit is contained in:
lilong.129
2025-02-18 20:46:27 +08:00
parent 7183eae486
commit 7abfb56661
9 changed files with 211 additions and 268 deletions

View File

@@ -2,12 +2,10 @@ package server
import (
"encoding/base64"
"net/http"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v5/code"
"github.com/httprunner/httprunner/v5/pkg/uixt/option"
)
@@ -45,13 +43,7 @@ func screenResultHandler(c *gin.Context) {
screenResult, err := dExt.GetScreenResult(actionOptions...)
if err != nil {
log.Err(err).Msg("get screen result failed")
c.JSON(http.StatusInternalServerError,
HttpResponse{
Code: code.GetErrorCode(err),
Message: err.Error(),
},
)
c.Abort()
RenderError(c, err)
return
}
RenderSuccess(c, screenResult)