|
@@ -2,7 +2,6 @@
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Share.Dtos.Menu;
|
|
|
using Hotline.Share.Requests;
|
|
|
-using Identity.Admin.HttpClient;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
@@ -16,7 +15,6 @@ namespace Hotline.Api.Controllers
|
|
|
/// </summary>
|
|
|
public class SysController : BaseController
|
|
|
{
|
|
|
- private readonly IIdentityClient _identityClient;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly ISystemSettingRepository _systemSettingsRepository;
|
|
|
private readonly ISystemSettingGroupRepository _systemSettingGroupRepository;
|
|
@@ -26,21 +24,18 @@ namespace Hotline.Api.Controllers
|
|
|
/// <summary>
|
|
|
/// 系统管理相关接口
|
|
|
/// </summary>
|
|
|
- /// <param name="identityClient"></param>
|
|
|
/// <param name="mapper"></param>
|
|
|
/// <param name="systemSettingsRepository"></param>
|
|
|
/// <param name="systemSettingGroupRepository"></param>
|
|
|
/// <param name="systemMenuRepository"></param>
|
|
|
/// <param name="systemButtonRepository"></param>
|
|
|
public SysController(
|
|
|
- IIdentityClient identityClient,
|
|
|
IMapper mapper,
|
|
|
ISystemSettingRepository systemSettingsRepository,
|
|
|
ISystemSettingGroupRepository systemSettingGroupRepository,
|
|
|
ISystemMenuRepository systemMenuRepository,
|
|
|
ISystemButtonRepository systemButtonRepository)
|
|
|
{
|
|
|
- _identityClient = identityClient;
|
|
|
_mapper = mapper;
|
|
|
_systemSettingsRepository = systemSettingsRepository;
|
|
|
_systemSettingGroupRepository = systemSettingGroupRepository;
|
|
@@ -48,25 +43,6 @@ namespace Hotline.Api.Controllers
|
|
|
_systemButtonRepository = systemButtonRepository;
|
|
|
}
|
|
|
|
|
|
- #region private
|
|
|
-
|
|
|
- private async Task<bool> IsAccountLock(string userId)
|
|
|
- {
|
|
|
- var response = await _identityClient.IsAccountLockAsync(userId, HttpContext.RequestAborted);
|
|
|
- if (response is null || !response.IsSuccess)
|
|
|
- throw new UserFriendlyException("identity service request fail: IsAccountLockAsync");
|
|
|
- return response.Result;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private void CheckHttpRequestSuccess(ApiResponse response, string msg)
|
|
|
- {
|
|
|
- if (response == null || !response.IsSuccess)
|
|
|
- throw new UserFriendlyException($"identity service request failed: {msg}");
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
#region 系统参数
|
|
|
|
|
|
/// <summary>
|