|
@@ -5,6 +5,7 @@ using GxPress.Repository.Interface;
|
|
|
using GxPress.Request.AddressBookGroup;
|
|
|
using GxPress.Result.AddressBook;
|
|
|
using GxPress.Result.AddressBookGroup;
|
|
|
+using GxPress.Service.Interface.AddressBookGroup;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.Extensions.Logging;
|
|
@@ -22,12 +23,14 @@ namespace GxPress.Api.AppControllers
|
|
|
private readonly ILogger<AddressBookGroupController> _logger;
|
|
|
private readonly IAddressBookGroupRepository _addressBookGroupRepository;
|
|
|
private readonly ILoginContext _loginContext;
|
|
|
+ private readonly IAddressBookGroupService addressBookGroupService;
|
|
|
|
|
|
- public WebAddressBookGroupController(ILogger<AddressBookGroupController> logger, IAddressBookGroupRepository addressBookGroupRepository, ILoginContext loginContext)
|
|
|
+ public WebAddressBookGroupController(ILogger<AddressBookGroupController> logger, IAddressBookGroupRepository addressBookGroupRepository, ILoginContext loginContext,IAddressBookGroupService addressBookGroupService)
|
|
|
{
|
|
|
_logger = logger;
|
|
|
_addressBookGroupRepository = addressBookGroupRepository;
|
|
|
_loginContext = loginContext;
|
|
|
+ this.addressBookGroupService=addressBookGroupService;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -69,10 +72,10 @@ namespace GxPress.Api.AppControllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("add")]
|
|
|
- public async Task<Entity.AddressBookGroup> Insert(AddressBookGroupInRequest request)
|
|
|
+ public async Task<bool> Insert(AddressBookGroupInRequest request)
|
|
|
{
|
|
|
request.UserId = _loginContext.AccountId;
|
|
|
- return await _addressBookGroupRepository.InsertAsync(request);
|
|
|
+ return await addressBookGroupService.InsertAsync(request);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取用户通讯录组
|