// Path: examples/oauth2/src/main/java/com/github/hippoom/wechat/mp/examples/oauth2/http/assembler/WeChatUserProfileResourceAssembler.java
// @Component
// public class WeChatUserProfileResourceAssembler extends
//     ResourceAssemblerSupport<WxMpUser, WeChatUserProfileResource> {
// 
// 
//     public WeChatUserProfileResourceAssembler() {
//         super(WeChatUserRestController.class, WeChatUserProfileResource.class);
//     }
// 
//     @Override
//     public WeChatUserProfileResource toResource(WxMpUser entity) {
//         WeChatUserProfileResource resource = new WeChatUserProfileResource();
//         resource.setAvatar(entity.getHeadImgUrl());
//         resource.setNickname(entity.getNickname());
//         resource
//             .add(
//                 linkTo(methodOn(WeChatUserRestController.class)
//                     .me(OpenId.valueOf(entity.getOpenId()))).withSelfRel());
//         return resource;
//     }
// }
// 
// Path: examples/oauth2/src/main/java/com/github/hippoom/wechat/mp/examples/oauth2/http/resource/WeChatUserProfileResource.java
// @Data
// @EqualsAndHashCode(callSuper = false)
// public class WeChatUserProfileResource extends ResourceSupport {
// 
//     private String nickname;
//     private String avatar;
// }
// 
// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/oauth/OpenId.java
// @Value
// public class OpenId {
// 
//     private String value;
// 
//     private OpenId(String value) {
//         this.value = value;
//     }
// 
//     public static OpenId valueOf(String value) {
//         return new OpenId(value);
//     }
// }


import static org.springframework.web.bind.annotation.RequestMethod.GET;
import com.github.hippoom.wechat.mp.examples.oauth2.http.assembler.WeChatUserProfileResourceAssembler;
import com.github.hippoom.wechat.mp.examples.oauth2.http.resource.WeChatUserProfileResource;
import com.github.hippoom.wechat.mp.web.bind.annotation.CurrentWeChatMpUser;
import com.github.hippoom.wechat.oauth.OpenId;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpUserService;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
package com.github.hippoom.wechat.mp.examples.oauth2.http;



@Slf4j
@RestController
@RequiredArgsConstructor
public class WeChatUserRestController {

    @NonNull
// Path: examples/oauth2/src/main/java/com/github/hippoom/wechat/mp/examples/oauth2/http/assembler/WeChatUserProfileResourceAssembler.java
// @Component
// public class WeChatUserProfileResourceAssembler extends
//     ResourceAssemblerSupport<WxMpUser, WeChatUserProfileResource> {
// 
// 
//     public WeChatUserProfileResourceAssembler() {
//         super(WeChatUserRestController.class, WeChatUserProfileResource.class);
//     }
// 
//     @Override
//     public WeChatUserProfileResource toResource(WxMpUser entity) {
//         WeChatUserProfileResource resource = new WeChatUserProfileResource();
//         resource.setAvatar(entity.getHeadImgUrl());
//         resource.setNickname(entity.getNickname());
//         resource
//             .add(
//                 linkTo(methodOn(WeChatUserRestController.class)
//                     .me(OpenId.valueOf(entity.getOpenId()))).withSelfRel());
//         return resource;
//     }
// }
// 
// Path: examples/oauth2/src/main/java/com/github/hippoom/wechat/mp/examples/oauth2/http/resource/WeChatUserProfileResource.java
// @Data
// @EqualsAndHashCode(callSuper = false)
// public class WeChatUserProfileResource extends ResourceSupport {
// 
//     private String nickname;
//     private String avatar;
// }
// 
// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/oauth/OpenId.java
// @Value
// public class OpenId {
// 
//     private String value;
// 
//     private OpenId(String value) {
//         this.value = value;
//     }
// 
//     public static OpenId valueOf(String value) {
//         return new OpenId(value);
//     }
// }


// Path: examples/oauth2/src/main/java/com/github/hippoom/wechat/mp/examples/oauth2/http/WeChatUserRestController.java
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import com.github.hippoom.wechat.mp.examples.oauth2.http.assembler.WeChatUserProfileResourceAssembler;
import com.github.hippoom.wechat.mp.examples.oauth2.http.resource.WeChatUserProfileResource;
import com.github.hippoom.wechat.mp.web.bind.annotation.CurrentWeChatMpUser;
import com.github.hippoom.wechat.oauth.OpenId;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpUserService;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

package com.github.hippoom.wechat.mp.examples.oauth2.http;



@Slf4j
@RestController
@RequiredArgsConstructor
public class WeChatUserRestController {

    @NonNull
    private final WeChatUserProfileResourceAssembler userResourceAssembler;