package monkey import ( "goqs/controllers" "net/http" "github.com/gin-gonic/gin" ) // @Tags Monkey相关 /api/monkey/v1/ // @Summary 获取设备列表 // @Description 获取安卓设备列表 // @accept x-www-form-urlencoded // @Param platform query int false "平台:ios/adr" // @Success 200 {object} models.Response "返回设备信息" // @Router /api/monkey/v1/devices [get] func GetDevices(c *gin.Context) { rsp := controllers.NewResponse() // var list []models.MonkeyDevice // db, err := dbsql.GetConn(dbsql.DSN) // if err != nil { // rsp.Error(err.Error()) // c.JSON(http.StatusOK, rsp) // return // } // defer dbsql.Close(db) rsp.Success() rsp.Data = GetAndroidDevices() c.JSON(http.StatusOK, rsp) }