feat: add uixt tool launch_app

This commit is contained in:
lilong.129
2025-05-21 16:36:23 +08:00
parent 495443a2c4
commit 03553a4962
5 changed files with 54 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v5/uixt"
"github.com/httprunner/httprunner/v5/uixt/types"
)
func (r *Router) foregroundAppHandler(c *gin.Context) {
@@ -50,7 +51,7 @@ func (r *Router) appInfoHandler(c *gin.Context) {
}
func (r *Router) clearAppHandler(c *gin.Context) {
var appClearReq AppClearRequest
var appClearReq types.AppClearRequest
if err := c.ShouldBindJSON(&appClearReq); err != nil {
RenderErrorValidateRequest(c, err)
return
@@ -69,7 +70,7 @@ func (r *Router) clearAppHandler(c *gin.Context) {
}
func (r *Router) launchAppHandler(c *gin.Context) {
var appLaunchReq AppLaunchRequest
var appLaunchReq types.AppLaunchRequest
if err := c.ShouldBindJSON(&appLaunchReq); err != nil {
RenderErrorValidateRequest(c, err)
return
@@ -87,7 +88,7 @@ func (r *Router) launchAppHandler(c *gin.Context) {
}
func (r *Router) terminalAppHandler(c *gin.Context) {
var appTerminalReq AppTerminalRequest
var appTerminalReq types.AppTerminalRequest
if err := c.ShouldBindJSON(&appTerminalReq); err != nil {
RenderErrorValidateRequest(c, err)
return

View File

@@ -24,18 +24,6 @@ type KeycodeRequest struct {
Keycode int `json:"keycode" binding:"required"`
}
type AppClearRequest struct {
PackageName string `json:"packageName" binding:"required"`
}
type AppLaunchRequest struct {
PackageName string `json:"packageName" binding:"required"`
}
type AppTerminalRequest struct {
PackageName string `json:"packageName" binding:"required"`
}
type AppInstallRequest struct {
AppUrl string `json:"appUrl" binding:"required"`
MappingUrl string `json:"mappingUrl"`