mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-11 18:59:39 +08:00
fix: merge
This commit is contained in:
@@ -7,14 +7,13 @@ import (
|
||||
"github.com/Masterminds/semver"
|
||||
"github.com/danielpaulus/go-ios/ios"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/httprunner/httprunner/v5/internal/builtin"
|
||||
"github.com/httprunner/httprunner/v5/pkg/gadb"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt/option"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func listDeviceHandler(c *gin.Context) {
|
||||
func (r *Router) listDeviceHandler(c *gin.Context) {
|
||||
var deviceList []interface{}
|
||||
client, err := gadb.NewClient()
|
||||
if err == nil {
|
||||
@@ -119,16 +118,17 @@ func deleteBrowserHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
func pushImageHandler(c *gin.Context) {
|
||||
func (r *Router) pushImageHandler(c *gin.Context) {
|
||||
var pushMediaReq PushMediaRequest
|
||||
if err := c.ShouldBindJSON(&pushMediaReq); err != nil {
|
||||
RenderErrorValidateRequest(c, err)
|
||||
return
|
||||
}
|
||||
driver, err := GetDriver(c)
|
||||
driver, err := r.GetDriver(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
imagePath, err := builtin.DownloadFileByUrl(pushMediaReq.ImageUrl)
|
||||
imagePath, err := uixt.DownloadFileByUrl(pushMediaReq.ImageUrl)
|
||||
if path.Ext(imagePath) == "" {
|
||||
err = os.Rename(imagePath, imagePath+".png")
|
||||
if err != nil {
|
||||
@@ -152,8 +152,8 @@ func pushImageHandler(c *gin.Context) {
|
||||
RenderSuccess(c, true)
|
||||
}
|
||||
|
||||
func clearImageHandler(c *gin.Context) {
|
||||
driver, err := GetDriver(c)
|
||||
func (r *Router) clearImageHandler(c *gin.Context) {
|
||||
driver, err := r.GetDriver(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -165,6 +165,6 @@ func clearImageHandler(c *gin.Context) {
|
||||
RenderSuccess(c, true)
|
||||
}
|
||||
|
||||
func videoHandler(c *gin.Context) {
|
||||
func (r *Router) videoHandler(c *gin.Context) {
|
||||
RenderSuccess(c, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user