• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python public.success_result_http函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中public.success_result_http函数的典型用法代码示例。如果您正苦于以下问题:Python success_result_http函数的具体用法?Python success_result_http怎么用?Python success_result_http使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了success_result_http函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: jenkins_info

def jenkins_info(request):
    """
    :author: yechengzhou
    :param request:
    :return:
    """
    if request.method != "GET":
        return  public.fail_result_http(u'该接口只支持GET')
    if 'name' in request.REQUEST:
        if 'job' in request.REQUEST:
            logging.debug('')
            job = utils.JenkinsInfo(name=request.REQUEST['name'], job=request.REQUEST['job'])
            if job.get_status():
                return public.success_result_http(json.dumps(job.get_ret()))
            else:
                return public.fail_result_http(u'get jenkins info failed')
        else:
            view = utils.JenkinsInfo(name=request.REQUEST['name'])
            if view.get_status():
                return public.success_result_http(json.dumps(view.get_ret()))
            else:
                return public.fail_result_http(u'get jenkins info failed')

    else:
        return public.fail_result_http(u"wrong argument")
开发者ID:ghmjava,项目名称:web_site,代码行数:25,代码来源:views.py


示例2: get_seal_version

def get_seal_version(request):
    module = request.GET.get('module')
    if module == 'biz':
        return public.success_result_http(data_utils.get_seal_or_newlab_version('biz'))
    elif module == "shanghaife":
        return public.success_result_http(data_utils.get_seal_or_newlab_version('shanghaife'))
    else:
        return public.success_result_http({'biz': data_utils.get_seal_or_newlab_version('biz'), "shanghaife": data_utils.get_seal_or_newlab_version('biz')})
开发者ID:ghmjava,项目名称:web_site,代码行数:8,代码来源:views.py


示例3: set_algo_view

def set_algo_view(request):
    if request.method != "POST":
        return public.fail_result_http(u"POST only")

    data = json.loads(request.body)
    x = data.get("x")
    y = data.get("y")
    module = data.get("module_id")
    scene = data.get("scene_id")
    resource_name = data.get("resource")
    if len(utils.get_resource_by_name(resource_name)):
        resource_id = utils.get_resource_by_name(resource_name).get('id')
    else:
        print 'get resource id failed'

    record_id = data.get("id")
    if not (x and y and module and scene):
        return public.fail_result_http(u"module, scence, X, Y should not be NONE")

    ret = algo.set_algo_info(module, scene , resource_name, x, y)

    # save formula info
    tmp = {}
    tmp['a'] = ret.get('a')
    tmp['b'] = ret.get('b')

    this_formula = {}
    this_formula['resource_id'] = resource_id if resource_id else 0
    this_formula['record_id'] = record_id
    this_formula['formula'] = json.dumps(tmp)
    utils.save_formula(this_formula)

    if type(ret) == type(""):
        return public.fail_result_http(ret)
    return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:35,代码来源:view_algo.py


示例4: get_branch_svn_log

def get_branch_svn_log(request):
    """
    :author: yechengzhou
    :param request: request should contains branch name and module name
    :return: json format branch svn log
    """
    if request.method != "GET":
        return public.fail_result_http(u"该接口只支持GET")
    else:

        module = request.GET.get('module')
        branch = request.GET.get('branch')
        type = request.GET.get('type') # 0 -- one day  1 -- last 10

        if not (module and branch):
            return public.fail_result_http(u"参数错误")

        else:
            if type == '0' or type == None:
                if branch != "trunk":
                    start = branch.split('_')[-2]
                    start_time = public.str2datetime(start, "%Y%m%d")
                    end_time = start_time + datetime.timedelta(days=1)
                    end = public.datetime2str(end_time, "%Y%m%d")
                    ret = utils.get_branch_svn_log(module,branch, start, end)
                else:
                    ret = utils.get_branch_svn_log(module,branch)


            elif type == '1':
                ret = utils.get_branch_svn_log(module,branch )


            return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:34,代码来源:views.py


示例5: static_dashboard_view

def static_dashboard_view(request):
    env = request.GET.get("env")
    if env.upper() == public.ENV_MOB:
        ret = utils.static_mob()
    else:
        ret = utils.static_newlab()
    return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:7,代码来源:views.py


示例6: filter_api_view

def filter_api_view(request):
    q = request.GET.get("q")
    data = utils.filter_api(q)
    if data:
        return public.success_result_http(data)
    else:
        return public.fail_result_http(data)
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:7,代码来源:views.py


示例7: update_api_mob_version_view

def update_api_mob_version_view(request):
    if request.method == "POST":
        data = json.loads(request.body)
        ret = utils.update_api_mob_version(data)
        return public.success_result_http(ret)
    else:
        return public.fail_result_http("Only Post!")
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:7,代码来源:views.py


示例8: copy_api_view

def copy_api_view(request):
    data = {}
    pk = request.GET.get("id")
    user = request.session.get("django_mail")
    flag = request.GET.get("flag")
    ret = utils.copy_api(pk, user, flag)
    return public.success_result_http(ret)
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:7,代码来源:views.py


示例9: get_sealed_or_newlab_version

