You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB
C#

using DS.Module.Core;
4 months ago
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 任务邮件API
/// </summary>
public class TaskMailController : ApiController
{
readonly ITaskMailService service;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="service"></param>
public TaskMailController(ITaskMailService service)
{
this.service = service;
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<BusinessTaskMail>>> GetListAsync(PageRequest request)
{
return await service.GetListAsync(request);
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id">ID</param>
/// <returns></returns>
[HttpGet, Route("Edit")]
public async Task<DataResult<BusinessTaskMail>> GetAsync(long id)
4 months ago
{
return await service.GetAsync(id);
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="taskMail">邮件配置</param>
/// <returns></returns>
[HttpPost, Route("Edit")]
public async Task<DataResult> EditAsync(BusinessTaskMail taskMail)
4 months ago
{
if (taskMail.Receiver == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailReceiverNotNull));
if (taskMail.Sender == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailSenderNotNull));
return await service.EditAsync(taskMail);
}
}
}