コード例 #1
0
ファイル: wejudge.py プロジェクト: DICKQI/WeJudge-2-Dev
def space(request, aid):
    """
    WeJudge 个人中心
    :param request:
    :param aid:
    :return:
    """

    wejudge_session = WeJudgeSession(request)               # 创建会话
    response = WeJudgeResponse(wejudge_session)             # 创建响应

    manager = AccountSpaceLib.WeJudgeAccountSpace(request, response, aid)
    account_info = manager.get_account_info()

    response.set_navlist([
        const.apps.ACCOUNT,
        [manager.account.nickname, 'account.space', (manager.account.id, )],
        ['个人中心']
    ])

    return response.render_page(request, 'account/space/wejudge.tpl', {
        'account_info': account_info,
        'account': manager.account,
        'hide_breadcrumb': True
    })
コード例 #2
0
ファイル: wejudge.py プロジェクト: DICKQI/WeJudge-2-Dev
def save_account_avatar(request, aid):
    """
    保存用户头像
    :param request:
    :param aid: 账户ID
    :return:
    """

    wejudge_session = WeJudgeSession(request)   # 创建会话
    response = WeJudgeResponse(wejudge_session)     # 创建响应

    manager = AccountSpaceLib.WeJudgeAccountSpace(request, response, aid)
    result = manager.save_account_avatar()

    return response.json(WeJudgeResult(result))
コード例 #3
0
ファイル: wejudge.py プロジェクト: DICKQI/WeJudge-2-Dev
def get_user_problem_solutions(request, aid):
    """
    读取用户的做题信息
    :param request:
    :param aid: 账户ID
    :return:
    """

    wejudge_session = WeJudgeSession(request)   # 创建会话
    response = WeJudgeResponse(wejudge_session)     # 创建响应

    manager = AccountSpaceLib.WeJudgeAccountSpace(request, response, aid)
    result = manager.get_user_problem_solutions()

    return response.json(WeJudgeResult(result))
コード例 #4
0
ファイル: wejudge.py プロジェクト: DICKQI/WeJudge-2-Dev
def account_info(request, aid):
    """
    个人信息获取
    :param request:
    :param aid: 账户ID
    :return:
    """

    wejudge_session = WeJudgeSession(request)   # 创建会话
    response = WeJudgeResponse(wejudge_session)     # 创建响应

    manager = AccountSpaceLib.WeJudgeAccountSpace(request, response, aid)
    result = manager.get_account_info()

    return response.json(WeJudgeResult(result))