Beispiel #1
0
def tcdevices_index_handler():
    """
    @api {post} /v1/tcdevices/report 云真机使用上报
    @apiName ReportDevices
    @apiGroup 云真机
    @apiDescription 云真机具体使用上报
    @apiParam {int} use_type 发送者
    @apiParam {string} manufacturer manufacturer
    @apiParam {string} model model
    @apiParam {string} platform 平台
    @apiParam {string} version 版本
    @apiParam {string} serial 序列号
    @apiParam {string} resolution 来源
    @apiParamExample {json} Request-Example:
    {
        "use_type": 2,
        "manufacturer": "manufacturer",
        "model": "model",
        "platform": "Android",
        "version": "8.0.0",
        "serial": "388ccc30",
        "resolution": "1920x720"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code":0,
        "data":[],
        "message":"ok"
    }
    """
    use_type, manufacturer, model, platform, version, serial, resolution, uuid = parse_json_form(
        'tc_devices')
    code, data = TcDevicesBusiness.devices_info(use_type, manufacturer, model,
                                                platform, version, serial,
                                                resolution, uuid)
    return json_detail_render(code, data)
Beispiel #2
0
def disconnect_devices_handler():
    """
    @api {post} /v1/tcdevices/disconnect 断开设备
    @apiName DisconnectDevices
    @apiGroup 云真机
    @apiDescription 断开设备
    @apiParam {int} userid 发送者
    @apiParam {string} serial Android设备序列号
    @apiParamExample {json} Request-Example:
    {
        "userid": 2,
        "serial": "Y2J5T17410004213"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code":0,
        "data":[],
        "message":"ok"
    }
    """
    userid, serial = parse_json_form('disconnect_devices')
    data = TcDevicesBusiness.disconnect_devices(serial)
    return json_detail_render(0, data)