|
@@ -16,6 +16,7 @@ using Hotline.FlowEngine.Workflows;
|
|
using Hotline.Identity.Roles;
|
|
using Hotline.Identity.Roles;
|
|
using Hotline.Import;
|
|
using Hotline.Import;
|
|
using Hotline.Orders;
|
|
using Hotline.Orders;
|
|
|
|
+using Hotline.Push.Notifies;
|
|
using Hotline.Realtimes;
|
|
using Hotline.Realtimes;
|
|
using Hotline.Repository.SqlSugar;
|
|
using Hotline.Repository.SqlSugar;
|
|
using Hotline.Repository.SqlSugar.System;
|
|
using Hotline.Repository.SqlSugar.System;
|
|
@@ -26,7 +27,9 @@ using Hotline.Share.Dtos;
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
using Hotline.Share.Dtos.Order;
|
|
using Hotline.Share.Dtos.Order;
|
|
using Hotline.Share.Dtos.Realtime;
|
|
using Hotline.Share.Dtos.Realtime;
|
|
|
|
+using Hotline.Share.Dtos.SendSms;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
|
+using Hotline.Share.Enums.Push;
|
|
using Hotline.Share.Enums.Settings;
|
|
using Hotline.Share.Enums.Settings;
|
|
using Hotline.Share.Mq;
|
|
using Hotline.Share.Mq;
|
|
using Hotline.Tools;
|
|
using Hotline.Tools;
|
|
@@ -44,6 +47,7 @@ using NewRock.Sdk;
|
|
using NewRock.Sdk.Security;
|
|
using NewRock.Sdk.Security;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using SqlSugar.SplitTableExtensions;
|
|
using SqlSugar.SplitTableExtensions;
|
|
|
|
+using StackExchange.Redis;
|
|
using Tr.Sdk;
|
|
using Tr.Sdk;
|
|
using XC.RSAUtil;
|
|
using XC.RSAUtil;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
@@ -75,7 +79,7 @@ public class TestController : BaseController
|
|
private readonly IBlacklistDomainService _blacklistDomainService;
|
|
private readonly IBlacklistDomainService _blacklistDomainService;
|
|
private readonly IIvrDomainService _ivrDomainService;
|
|
private readonly IIvrDomainService _ivrDomainService;
|
|
private readonly ISugarUnitOfWork<HotlineDbContext> _uow;
|
|
private readonly ISugarUnitOfWork<HotlineDbContext> _uow;
|
|
- private readonly IRepository<Role> _roleRepository;
|
|
|
|
|
|
+ private readonly IRepository<Identity.Roles.Role> _roleRepository;
|
|
private readonly IMediator _mediator;
|
|
private readonly IMediator _mediator;
|
|
|
|
|
|
private readonly IDistributedLock _distributedLock;
|
|
private readonly IDistributedLock _distributedLock;
|
|
@@ -98,6 +102,7 @@ public class TestController : BaseController
|
|
private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
private readonly IOrderRepository _orderRepository;
|
|
private readonly IOrderRepository _orderRepository;
|
|
private readonly IMapper _mapper;
|
|
private readonly IMapper _mapper;
|
|
|
|
+ private readonly IOptionsSnapshot<SendSmsConfiguration> _sendSmsConfiguration;
|
|
|
|
|
|
|
|
|
|
//private readonly ITypedCache<List<User>> _cache;
|
|
//private readonly ITypedCache<List<User>> _cache;
|
|
@@ -118,7 +123,7 @@ public class TestController : BaseController
|
|
IBlacklistDomainService blacklistDomainService,
|
|
IBlacklistDomainService blacklistDomainService,
|
|
IIvrDomainService ivrDomainService,
|
|
IIvrDomainService ivrDomainService,
|
|
ISugarUnitOfWork<HotlineDbContext> uow,
|
|
ISugarUnitOfWork<HotlineDbContext> uow,
|
|
- IRepository<Role> roleRepository,
|
|
|
|
|
|
+ IRepository<Identity.Roles.Role> roleRepository,
|
|
IMediator mediator,
|
|
IMediator mediator,
|
|
IDistributedLock distributedLock,
|
|
IDistributedLock distributedLock,
|
|
IRepository<OrderUrge> orderUrgeRepository,
|
|
IRepository<OrderUrge> orderUrgeRepository,
|
|
@@ -136,7 +141,10 @@ public class TestController : BaseController
|
|
//IRepository<WorkflowStepHandler> workflowStepHandleRepository,
|
|
//IRepository<WorkflowStepHandler> workflowStepHandleRepository,
|
|
IRepository<SystemOrganize> systemOrganizeRepository,
|
|
IRepository<SystemOrganize> systemOrganizeRepository,
|
|
IOrderRepository orderRepository,
|
|
IOrderRepository orderRepository,
|
|
- IMapper mapper
|
|
|
|
|
|
+ IMapper mapper,
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ IOptionsSnapshot<SendSmsConfiguration> sendSmsConfiguration
|
|
)
|
|
)
|
|
{
|
|
{
|
|
_logger = logger;
|
|
_logger = logger;
|
|
@@ -169,11 +177,29 @@ public class TestController : BaseController
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
|
|
+ _sendSmsConfiguration = sendSmsConfiguration;
|
|
}
|
|
}
|
|
|
|
|
|
[HttpGet("testo")]
|
|
[HttpGet("testo")]
|
|
|
|
+ [AllowAnonymous]
|
|
public async Task<OpenResponse> TestOrigin()
|
|
public async Task<OpenResponse> TestOrigin()
|
|
{
|
|
{
|
|
|
|
+ var messageDto = new Share.Dtos.Push.MessageDto
|
|
|
|
+ {
|
|
|
|
+ PushBusiness = EPushBusiness.OrderAccept,
|
|
|
|
+ ExternalId = "123456789",
|
|
|
|
+ OrderId = "123456789",
|
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
|
+ Remark =" order.Title",
|
|
|
|
+ Name ="张三",
|
|
|
|
+ TemplateCode = "1005",
|
|
|
|
+ Params = new List<string>() { "20240610000022", "12345" },
|
|
|
|
+ TelNumber = "13683420932",
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ var t = _sendSmsConfiguration.Value.Url;
|
|
var now = DateTime.Now.ToString();
|
|
var now = DateTime.Now.ToString();
|
|
return OpenResponse.Ok(now);
|
|
return OpenResponse.Ok(now);
|
|
}
|
|
}
|
|
@@ -316,7 +342,7 @@ public class TestController : BaseController
|
|
[HttpGet("pgsql")]
|
|
[HttpGet("pgsql")]
|
|
public async Task<string> Pgsql()
|
|
public async Task<string> Pgsql()
|
|
{
|
|
{
|
|
- var role = new Role
|
|
|
|
|
|
+ var role = new Identity.Roles.Role
|
|
{
|
|
{
|
|
Name = $"test_role_{TimeOnly.FromDateTime(DateTime.Now)}",
|
|
Name = $"test_role_{TimeOnly.FromDateTime(DateTime.Now)}",
|
|
DisplayName = "test_role_display",
|
|
DisplayName = "test_role_display",
|
|
@@ -331,7 +357,7 @@ public class TestController : BaseController
|
|
|
|
|
|
[AllowAnonymous]
|
|
[AllowAnonymous]
|
|
[HttpGet("roles")]
|
|
[HttpGet("roles")]
|
|
- public async Task<List<Role>> GetRoles()
|
|
|
|
|
|
+ public async Task<List<Identity.Roles.Role>> GetRoles()
|
|
{
|
|
{
|
|
using var lockManager = new LockManager(_distributedLock, $"{nameof(TestController)}.{nameof(GetRoles)}");
|
|
using var lockManager = new LockManager(_distributedLock, $"{nameof(TestController)}.{nameof(GetRoles)}");
|
|
lockManager.InvokeInLock(() => { Console.WriteLine("do something"); }, TimeSpan.FromSeconds(10));
|
|
lockManager.InvokeInLock(() => { Console.WriteLine("do something"); }, TimeSpan.FromSeconds(10));
|