|
@@ -27,6 +27,7 @@ public class PushDomainService : IPushDomainService, IScopeDependency
|
|
|
private readonly SmsAccountInfo? accountInfo = null;
|
|
|
private readonly IMediator _mediator;
|
|
|
private readonly ITypedCache<CacheWaitSendId> _cacheWaitSendId;
|
|
|
+ //private readonly ICapPublisher _capPublisher;
|
|
|
|
|
|
/// <summary>
|
|
|
///
|
|
@@ -104,6 +105,12 @@ public class PushDomainService : IPushDomainService, IScopeDependency
|
|
|
}
|
|
|
|
|
|
await _messageRepository.AddAsync(message); //写入本地数据库
|
|
|
+
|
|
|
+ if (message.ClientId == "Hotline")
|
|
|
+ {
|
|
|
+ var data = _mapper.Map<PushMessageDto>(message);
|
|
|
+ data.Type = "0";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -180,6 +187,11 @@ public class PushDomainService : IPushDomainService, IScopeDependency
|
|
|
await _messageRepository.UpdateAsync(data);
|
|
|
// 成功返回值必须是ok
|
|
|
strResult = "ok";
|
|
|
+ if (data.ClientId == "Hotline")
|
|
|
+ {
|
|
|
+ var dataPush = _mapper.Map<PushMessageDto>(data);
|
|
|
+ dataPush.Type = "1";
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
strResult = "error,调用失败";
|
|
@@ -220,7 +232,11 @@ public class PushDomainService : IPushDomainService, IScopeDependency
|
|
|
data.SmsReplyTime = Convert.ToDateTime(receiveMessageDto.motime);
|
|
|
data.SmsReplyContent = receiveMessageDto.msg;
|
|
|
await _messageRepository.UpdateAsync(data);
|
|
|
-
|
|
|
+ if (data.ClientId == "Hotline")
|
|
|
+ {
|
|
|
+ var dataPush = _mapper.Map<PushMessageDto>(data);
|
|
|
+ dataPush.Type = "2";
|
|
|
+ }
|
|
|
//消息处理 todo
|
|
|
//await _mediator.Publish(new PushMessageNotify(_mapper.Map<PushMessageNotifyDto>(data)));
|
|
|
}
|