Search in sources :

Example 16 with R

use of com.github.liuweijw.commons.base.R in project fw-cloud-framework by liuweijw.

the class WxAuthorizeController method refreshToken.

@RequestMapping(value = "/refreshToken", method = RequestMethod.GET)
public R<WxMpOAuth2AccessToken> refreshToken(HttpServletRequest request, @RequestParam("refreshToken") String refreshToken) {
    if (StringHelper.isBlank(refreshToken))
        return new R<WxMpOAuth2AccessToken>().failure("请求参数[refreshToken]不存在!");
    log.info("【wxauth】:refreshToken|" + refreshToken);
    WxMpOAuth2AccessToken wxMpOAuth2AccessToken;
    try {
        wxMpOAuth2AccessToken = wxService.oauth2refreshAccessToken(refreshToken);
        return new R<WxMpOAuth2AccessToken>().data(wxMpOAuth2AccessToken).success();
    } catch (WxErrorException e) {
        e.printStackTrace();
    }
    return new R<WxMpOAuth2AccessToken>().failure("微信refreshToken刷新失败!");
}
Also used : WxMpOAuth2AccessToken(me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken) R(com.github.liuweijw.commons.base.R) WxErrorException(me.chanjar.weixin.common.error.WxErrorException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

R (com.github.liuweijw.commons.base.R)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)10 PrePermissions (com.github.liuweijw.business.commons.web.aop.PrePermissions)8 Date (java.util.Date)6 JSONObject (com.alibaba.fastjson.JSONObject)5 ApiImplicitParam (io.swagger.annotations.ApiImplicitParam)4 ApiOperation (io.swagger.annotations.ApiOperation)4 Map (java.util.Map)4 HashMap (java.util.HashMap)3 WxPayConfig (com.github.binarywang.wxpay.config.WxPayConfig)2 WxPayException (com.github.binarywang.wxpay.exception.WxPayException)2 WxPayService (com.github.binarywang.wxpay.service.WxPayService)2 WxPayServiceImpl (com.github.binarywang.wxpay.service.impl.WxPayServiceImpl)2 Dept (com.github.liuweijw.business.admin.domain.Dept)2 Menu (com.github.liuweijw.business.admin.domain.Menu)2 Role (com.github.liuweijw.business.admin.domain.Role)2 PayChannel (com.github.liuweijw.business.pay.domain.PayChannel)2 PayMchInfo (com.github.liuweijw.business.pay.domain.PayMchInfo)2 AlipayClient (com.alipay.api.AlipayClient)1 DefaultAlipayClient (com.alipay.api.DefaultAlipayClient)1