|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using HealthMonitor.Service.Resolver.Interface;
- using HealthMonitor.Service.Sub;
- using HealthMonitor.Service.Sub.Topic.Model;
- using Microsoft.Extensions.Logging;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TDengineTMQ;
- using TelpoDataService.Util.Entities.GpsLocationHistory;
-
- namespace HealthMonitor.Service.Resolver.Factory
- {
- public class ResolverFactory : IResolverFactory
- {
- private readonly ILogger<ResolverFactory> _logger;
- public ResolverFactory(ILogger<ResolverFactory> logger)
- {
- _logger = logger;
- }
-
- public PackageMsgModel? ParseAndWrap(ReceiveMessageModel msg)
- {
- var topic=msg.Topic;
- switch (topic)
- {
- case "topic_hm_bp_stats":
-
- //TopicHmBloodPress bloodPress = JsonConvert.DeserializeObject<TopicHmBloodPress>(msg.Body)!;
-
- return new PackageMsgModel()
- {
- DB= msg.DB,
- MessageId=msg.MessageId,
- Topic= topic,
- DetailData= msg.Body,
-
- };
-
- // return bloodPress!;
-
- default:
- break;
- }
- return null;
- }
- }
- }
|