refactor: move shoots driver to driver_ext

This commit is contained in:
lilong.129
2025-02-10 13:35:22 +08:00
parent 3038fb7430
commit 1ec383180b
19 changed files with 564 additions and 681 deletions

View File

@@ -38,8 +38,7 @@ func handleDeviceContext() gin.HandlerFunc {
switch strings.ToLower(platform) {
case "android":
device, err := uixt.NewAndroidDevice(
option.WithSerialNumber(serial),
option.WithStub(true))
option.WithSerialNumber(serial))
if err != nil {
log.Error().Err(err).Str("platform", platform).Str("serial", serial).
Msg("device not found")

View File

@@ -32,11 +32,11 @@ func NewServer(port int) error {
// get screen info
apiV1PlatformSerial.GET("/screenshot", handleDeviceContext(), screenshotHandler)
apiV1PlatformSerial.POST("/screenresult", handleDeviceContext(), screenResultHandler)
apiV1PlatformSerial.GET("/stub/source", handleDeviceContext(), sourceHandler)
apiV1PlatformSerial.GET("/shoots/source", handleDeviceContext(), sourceHandler)
apiV1PlatformSerial.GET("/adb/source", handleDeviceContext(), adbSourceHandler)
// Stub operations
apiV1PlatformSerial.POST("/stub/login", handleDeviceContext(), loginHandler)
apiV1PlatformSerial.POST("/stub/logout", handleDeviceContext(), logoutHandler)
// shoots operations
apiV1PlatformSerial.POST("/shoots/login", handleDeviceContext(), loginHandler)
apiV1PlatformSerial.POST("/shoots/logout", handleDeviceContext(), logoutHandler)
// run uixt actions
apiV1PlatformSerial.POST("/uixt/action", handleDeviceContext(), uixtActionHandler)