feat 添加客服管理接口
This commit is contained in:
parent
be9073f79f
commit
826b1068c0
21
ARW.Model/Dto/Api/CustomerServices/CustomerServiceApiDto.cs
Normal file
21
ARW.Model/Dto/Api/CustomerServices/CustomerServiceApiDto.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
|
||||
namespace ARW.Model.Dto.Api.CustomerServices
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 客服查询对象Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public class CustomerServiceQueryDtoApi
|
||||
{
|
||||
public string CustomerServiceName { get; set; }
|
||||
public string CustomerServicePhone { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using Org.BouncyCastle.Asn1.Cms;
|
||||
|
||||
namespace ARW.Model.Dto.Business.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服输入对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public class CustomerServiceDto
|
||||
{
|
||||
|
||||
public int CustomerServiceId { get; set; }
|
||||
|
||||
public long CustomerServiceGuid { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "名称不能为空")]
|
||||
public string CustomerServiceName { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "电话不能为空")]
|
||||
public string CustomerServicePhone { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "图片不能为空")]
|
||||
public string CustomerServiceImg { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工作时间-上班时间不能为空")]
|
||||
public string WorkingHoursBeginTime { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "工作时间-下班时间不能为空")]
|
||||
public string WorkingHoursEndTime { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "排序不能为空")]
|
||||
public int CustomerServiceSort { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 客服查询对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public class CustomerServiceQueryDto : PagerInfo
|
||||
{
|
||||
|
||||
public string CustomerServiceName { get; set; }
|
||||
|
||||
public string CustomerServicePhone { get; set; }
|
||||
|
||||
public string ids { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using Org.BouncyCastle.Asn1.Cms;
|
||||
|
||||
namespace ARW.Model.Models.Business.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服,数据实体对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
[SugarTable("tb_customer_service")]
|
||||
public class CustomerService : BusinessBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "customer_service_id")]
|
||||
public int CustomerServiceId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "customer_service_guid")]
|
||||
public long CustomerServiceGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :名称
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "customer_service_name")]
|
||||
public string CustomerServiceName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :电话
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "customer_service_phone")]
|
||||
public string CustomerServicePhone { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :图片
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "customer_service_img")]
|
||||
public string CustomerServiceImg { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-上班时间
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "working_hours_begin_time")]
|
||||
public string WorkingHoursBeginTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-下班时间
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "working_hours_end_time")]
|
||||
public string WorkingHoursEndTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "customer_service_sort")]
|
||||
public int CustomerServiceSort { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
86
ARW.Model/Vo/Api/CustomerServices/CustomerServiceApiVo.cs
Normal file
86
ARW.Model/Vo/Api/CustomerServices/CustomerServiceApiVo.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Api.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服展示对象Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public class CustomerServiceVoApi
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
public int CustomerServiceId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long CustomerServiceGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :名称
|
||||
/// </summary>
|
||||
public string CustomerServiceName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :电话
|
||||
/// </summary>
|
||||
public string CustomerServicePhone { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :图片
|
||||
/// </summary>
|
||||
public string CustomerServiceImg { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-上班时间
|
||||
/// </summary>
|
||||
public string WorkingHoursBeginTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-下班时间
|
||||
/// </summary>
|
||||
public string WorkingHoursEndTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// </summary>
|
||||
public int CustomerServiceSort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 客服详情展示对象Api
|
||||
/// </summary>
|
||||
public class CustomerServiceApiDetailsVo
|
||||
{
|
||||
public int CustomerServiceId { get; set; }
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long CustomerServiceGuid { get; set; }
|
||||
public string CustomerServiceName { get; set; }
|
||||
public string CustomerServicePhone { get; set; }
|
||||
public string CustomerServiceImg { get; set; }
|
||||
public DateTime? WorkingHoursBeginTime { get; set; }
|
||||
public DateTime? WorkingHoursEndTime { get; set; }
|
||||
public int CustomerServiceSort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
68
ARW.Model/Vo/Business/CustomerServices/CustomerServiceVo.cs
Normal file
68
ARW.Model/Vo/Business/CustomerServices/CustomerServiceVo.cs
Normal file
@ -0,0 +1,68 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using Org.BouncyCastle.Asn1.Cms;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Business.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服展示对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public class CustomerServiceVo
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
public int CustomerServiceId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long CustomerServiceGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :名称
|
||||
/// </summary>
|
||||
public string CustomerServiceName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :电话
|
||||
/// </summary>
|
||||
public string CustomerServicePhone { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :图片
|
||||
/// </summary>
|
||||
public string CustomerServiceImg { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-上班时间
|
||||
/// </summary>
|
||||
public string WorkingHoursBeginTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :工作时间-下班时间
|
||||
/// </summary>
|
||||
public string WorkingHoursEndTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// </summary>
|
||||
public int CustomerServiceSort { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Infrastructure.Attribute;
|
||||
using ARW.Repository.System;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
|
||||
namespace ARW.Repository.Business.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服仓储
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class CustomerServiceRepository : BaseRepository<CustomerService>
|
||||
{
|
||||
#region 业务逻辑代码
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Repository;
|
||||
using ARW.Repository.Business.CustomerServices;
|
||||
using ARW.Service.Api.IBusinessService.CustomerServices;
|
||||
using ARW.Model.Dto.Api.CustomerServices;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Api.CustomerServices;
|
||||
|
||||
namespace ARW.Service.Api.BusinessService.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服接口实现类Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(ICustomerServiceServiceApi), ServiceLifetime = LifeTime.Transient)]
|
||||
public class CustomerServiceServiceImplApi : BaseService<CustomerService>, ICustomerServiceServiceApi
|
||||
{
|
||||
private readonly CustomerServiceRepository _CustomerServiceRepository;
|
||||
|
||||
public CustomerServiceServiceImplApi(CustomerServiceRepository CustomerServiceRepository)
|
||||
{
|
||||
this._CustomerServiceRepository = CustomerServiceRepository;
|
||||
}
|
||||
|
||||
#region Api接口代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询客服列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CustomerServiceVoApi>> GetCustomerServiceListApi(CustomerServiceQueryDtoApi parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<CustomerService>();
|
||||
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerServiceName), s => s.CustomerServiceName.Contains(parm.CustomerServiceName));
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerServicePhone), s => s.CustomerServicePhone.Contains(parm.CustomerServicePhone));
|
||||
var query = _CustomerServiceRepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.CustomerServiceSort, OrderByType.Desc)
|
||||
.Select(s => new CustomerServiceVoApi
|
||||
{
|
||||
CustomerServiceId = s.CustomerServiceId,
|
||||
CustomerServiceGuid = s.CustomerServiceGuid,
|
||||
CustomerServiceName = s.CustomerServiceName,
|
||||
CustomerServicePhone = s.CustomerServicePhone,
|
||||
CustomerServiceImg = s.CustomerServiceImg,
|
||||
WorkingHoursBeginTime = s.WorkingHoursBeginTime,
|
||||
WorkingHoursEndTime = s.WorkingHoursEndTime,
|
||||
CustomerServiceSort = s.CustomerServiceSort,
|
||||
});
|
||||
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Model.Dto.Api.CustomerServices;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Api.CustomerServices;
|
||||
|
||||
namespace ARW.Service.Api.IBusinessService.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服接口类Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public interface ICustomerServiceServiceApi : IBaseService<CustomerService>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取客服分页列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CustomerServiceVoApi>> GetCustomerServiceListApi(CustomerServiceQueryDtoApi parm);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using ARW.Model;
|
||||
using ARW.Repository;
|
||||
using ARW.Repository.Business.CustomerServices;
|
||||
using ARW.Service.Business.IBusinessService.CustomerServices;
|
||||
using ARW.Model.Dto.Business.CustomerServices;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Business.CustomerServices;
|
||||
|
||||
namespace ARW.Service.Business.BusinessService.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服接口实现类
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(ICustomerServiceService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class CustomerServiceServiceImpl : BaseService<CustomerService>, ICustomerServiceService
|
||||
{
|
||||
private readonly CustomerServiceRepository _CustomerServiceRepository;
|
||||
|
||||
public CustomerServiceServiceImpl(CustomerServiceRepository CustomerServiceRepository)
|
||||
{
|
||||
this._CustomerServiceRepository = CustomerServiceRepository;
|
||||
}
|
||||
|
||||
#region 业务逻辑代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询客服分页列表
|
||||
/// </summary>
|
||||
public async Task<PagedInfo<CustomerServiceVo>> GetCustomerServiceList(CustomerServiceQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<CustomerService>();
|
||||
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerServiceName), s => s.CustomerServiceName.Contains(parm.CustomerServiceName));
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CustomerServicePhone), s => s.CustomerServicePhone.Contains(parm.CustomerServicePhone));
|
||||
var query = _CustomerServiceRepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.CustomerServiceSort, OrderByType.Asc)
|
||||
.Select(s => new CustomerServiceVo
|
||||
{
|
||||
CustomerServiceId = s.CustomerServiceId,
|
||||
CustomerServiceGuid = s.CustomerServiceGuid,
|
||||
CustomerServiceName = s.CustomerServiceName,
|
||||
CustomerServicePhone = s.CustomerServicePhone,
|
||||
CustomerServiceImg = s.CustomerServiceImg,
|
||||
WorkingHoursBeginTime = s.WorkingHoursBeginTime,
|
||||
WorkingHoursEndTime = s.WorkingHoursEndTime,
|
||||
CustomerServiceSort = s.CustomerServiceSort,
|
||||
});
|
||||
|
||||
|
||||
return await query.ToPageAsync(parm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改客服
|
||||
/// </summary>
|
||||
public async Task<string> AddOrUpdateCustomerService(CustomerService model)
|
||||
{
|
||||
if (model.CustomerServiceId != 0)
|
||||
{
|
||||
var response = await _CustomerServiceRepository.UpdateAsync(model);
|
||||
return "修改成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var response = await _CustomerServiceRepository.InsertReturnSnowflakeIdAsync(model);
|
||||
return "添加成功!";
|
||||
}
|
||||
}
|
||||
|
||||
#region Excel处理
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Model.Dto.Business.CustomerServices;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Business.CustomerServices;
|
||||
|
||||
namespace ARW.Service.Business.IBusinessService.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服接口类
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
public interface ICustomerServiceService : IBaseService<CustomerService>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取客服分页列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<PagedInfo<CustomerServiceVo>> GetCustomerServiceList(CustomerServiceQueryDto parm);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改客服
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> AddOrUpdateCustomerService(CustomerService parm);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ARW.Admin.WebApi.Extensions;
|
||||
using ARW.Admin.WebApi.Filters;
|
||||
using ARW.Common;
|
||||
using ARW.Admin.WebApi.Controllers;
|
||||
using ARW.Model.Dto.Api.CustomerServices;
|
||||
using ARW.Service.Api.IBusinessService.CustomerServices;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Api.CustomerServices;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Geocoding;
|
||||
|
||||
namespace ARW.WebApi.Controllers.Api.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服控制器Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
//[Verify]
|
||||
[Route("api/[controller]")]
|
||||
public class CustomerServiceApiController : BaseController
|
||||
{
|
||||
private readonly ICustomerServiceServiceApi _CustomerServiceServiceApi;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖注入
|
||||
/// </summary>
|
||||
/// <param name="CustomerServiceServiceApi">客服客服Api服务</param>
|
||||
public CustomerServiceApiController(ICustomerServiceServiceApi CustomerServiceServiceApi)
|
||||
{
|
||||
_CustomerServiceServiceApi = CustomerServiceServiceApi;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取客服列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm">查询参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getCustomerServiceList")]
|
||||
public async Task<IActionResult> GetCustomerServiceListApi([FromQuery] CustomerServiceQueryDtoApi parm)
|
||||
{
|
||||
var res = await _CustomerServiceServiceApi.GetCustomerServiceListApi(parm);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ARW.Admin.WebApi.Extensions;
|
||||
using ARW.Admin.WebApi.Filters;
|
||||
using ARW.Common;
|
||||
using ARW.Model.Dto.Business.CustomerServices;
|
||||
using ARW.Service.Business.IBusinessService.CustomerServices;
|
||||
using ARW.Admin.WebApi.Controllers;
|
||||
using ARW.Model.Models.Business.CustomerServices;
|
||||
using ARW.Model.Vo.Business.CustomerServices;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using ARW.Admin.WebApi.Framework;
|
||||
|
||||
|
||||
namespace ARW.WebApi.Controllers.Business.CustomerServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 客服控制器
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-21
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("business/[controller]")]
|
||||
public class CustomerServiceController : BaseController
|
||||
{
|
||||
private readonly ICustomerServiceService _CustomerServiceService;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖注入
|
||||
/// </summary>
|
||||
/// <param name="CustomerServiceService">客服服务</param>
|
||||
public CustomerServiceController(ICustomerServiceService CustomerServiceService)
|
||||
{
|
||||
_CustomerServiceService = CustomerServiceService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取客服列表
|
||||
/// </summary>
|
||||
/// <param name="parm">查询参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getCustomerServiceList")]
|
||||
[ActionPermissionFilter(Permission = "business:customerservice:list")]
|
||||
public async Task<IActionResult> GetCustomerServiceList([FromQuery] CustomerServiceQueryDto parm)
|
||||
{
|
||||
var res = await _CustomerServiceService.GetCustomerServiceList(parm);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改客服
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("addOrUpdateCustomerService")]
|
||||
[ActionPermissionFilter(Permission = "business:customerservice:addOrUpdate")]
|
||||
[Log(Title = "添加或修改客服", BusinessType = BusinessType.ADDORUPDATE)]
|
||||
public async Task<IActionResult> AddOrUpdateCustomerService([FromBody] CustomerServiceDto parm)
|
||||
{
|
||||
if (parm == null) { throw new CustomException("请求参数错误"); }
|
||||
var modal = new CustomerService();
|
||||
if (parm.CustomerServiceId != 0) modal = parm.Adapt<CustomerService>().ToUpdate(HttpContext);
|
||||
else modal = parm.Adapt<CustomerService>().ToCreate(HttpContext);
|
||||
|
||||
var res = await _CustomerServiceService.AddOrUpdateCustomerService(modal);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除客服
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:customerservice:delete")]
|
||||
[Log(Title = "客服删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
var response = _CustomerServiceService.Delete(idsArr);
|
||||
return SUCCESS("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user