Merge branch 'Feature/SmsRepoetApi' into Main

This commit is contained in:
gozareshgir
2026-01-13 17:54:43 +03:30
5 changed files with 70 additions and 7 deletions

View File

@@ -30,5 +30,22 @@ public class ApiReportDto
public string DeliveryState { get; set; } public string DeliveryState { get; set; }
public string DeliveryUnixTime { get; set; } public string DeliveryUnixTime { get; set; }
public string DeliveryColor { 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; }
} }

View File

@@ -16,15 +16,21 @@ public interface ISmsService
/// <param name="code"></param> /// <param name="code"></param>
/// <returns></returns> /// <returns></returns>
Task<SentSmsViewModel> SendVerifyCodeToClient(string number, string code); 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<ApiResultViewModel> GetByMessageId(int messId);
Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate); Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate);
#region ForApi #region ForApi
Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate); Task<List<ApiReportDto>> GetApiReport(string startDate, string endDate);
/// <summary>
#endregion /// دریافت جزئیات پیامک
/// </summary>
/// <param name="messId"></param>
/// <param name="fullName"></param>
/// <returns></returns>
Task<SmsDetailsDto> GetSmsDetailsByMessageId(int messId, string fullName);
#endregion
string DeliveryStatus(byte? dv); string DeliveryStatus(byte? dv);
string DeliveryColorStatus(byte? dv); string DeliveryColorStatus(byte? dv);
@@ -33,9 +39,9 @@ public interface ISmsService
#region Mahan #region Mahan
Task<double> GetCreditAmount(); Task<double> GetCreditAmount();
public Task<bool> SendInstitutionCreationVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId, string typeOfSms = null); 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, public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
long contractingPartyId, long institutionContractId); long contractingPartyId, long institutionContractId);
@@ -68,7 +74,7 @@ public interface ISmsService
/// <param name="aprove"></param> /// <param name="aprove"></param>
/// <returns></returns> /// <returns></returns>
Task<(byte status, string message, int messaeId, bool isSucceded)> MonthlyBill(string number, int tamplateId, string fullname, string amount, string id, string aprove); Task<(byte status, string message, int messaeId, bool isSucceded)> MonthlyBill(string number, int tamplateId, string fullname, string amount, string id, string aprove);
/// <summary> /// <summary>
/// پیامک مسدودی طرف حساب /// پیامک مسدودی طرف حساب
/// قراردادهای قدیم /// قراردادهای قدیم

View File

@@ -1,21 +1,26 @@
using _0_Framework.Application; using _0_Framework.Application;
using _0_Framework.Application.Enums; using _0_Framework.Application.Enums;
using _0_Framework.Application.Sms;
using Company.Domain.SmsResultAgg; using Company.Domain.SmsResultAgg;
using CompanyManagment.App.Contracts.SmsResult; using CompanyManagment.App.Contracts.SmsResult;
using CompanyManagment.App.Contracts.SmsResult.Dto; using CompanyManagment.App.Contracts.SmsResult.Dto;
using CompanyManagment.EFCore.Services;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
namespace CompanyManagment.Application; namespace CompanyManagment.Application;
public class SmsResultApplication : ISmsResultApplication public class SmsResultApplication : ISmsResultApplication
{ {
private readonly ISmsResultRepository _smsResultRepository; private readonly ISmsResultRepository _smsResultRepository;
private readonly ISmsService _smsService;
public SmsResultApplication(ISmsResultRepository smsResultRepository) public SmsResultApplication(ISmsResultRepository smsResultRepository, ISmsService smsService)
{ {
_smsResultRepository = smsResultRepository; _smsResultRepository = smsResultRepository;
_smsService = smsService;
} }
@@ -68,4 +73,6 @@ public class SmsResultApplication : ISmsResultApplication
}).ToList(); }).ToList();
return result; return result;
} }
} }

View File

@@ -205,6 +205,26 @@ public class SmsService : ISmsService
}; };
return appendData; 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) public async Task<List<ApiResultViewModel>> GetApiResult(string startDate, string endDate)
{ {

View File

@@ -49,6 +49,19 @@ public class SmsReportController : AdminBaseController
return result; 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>
/// گزارش ای پی آی /// گزارش ای پی آی
/// </summary> /// </summary>