# -*- coding: utf-8 -*- from doclink import Consumer from ..endpoints import api as endpoints from .. import utils consumer = Consumer(endpoints.base_uri, expected_status_code=200) consumer.resp_hook(utils.preprocess_resp) @consumer.get(endpoints.media_info) def media_info(resp): """Get media basic info from Penguin. Args: access_token (str): access_token. openid (str): openid. Returns: dict: the header image, the nick name. For example: { "header": "http://inews.gtimg.com/newsapp_ls/0/183849551_100100/0", "nick": "测试" } <meta> args: query: - access_token - openid: required: False
# -*- coding: utf-8 -*- # # Project: payunion # Author: Luo Yufu # # Copyright (c) 2018 麦禾互动. All rights reserved. from doclink import Consumer from . import utils auth_consumer = Consumer('https://api.weixin.qq.com/sns/') auth_consumer.resp_hook(utils.json_hook) @auth_consumer.get('jscode2session') def jscode2session(resp): """ <meta> args: query: - appid - secret - js_code - grant_type: authorization_code expected_status_code: 200 </meta> """ return resp.json