|
12345678910111213141516171819202122232425262728293031323334353637 |
- using Dapper;
- using Microsoft.Extensions.Configuration;
- using MySql.Data.MySqlClient;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TelpoPush.Models.CacheTemplates;
-
- namespace TelpoPush.Service.Cache
- {
- public class SqlMapper
- {
- private readonly IConfiguration _config;
- private static string gps_conn = "";
- private static string telcommon_conn = "";
- private static string healthy_conn = "";
- public SqlMapper(IConfiguration config)
- {
- _config = config;
- gps_conn = _config["ConnectionStrings:DB_Connection_String"].ToString();
- telcommon_conn = _config["ConnectionStrings:Telpo_common_ConnString"].ToString();
- healthy_conn = _config["ConnectionStrings:Telpo_Healthy_ConnString"].ToString();
- }
-
- public List<ManufactorKafkaModel> ManufactorKafkaTopicQuery()
- {
- using (IDbConnection connection = new MySqlConnection(telcommon_conn))
- {
- var sql = @"SELECT manufactor_id manufactorId,manufactor_name manufactorName,kafka_servers kafkaServers,kafka_topic kafkaTopic,kafka_username kafkaUsername, kafka_password kafkaPassword FROM manufactor_real_monitor";
- return connection.Query<ManufactorKafkaModel>(sql).ToList();
- }
- }
- }
- }
|