using System; using System.Collections.Generic; using System.Threading.Tasks; using Apache.IoTDB.DataStructure; using Apache.IoTDB; using Confluent.Kafka; using JiShe.CollectBus.Ammeters; using JiShe.CollectBus.FreeSql; using JiShe.CollectBus.IoTDBProvider; using JiShe.CollectBus.IotSystems.PrepayModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using JiShe.CollectBus.IoTDBProvider.Context; using Microsoft.Extensions.Logging; using JiShe.CollectBus.Common.Helpers; using JiShe.CollectBus.IotSystems.AFNEntity; using JiShe.CollectBus.Protocol.Contracts.Interfaces; using Microsoft.Extensions.DependencyInjection; using JiShe.CollectBus.Cassandra; using JiShe.CollectBus.Common.Enums; using JiShe.CollectBus.IotSystems.MessageIssueds; using Volo.Abp.Application.Services; namespace JiShe.CollectBus.Samples; [AllowAnonymous] public class TestAppService : CollectBusAppService, IApplicationService { private readonly ILogger _logger; private readonly ICassandraRepository _messageIssuedCassandraRepository; public TestAppService( ILogger logger, ICassandraRepository messageIssuedCassandraRepository ) { _logger = logger; _messageIssuedCassandraRepository = messageIssuedCassandraRepository; } public async Task AddMessage() { await _messageIssuedCassandraRepository.InsertAsync(new MessageIssued { ClientId = Guid.NewGuid().ToString(), Message = Array.Empty(), DeviceNo = "123321312", MessageId = Guid.NewGuid().ToString(), Type = IssuedEventType.Data }); } }