FeignService.java 797 Bytes
package com.tanpu.community.service;

import com.tanpu.common.api.CommonResp;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp;
import com.tanpu.community.feign.fatools.FeignClientForFatools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeignService {

    @Autowired
    private FeignClientForFatools fatools;

    public UserInfoResp getUserInfoById(String userId) {
        CommonResp<UserInfoResp> userInfoNewCommonResp = fatools.queryUsersListNew(userId);
        if (userInfoNewCommonResp.isNotSuccess()) {
            throw new BizException("内部接口调用失败");
        }
        return userInfoNewCommonResp.getData();
    }
}