// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/web/method/support/OpenIdHandlerMethodArgumentResolver.java
// public class OpenIdHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
// 
//     @Override
//     public boolean supportsParameter(MethodParameter methodParameter) {
//         return methodParameter.getParameterType().equals(OpenId.class);
//     }
// 
//     @Override
//     public Object resolveArgument(MethodParameter methodParameter,
//         ModelAndViewContainer modelAndViewContainer,
//         NativeWebRequest nativeWebRequest,
//         WebDataBinderFactory webDataBinderFactory) throws Exception {
// 
//         WeChatMpOAuth2AccessTokenAuthentication user = (WeChatMpOAuth2AccessTokenAuthentication)
//             SecurityContextHolder.getContext().getAuthentication();
// 
//         CurrentWeChatMpUser weChatUser = methodParameter
//             .getParameterAnnotation(CurrentWeChatMpUser.class);
//         if (weChatUser == null) {
//             return null;
//         }
// 
//         return user.getPrincipal();
//     }
// }


import com.github.hippoom.wechat.mp.web.method.support.OpenIdHandlerMethodArgumentResolver;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
package com.github.hippoom.wechat.mp.autoconfigure.web;


@Configuration
@RequiredArgsConstructor
public class WeChatMpWebMethodConfiguration extends WebMvcConfigurerAdapter {


    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/web/method/support/OpenIdHandlerMethodArgumentResolver.java
// public class OpenIdHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
// 
//     @Override
//     public boolean supportsParameter(MethodParameter methodParameter) {
//         return methodParameter.getParameterType().equals(OpenId.class);
//     }
// 
//     @Override
//     public Object resolveArgument(MethodParameter methodParameter,
//         ModelAndViewContainer modelAndViewContainer,
//         NativeWebRequest nativeWebRequest,
//         WebDataBinderFactory webDataBinderFactory) throws Exception {
// 
//         WeChatMpOAuth2AccessTokenAuthentication user = (WeChatMpOAuth2AccessTokenAuthentication)
//             SecurityContextHolder.getContext().getAuthentication();
// 
//         CurrentWeChatMpUser weChatUser = methodParameter
//             .getParameterAnnotation(CurrentWeChatMpUser.class);
//         if (weChatUser == null) {
//             return null;
//         }
// 
//         return user.getPrincipal();
//     }
// }


// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/autoconfigure/web/WeChatMpWebMethodConfiguration.java
import com.github.hippoom.wechat.mp.web.method.support.OpenIdHandlerMethodArgumentResolver;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

package com.github.hippoom.wechat.mp.autoconfigure.web;


@Configuration
@RequiredArgsConstructor
public class WeChatMpWebMethodConfiguration extends WebMvcConfigurerAdapter {


    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new OpenIdHandlerMethodArgumentResolver());