|
- 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":
- // case "topichmbloodpress":
-
- // //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;
-
- return new PackageMsgModel()
- {
- DB = msg.DB,
- MessageId = msg.MessageId,
- Topic = msg.Topic,
- DetailData = msg.Body,
-
- };
- }
- }
- }
|