com.itxiaoer.commons.security.wx.WxUseDetailServiceImpl Maven / Gradle / Ivy
The newest version!
package com.itxiaoer.commons.security.wx;
import com.itxiaoer.commons.core.util.Lists;
import com.itxiaoer.commons.security.JwtUserDetail;
import com.itxiaoer.commons.security.JwtUserDetailService;
import com.itxiaoer.commons.wx.WxAddressService;
import com.itxiaoer.commons.wx.WxLoginService;
import com.itxiaoer.commons.wx.WxProperties;
import com.itxiaoer.commons.wx.WxUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author : liuyk
*/
@Slf4j
@SuppressWarnings({"unused", "WeakerAccess"})
public class WxUseDetailServiceImpl implements JwtUserDetailService, InitializingBean {
@Resource
@Qualifier("wxRestTemplate")
private RestTemplate restTemplate;
@Resource
private WxProperties wxProperties;
@Resource
private WxAddressService wxAddressService;
@Resource
private WxLoginService wxLoginService;
@SuppressWarnings("all")
private WxUserInfo getUserById(Map jsonObject) {
try {
WxUserInfo userInfo = new WxUserInfo();
List