|
@@ -3,15 +3,18 @@ using Hotline.CallCenter.BlackLists;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
using Hotline.CallCenter.Ivrs;
|
|
|
using Hotline.CallCenter.Tels;
|
|
|
+using Hotline.Configurations;
|
|
|
using Hotline.KnowledgeBase;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Repository.SqlSugar;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Share.Dtos.Home;
|
|
|
+using Hotline.Share.Dtos.Identity;
|
|
|
using Hotline.Users;
|
|
|
using MapsterMapper;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
using SqlSugar;
|
|
|
using StackExchange.Redis;
|
|
|
using XF.Domain.Authentications;
|
|
@@ -34,6 +37,7 @@ public class HomeController : BaseController
|
|
|
private readonly IRepository<UserFastMenu> _userFastMenuRepository;
|
|
|
private readonly IRepository<User> _userRepository;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
+ private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
|
|
|
public HomeController(
|
|
|
ISugarUnitOfWork<HotlineDbContext> uow,
|
|
@@ -43,7 +47,8 @@ public class HomeController : BaseController
|
|
|
IMapper mapper,
|
|
|
IRepository<UserFastMenu> userFastMenuRepository,
|
|
|
IRepository<User> userRepository,
|
|
|
- ISystemSettingCacheManager systemSettingCacheManager)
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions)
|
|
|
{
|
|
|
_uow = uow;
|
|
|
_sessionContext = sessionContext;
|
|
@@ -53,6 +58,7 @@ public class HomeController : BaseController
|
|
|
_userFastMenuRepository = userFastMenuRepository;
|
|
|
_userRepository = userRepository;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
+ _appOptions = appOptions;
|
|
|
}
|
|
|
|
|
|
#region 开放请求接口
|
|
@@ -170,10 +176,25 @@ public class HomeController : BaseController
|
|
|
/// IsNeedTelNo : 是否需要分机
|
|
|
/// IsTelNeedVerify : 分机是否需要验证
|
|
|
/// </returns>
|
|
|
- [AllowAnonymous]
|
|
|
[HttpGet("home-page-info")]
|
|
|
public async Task<object> HomePageInfo()
|
|
|
{
|
|
|
+ double[] locationCenter = new double[2];
|
|
|
+ try
|
|
|
+ {
|
|
|
+ locationCenter = _systemSettingCacheManager
|
|
|
+ .GetSetting(SettingConstants.LocationCenter)
|
|
|
+ .SettingValue?
|
|
|
+ .FirstOrDefault()
|
|
|
+ .Split(',')
|
|
|
+ .Select(double.Parse)
|
|
|
+ .ToArray();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ // ignore
|
|
|
+ }
|
|
|
+
|
|
|
var rsp = new
|
|
|
{
|
|
|
IsRestApproval = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsRestApproval).SettingValue[0]),
|
|
@@ -196,11 +217,18 @@ public class HomeController : BaseController
|
|
|
Snapshot = _systemSettingCacheManager.Snapshot,
|
|
|
IsTelRest = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsTelRest).SettingValue[0]),
|
|
|
TelRestNum = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.TelRestNum).SettingValue[0]),
|
|
|
- IsOpenSpecialPhone = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsOpenSpecialPhone).SettingValue[0])
|
|
|
+ IsOpenSpecialPhone = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsOpenSpecialPhone).SettingValue[0]),
|
|
|
+ CallCenterType = _appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType,
|
|
|
+ CallCenterSocketUrl = _systemSettingCacheManager.GetSetting(SettingConstants.CallCenterSocketUrl).SettingValue?.FirstOrDefault(),
|
|
|
+ RecordPrefix = _systemSettingCacheManager.GetSetting(SettingConstants.RecordPrefix).SettingValue?.FirstOrDefault(),
|
|
|
+ RecordDownLoadPrefix = _systemSettingCacheManager.GetSetting(SettingConstants.RecordDownLoadPrefix).SettingValue?.FirstOrDefault(),
|
|
|
+ Luzhouhcp = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.LuZhouHaoChaPing).SettingValue[0]),
|
|
|
+ LocationCenter = locationCenter,
|
|
|
};
|
|
|
return rsp;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 菜单权限
|