Пример #1
0
def getPlayerInfoByUser(data):
    _ret = {}
    userInfoRet = getUserInfo(data)
    if userInfoRet['status'] == 'failed':
        return userInfoRet
    serverInfoRet = getServerInfo({'server_id':userInfoRet['result']['server_id']})
    if serverInfoRet['status'] == 'failed':
        return serverInfoRet
    matchCountRet = getMatchCountByUser(data)
    if matchCountRet['status'] == 'failed':
        return matchCountRet
    _ret['status'] = 'ok'
    _ret['msg'] = ''
    _ret['result'] = userInfoRet['result']
    _ret['result']['server_info']= serverInfoRet['result']
    _ret['result']['match_count'] = matchCountRet['result']['match_count']
    _ret['result']['win_rate'] = matchCountRet['result']['win_rate']
    return _ret
Пример #2
0
def getServer(request):
    if request.method == 'GET':
        _ret = getServerInfo(request.GET)
        return process_ret_status(_ret)
    return json_response(failed_response("操作不支持"))