def get_sealed_or_newlab_version(request):
    # 获取封板号 封板号没有就返回newlab版本
    if request.method != "GET":
        return public.fail_result_http(u"Only support GET")
    else:
        ret = utils.get_seal_or_newlab_version(request.REQUEST.get("module"))
        return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:7,代码来源:views.py


示例10: get_build_status

def get_build_status(request):
    if request.method != "GET":
        return public.fail_result_http(u"do not accept get method")
    else:
        job_name = request.REQUEST.get('name')
        view = request.REQUEST.get('view')


        # build = request.REQUEST.get('build')

        # 目前只有newlab
        if job_name and job_name != 'undefined' and not job_name.startswith("newlabs"):
            job_name = "newlabs_" + job_name
        else:
            return public.fail_result_http('get job name failed')

        view = "agile"
        JB = utils.JenkinsInfo(view, job_name)
        build = JB.get_ret()['builds'][0]['number']

        JI = utils.JenkinsInfo(view, job_name, str(build))
        if JI.get_status():
            if_building = JI.get_ret()['building']
            if JI.get_ret()['result']:
                job_status = JI.get_ret()['result'].lower()
            else:
                job_status = 'fail'
            return public.success_result_http({"status":job_status, 'building': if_building})
        else:
            logging.error("Get Job Info Failed:" + str(request))
            return public.fail_result_http('get job info failed')
开发者ID:ghmjava,项目名称:web_site,代码行数:31,代码来源:views.py


示例11: save_single_api_record

def save_single_api_record(request):
    id = utils.save_api_record(json.loads(request.body))
    public_info = utils.get_public(request)
    if public_info.get('auth').get('write') != 1:
        return public.fail_result_http('have no write right')
    else:
        return public.success_result_http({'id': id})
开发者ID:ghmjava,项目名称:web_site,代码行数:7,代码来源:view_algo.py


示例12: bind_job_view

def bind_job_view(request):
    if request.method != "POST":
        return public.fail_result_http(u"Only support POST!")
    else:
        data = json.loads(request.body)
        ret = utils.bind_job(data)
        return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:7,代码来源:views.py


示例13: interface_show_api_view

def interface_show_api_view(request):
    data = data_utils.get_api(request.GET.get("id"))
    urlHost = data_utils.get_url_host_list()
    url_id = data.get("url")
    for url in urlHost:
        if url_id == url.get("id"):
            data["url"] = url.get("host")
    return public.success_result_http(data)
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:8,代码来源:views.py


示例14: bind_api_tag_view

def bind_api_tag_view(request):
    if request.method == "POST":
        data = json.loads(request.body)
        data["user"] = public.get_user_mail(request)
        utils.bind_api_tag(data)
        return public.success_result_http()
    else:
        return public.fail_result_http("Only Post!")
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:8,代码来源:views.py


示例15: set_auth_view

def set_auth_view(request):
    if request.method != "POST":
        return public.fail_result_http(u"Only support POST!")
    else:
        ret = utils.set_auth(request)
        if ret:
            return public.fail_result_http(ret)
        return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:8,代码来源:views.py


示例16: save_svn_history_view

def save_svn_history_view(request):
    logger.debug(request)

    if request.method == "POST":
        data = json.loads(request.body)
        utils.save_svn_history(data)
    else:
        return public.fail_result_http(u"该接口只支持POST数据")
    return public.success_result_http()
开发者ID:ghmjava,项目名称:web_site,代码行数:9,代码来源:views.py


示例17: rm_group_view

def rm_group_view(request):
    if request.method != "POST":
        return public.fail_result_http(u"Only support POST!")
    else:
        body = json.loads(request.body)
        ret = utils.rm_group(body.get("id"))
        if ret != True:
            return public.fail_result_http(ret)
        return public.success_result_http(ret)
开发者ID:ghmjava,项目名称:web_site,代码行数:9,代码来源:views.py


示例18: edit_url_host_view

def edit_url_host_view(request):
    if request.method == "POST":
        ret = data_utils.edit_host(request)
        return public.success_result_http(ret)
    else:
        data = {}
        id = request.GET.get("id")
        data["host"] = data_utils.get_url_host_dict(id)
        return render(request, 'edit_host.html', {"data": data})
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:9,代码来源:views.py


示例19: save_data_structure_view

def save_data_structure_view(request):
    if request.method == "POST":
        ret = data_utils.save_data_structure(request)
        return public.success_result_http(ret)
    else:
        data = {}
        data["structure"] = data_utils.get_data_structure()
        data["current"] = data_utils.get_structure_dict(request.GET.get("id"))
        return render(request, 'edit_structure.html', {"data": data})
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:9,代码来源:views.py


示例20: set_next_job_view

def set_next_job_view(request):
    if request.method == "POST":
        data = json.loads(request.body)
        ret = utils.set_next_job(data)
        if ret:
            return public.fail_result_http(ret)
        return public.success_result_http()
    else:
        return public.fail_result_http("POST Only!")
开发者ID:ghmjava,项目名称:web_site,代码行数:9,代码来源:views.py



注:本文中的public.success_result_http函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python public.writeFile函数代码示例发布时间:2022-05-25
下一篇:
Python public.returnMsg函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap