Merge branch 'Feature/SmsRepoetApi' into Main
This commit is contained in:
@@ -30,5 +30,22 @@ public class ApiReportDto
|
||||
public string DeliveryState { get; set; }
|
||||
public string DeliveryUnixTime { get; set; }
|
||||
public string DeliveryColor { get; set; }
|
||||
public string FullName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SmsDetailsDto
|
||||
{
|
||||
|
||||
|
||||
public string MessageText { get; set; }
|
||||
|
||||
public long Mobile { get; set; }
|
||||
|
||||
public string SendUnixTime { get; set; }
|
||||
public string DeliveryState { get; set; }
|
||||
public string DeliveryUnixTime { get; set; }
|
||||
public string DeliveryColor { get; set; }
|
||||
public string FullName { get; set; }
|
||||
|
||||
}
|
||||
@@ -16,15 +16,21 @@ public interface ISmsService
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
Task<SentSmsViewModel> SendVerifyCodeToClient(string number, string code);
|
||||
bool SendAccountsInfo(string number,string fullName, string userName);
|
||||
bool SendAccountsInfo(string number, string fullName, string userName);
|
||||
Task<ApiResultViewModel> GetByMessageId(int messId);
|
||||
Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate);
|
||||
|
||||
#region ForApi
|
||||
|
||||
Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate);
|
||||
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// دریافت جزئیات پیامک
|
||||
/// </summary>
|
||||
/// <param name="messId"></param>
|
||||
/// <param name="fullName"></param>
|
||||
/// <returns></returns>
|
||||
Task<SmsDetailsDto> GetSmsDetailsByMessageId(int messId, string fullName);
|
||||
#endregion
|
||||
|
||||
string DeliveryStatus(byte? dv);
|
||||
string DeliveryColorStatus(byte? dv);
|
||||
@@ -33,9 +39,9 @@ public interface ISmsService
|
||||
#region Mahan
|
||||
|
||||
Task<double> GetCreditAmount();
|
||||
|
||||
|
||||
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId, string typeOfSms = null);
|
||||
|
||||
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId);
|
||||
|
||||
@@ -68,7 +74,7 @@ public interface ISmsService
|
||||
/// <param name="aprove"></param>
|
||||
/// <returns></returns>
|
||||
Task<(byte status, string message, int messaeId, bool isSucceded)> MonthlyBill(string number, int tamplateId, string fullname, string amount, string id, string aprove);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پیامک مسدودی طرف حساب
|
||||
/// قراردادهای قدیم
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.Sms;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using CompanyManagment.App.Contracts.SmsResult.Dto;
|
||||
using CompanyManagment.EFCore.Services;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class SmsResultApplication : ISmsResultApplication
|
||||
{
|
||||
private readonly ISmsResultRepository _smsResultRepository;
|
||||
private readonly ISmsService _smsService;
|
||||
|
||||
public SmsResultApplication(ISmsResultRepository smsResultRepository)
|
||||
public SmsResultApplication(ISmsResultRepository smsResultRepository, ISmsService smsService)
|
||||
{
|
||||
_smsResultRepository = smsResultRepository;
|
||||
_smsService = smsService;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,4 +73,6 @@ public class SmsResultApplication : ISmsResultApplication
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -205,6 +205,26 @@ public class SmsService : ISmsService
|
||||
};
|
||||
return appendData;
|
||||
}
|
||||
|
||||
public async Task<SmsDetailsDto> GetSmsDetailsByMessageId(int messId, string fullName)
|
||||
{
|
||||
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var response = await smsIr.GetReportAsync(messId);
|
||||
MessageReportResult messages = response.Data;
|
||||
|
||||
var appendData = new SmsDetailsDto()
|
||||
{
|
||||
Mobile = messages.Mobile,
|
||||
MessageText = messages.MessageText,
|
||||
SendUnixTime = UnixTimeStampToDateTime(messages.SendDateTime),
|
||||
DeliveryState = DeliveryStatus(messages.DeliveryState),
|
||||
DeliveryUnixTime = UnixTimeStampToDateTime(messages.DeliveryDateTime),
|
||||
DeliveryColor = DeliveryColorStatus(messages.DeliveryState),
|
||||
FullName = fullName
|
||||
};
|
||||
return appendData;
|
||||
}
|
||||
public async Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate)
|
||||
{
|
||||
|
||||
|
||||
@@ -49,6 +49,19 @@ public class SmsReportController : AdminBaseController
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جزئیات پیامک
|
||||
/// </summary>
|
||||
/// <param name="messId"></param>
|
||||
/// <param name="fullName"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetSmsDetails")]
|
||||
public async Task<SmsDetailsDto> GetSmsDetails(int messId, string fullName)
|
||||
{
|
||||
var result =await _smsService.GetSmsDetailsByMessageId(messId, fullName);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// گزارش ای پی آی
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user