RemoteApiUserService.java
977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cn.com.glsx.stdinterface.modules.remote;
import cn.com.glsx.usercenter.api.dto.response.TenantDto;
import cn.com.glsx.usercenter.api.feign.ApiUserService;
import cn.hutool.json.JSONUtil;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 调用usercenter 用户服务
*
* @author Yanglinlong
* @date 2023/6/19 16:29
*/
@Slf4j
@Service
public class RemoteApiUserService {
@Autowired
private ApiUserService apiUserService;
/**
* 通过 userId 获取租户数据
*
* @param userId 用户ID
* @return
*/
public TenantDto getTenantByUserId(Long userId) {
R<TenantDto> tenantR = apiUserService.getTenantByUserId(userId);
TenantDto tenantDto = tenantR.getData(TenantDto.class);
log.info("tenantDto==" + JSONUtil.toJsonStr(tenantDto));
return tenantDto;
}
}