Ejemplo n.º 1
0
def getInterfeceListData(request):
    #根据任务执行结果
    id = request.GET.get("id")
    taskDataModel = HTTP_task_executeService.findTaskRestltForId(id)
    taskData = dbModelToDict(taskDataModel)
    if taskDataModel.version == "CurrentVersion":
        getInterFaceDataSql = taskData["taskInterfaces"].replace(
            ",",
            "' union all select thi.id,thi.interfaceId,thi.title,thi.casedesc,thi.url,thi.addBy,tu.userName from tb_http_interface thi  LEFT JOIN tb_user tu on thi.addBy = tu .loginName  where interfaceId = '"
        )
        sql = "select thi.id,thi.interfaceId,thi.title,thi.casedesc,thi.url,thi.addBy,tu.userName from tb_http_interface thi  LEFT JOIN tb_user tu on thi.addBy = tu .loginName  where interfaceId = '%s'" % getInterFaceDataSql
    else:
        getInterFaceDataSql = taskData["taskInterfaces"].replace(
            ",",
            "' union all select thi.id,thi.interfaceId,thi.title,thi.casedesc,thi.url,thi.addBy,tu.userName from tb_version_http_interface thi  LEFT JOIN tb_user tu on thi.addBy = tu .loginName  where interfaceId = '"
        )
        sql = "select thi.id,thi.interfaceId,thi.title,thi.casedesc,thi.url,thi.addBy,tu.userName from tb_version_http_interface thi  LEFT JOIN tb_user tu on thi.addBy = tu .loginName  where interfaceId = '%s' and versionName='%s'" % (
            getInterFaceDataSql, taskDataModel.version)

    taskInterfaceListData = executeSqlGetDict(sql)
    response = render(
        request,
        "InterfaceTest/HTTPTask/SubPages/HTTP_Task_Details_Select_interface_list_check_page.html",
        {"pageDatas": taskInterfaceListData})
    return response
Ejemplo n.º 2
0
def getTaskRestltDetail(request):
    id = request.GET.get("id")
    taskExecDataModel = HTTP_task_executeService.findTaskRestltForId(id)
    taskExecData = dbModelToDict(taskExecDataModel)
    taskExecData.update(dbModelToDict(taskExecDataModel.httpConfKey))
    taskExecData.update(dbModelToDict(taskExecDataModel.addBy))
    return HttpResponse(
        ApiReturn(ApiReturn.CODE_OK, body=json.dumps(taskExecData)).toJson())