package com.starry.admin.modules.weichat.service;

import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.stereotype.Service;

/**
 * 微信公众号开发
 *
 * @author admin
 */
@Slf4j
@Service
public class WxAccessTokenService {

    @Resource
    private WxCustomMpService wxCustomMpService;

    /**
     * 获取微信AccessToken
     *
     * @return access_token
     */
    public String getAccessToken() throws WxErrorException {
        String token = wxCustomMpService.proxyWxMpService().getAccessToken();
        log.error("token = " + token);
        // 缓存业务处理
        return token;

    }

}
