|
@@ -2,7 +2,9 @@
|
|
|
using Hotline.CallCenter.Manage;
|
|
|
using Hotline.Permissions;
|
|
|
using Hotline.Settings;
|
|
|
+using Hotline.Settings.TimeLimits;
|
|
|
using Hotline.Share.Requests;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using XF.Domain.Exceptions;
|
|
|
|
|
@@ -17,14 +19,15 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly ISystemSettingRepository _systemSettingsRepository;
|
|
|
private readonly ISystemSettingGroupRepository _systemSettingGroupRepository;
|
|
|
private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
-
|
|
|
+ private readonly IDaySettingRepository _daysettingRepository;
|
|
|
|
|
|
- public SettingController(IVoiceFileDomainService voiceFileDomainService, ISystemSettingRepository systemSettingsRepository, ISystemSettingGroupRepository systemSettingGroupRepository,ISystemSettingCacheManager systemSettingCacheManager)
|
|
|
+ public SettingController(IVoiceFileDomainService voiceFileDomainService, ISystemSettingRepository systemSettingsRepository, ISystemSettingGroupRepository systemSettingGroupRepository,ISystemSettingCacheManager systemSettingCacheManager,IDaySettingRepository daySettingRepository)
|
|
|
{
|
|
|
_voiceFileDomainService = voiceFileDomainService;
|
|
|
_systemSettingsRepository = systemSettingsRepository;
|
|
|
_systemSettingGroupRepository = systemSettingGroupRepository;
|
|
|
_systemSettingCacheManager = systemSettingCacheManager;
|
|
|
+ _daysettingRepository = daySettingRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -93,7 +96,39 @@ namespace Hotline.Api.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
|
|
|
+ #region 日期类型设置
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取月份的日期设置
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="month"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.DaySetings)]
|
|
|
+ [HttpGet("getdaysettings-month/{month}")]
|
|
|
+ public async Task<List<DaySetting>> GetDaySettingsByMonth(int month)
|
|
|
+ {
|
|
|
+ return await _daysettingRepository.GetDaySettingsByMonth(month);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 设置日期
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.SetDaySetting)]
|
|
|
+ [HttpPost("setdaysettings")]
|
|
|
+ public async Task SetDaySettings([FromBody]SetDaySettingsRequest request)
|
|
|
+ {
|
|
|
+ List<DaySetting> daysettings = new List<DaySetting>();
|
|
|
+ foreach (var item in request.list)
|
|
|
+ {
|
|
|
+ daysettings.Add(new DaySetting() { Day = item, IsWorkDay = request.isWorkDay });
|
|
|
+ }
|
|
|
+
|
|
|
+ await _daysettingRepository.AddRangeAsync(daysettings);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|