33 lines
961 B
C#
33 lines
961 B
C#
using System.Threading.Tasks;
|
|
using Microservice.Common.Models;
|
|
|
|
namespace Microservice.Common.Services
|
|
{
|
|
/// <summary>
|
|
/// 用户服务实现类
|
|
/// </summary>
|
|
public class UserService : IUserService
|
|
{
|
|
private readonly IServiceClient _serviceClient;
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="serviceClient">微服务客户端</param>
|
|
public UserService(IServiceClient serviceClient)
|
|
{
|
|
_serviceClient = serviceClient;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取用户配置信息
|
|
/// </summary>
|
|
/// <returns>配置信息模型</returns>
|
|
public async Task<ConfigInfoModel> GetUserInfoAsync()
|
|
{
|
|
// 直接使用硬编码的服务名称和路径,暂时不使用 ServiceRegistry
|
|
return await _serviceClient.GetAsync<ConfigInfoModel>("Mico_Demo2222", "/User/config/info");
|
|
}
|
|
}
|
|
}
|