diff --git a/服务API.Model/AlarmTable.cs b/DataVAPI.Model/AlarmTable.cs similarity index 86% rename from 服务API.Model/AlarmTable.cs rename to DataVAPI.Model/AlarmTable.cs index 7b71551..16f53e8 100644 --- a/服务API.Model/AlarmTable.cs +++ b/DataVAPI.Model/AlarmTable.cs @@ -1,16 +1,16 @@ -using System; +using DataVAPI.ServerDB.MongoDB; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using 服务API.ServerDB.MongoDB; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 告警消息表 /// - public class AlarmTable :BaseEntity + public class AlarmTable : BaseEntity { /// /// 告警时间 diff --git a/服务API.Model/CommandModel.cs b/DataVAPI.Model/CommandModel.cs similarity index 87% rename from 服务API.Model/CommandModel.cs rename to DataVAPI.Model/CommandModel.cs index 43d3f33..5aafafc 100644 --- a/服务API.Model/CommandModel.cs +++ b/DataVAPI.Model/CommandModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 命令实体类 @@ -22,6 +22,6 @@ namespace 服务API.Model /// /// 命令变量:执行变量 key为属性或时间 value为值或者消息 /// - public Dictionary CommandValue { get; set; } + public Dictionary CommandValue { get; set; } } } diff --git a/服务API.Model/服务API.Model.csproj b/DataVAPI.Model/DataVAPI.Model.csproj similarity index 76% rename from 服务API.Model/服务API.Model.csproj rename to DataVAPI.Model/DataVAPI.Model.csproj index 4b6109b..82be567 100644 --- a/服务API.Model/服务API.Model.csproj +++ b/DataVAPI.Model/DataVAPI.Model.csproj @@ -7,7 +7,7 @@ - + diff --git a/服务API.Model/DeviceTable.cs b/DataVAPI.Model/DeviceTable.cs similarity index 87% rename from 服务API.Model/DeviceTable.cs rename to DataVAPI.Model/DeviceTable.cs index ef63bc7..ea983b0 100644 --- a/服务API.Model/DeviceTable.cs +++ b/DataVAPI.Model/DeviceTable.cs @@ -1,16 +1,16 @@ -using System; +using DataVAPI.ServerDB.MongoDB; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using 服务API.ServerDB.MongoDB; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 设备信息表 /// - public class DeviceTable :BaseEntity + public class DeviceTable : BaseEntity { /// /// 阿里云设备key diff --git a/服务API.Model/JsonMsg.cs b/DataVAPI.Model/JsonMsg.cs similarity index 75% rename from 服务API.Model/JsonMsg.cs rename to DataVAPI.Model/JsonMsg.cs index b702d4e..62a9983 100644 --- a/服务API.Model/JsonMsg.cs +++ b/DataVAPI.Model/JsonMsg.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 返回消息 @@ -42,25 +42,25 @@ namespace 服务API.Model public int icon { get; set; } - public static JsonMsg OK(T obj,string msg = "接口名称",string mso="调用接口成功") + public static JsonMsg OK(T obj, string msg = "接口名称", string mso = "调用接口成功") { - string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用成功,描述:" + mso+ obj}"; + string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用成功,描述:" + mso + obj}"; ConsoleColor currentForeColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(str); Console.ForegroundColor = currentForeColor; ; - return new JsonMsg() { code = 1,ms= mso,msg = "成功",obj = obj,icon = 1,oTData = new IOTData { data = obj } }; + return new JsonMsg() { code = 1, ms = mso, msg = "成功", obj = obj, icon = 1, oTData = new IOTData { data = obj } }; } - public static JsonMsg Error(T obj,string msg = "接口名称",string mso = "调用接口成功失败") + public static JsonMsg Error(T obj, string msg = "接口名称", string mso = "调用接口成功失败") { - string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用失败,描述:" + mso+ obj}"; + string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用失败,描述:" + mso + obj}"; ConsoleColor currentForeColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(str); Console.ForegroundColor = currentForeColor; - return new JsonMsg() { code = 0,ms = mso,msg = "失败",obj = obj,icon = 1,oTData = new IOTData { data = obj } }; + return new JsonMsg() { code = 0, ms = mso, msg = "失败", obj = obj, icon = 1, oTData = new IOTData { data = obj } }; } } diff --git a/服务API.Model/LargeScreenTable.cs b/DataVAPI.Model/LargeScreenTable.cs similarity index 70% rename from 服务API.Model/LargeScreenTable.cs rename to DataVAPI.Model/LargeScreenTable.cs index b482bb0..7466899 100644 --- a/服务API.Model/LargeScreenTable.cs +++ b/DataVAPI.Model/LargeScreenTable.cs @@ -1,16 +1,16 @@ -using System; +using DataVAPI.ServerDB.MongoDB; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using 服务API.ServerDB.MongoDB; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 大屏消息表 /// - public class LargeScreenTable :BaseEntity + public class LargeScreenTable : BaseEntity { /// /// Json值 diff --git a/服务API.Model/LogTable.cs b/DataVAPI.Model/LogTable.cs similarity index 86% rename from 服务API.Model/LogTable.cs rename to DataVAPI.Model/LogTable.cs index d44b662..1c82f45 100644 --- a/服务API.Model/LogTable.cs +++ b/DataVAPI.Model/LogTable.cs @@ -1,16 +1,16 @@ -using System; +using DataVAPI.ServerDB.MongoDB; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using 服务API.ServerDB.MongoDB; -namespace 服务API.Model +namespace DataVAPI.Model { /// /// 日志表 /// - public class LogTable :BaseEntity + public class LogTable : BaseEntity { /// /// 日志时间 diff --git a/服务API.ProcessServices/AppConfig/AppConfigurtaionServices.cs b/DataVAPI.ProcessServices/AppConfig/AppConfigurtaionServices.cs similarity index 95% rename from 服务API.ProcessServices/AppConfig/AppConfigurtaionServices.cs rename to DataVAPI.ProcessServices/AppConfig/AppConfigurtaionServices.cs index 24fe5f4..8063240 100644 --- a/服务API.ProcessServices/AppConfig/AppConfigurtaionServices.cs +++ b/DataVAPI.ProcessServices/AppConfig/AppConfigurtaionServices.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Configuration.Json; using System; -namespace 服务API.ProcessServices +namespace DataVAPI.ProcessServices.AppConfig { public class AppConfigurtaionServices { diff --git a/服务API.ProcessServices/服务API.ProcessServices.csproj b/DataVAPI.ProcessServices/DataVAPI.ProcessServices.csproj similarity index 81% rename from 服务API.ProcessServices/服务API.ProcessServices.csproj rename to DataVAPI.ProcessServices/DataVAPI.ProcessServices.csproj index 1ed572f..9ca2c04 100644 --- a/服务API.ProcessServices/服务API.ProcessServices.csproj +++ b/DataVAPI.ProcessServices/DataVAPI.ProcessServices.csproj @@ -3,7 +3,7 @@ net6.0 Exe - 服务API.ProcessServices.Program + DataVAPI.ProcessServices.Program @@ -13,7 +13,7 @@ - + diff --git a/服务API.ProcessServices/Program.cs b/DataVAPI.ProcessServices/Program.cs similarity index 66% rename from 服务API.ProcessServices/Program.cs rename to DataVAPI.ProcessServices/Program.cs index f0d94a9..7ed61f0 100644 --- a/服务API.ProcessServices/Program.cs +++ b/DataVAPI.ProcessServices/Program.cs @@ -1,8 +1,7 @@ -using System; -using 服务API.ProcessServices.阿里云处理流程One; -using 服务API.Tool.控制台显示; +using DataVAPI.ProcessServices.阿里云处理流程One; +using DataVAPI.Tool.控制台显示; -namespace 服务API.ProcessServices +namespace DataVAPI.ProcessServices { internal class Program { diff --git a/服务API.ProcessServices/appsettings.json b/DataVAPI.ProcessServices/appsettings.json similarity index 100% rename from 服务API.ProcessServices/appsettings.json rename to DataVAPI.ProcessServices/appsettings.json diff --git a/服务API.ProcessServices/文件存储/SqlContext.cs b/DataVAPI.ProcessServices/文件存储/SqlContext.cs similarity index 95% rename from 服务API.ProcessServices/文件存储/SqlContext.cs rename to DataVAPI.ProcessServices/文件存储/SqlContext.cs index 99081b6..f1e6a0b 100644 --- a/服务API.ProcessServices/文件存储/SqlContext.cs +++ b/DataVAPI.ProcessServices/文件存储/SqlContext.cs @@ -8,9 +8,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.ProcessServices.文件存储 +namespace DataVAPI.ProcessServices.文件存储 { - public class SqlContext :DbContext where T : DataVModel, new() + public class SqlContext : DbContext where T : DataVModel, new() { public static SqlContext Base = new(); @@ -23,7 +23,7 @@ namespace 服务API.ProcessServices.文件存储 { get { - Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"AccessFile")); + Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AccessFile")); return $"{AppDomain.CurrentDomain.BaseDirectory}AccessFile\\{typeof(T).Name}.db"; } } diff --git a/服务API.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs b/DataVAPI.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs similarity index 90% rename from 服务API.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs rename to DataVAPI.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs index b52bd63..f7c33ca 100644 --- a/服务API.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs +++ b/DataVAPI.ProcessServices/阿里云处理流程One/ALY_ProcessServer.cs @@ -1,13 +1,14 @@ -using System; +using DataVAPI.ProcessServices.AppConfig; +using DataVAPI.Tool; +using DataVAPI.Tool.API请求; +using DataVAPI.Tool.IOT; +using DataVAPI.Tool.控制台显示; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; -using 服务API.Tool; -using 服务API.Tool.API请求; -using 服务API.Tool.IOT; -using 服务API.Tool.控制台显示; -namespace 服务API.ProcessServices.阿里云处理流程One +namespace DataVAPI.ProcessServices.阿里云处理流程One { /// /// 老服务代码 @@ -68,7 +69,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One //MQTT 数据接收处理 ConsoleHelper.WriteInfoLine("尝试连接阿里云."); IOTDevServer.GetInstance().SetUrl(APIurl); - if (IOTDevServer.GetInstance().CreateLinks(0,out device)) + if (IOTDevServer.GetInstance().CreateLinks(0, out device)) { ConsoleHelper.WriteSuccessLine("连接阿里云成功!"); } @@ -183,7 +184,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One if (receiveModel?.deviceContext != null && receiveModel?.status != null)//状态变更消息 { devModel?.operatingDeviceStatus.data?.Find(par => par.deviceName == receiveModel.deviceContext.deviceName)?.SetStatus(receiveModel.status.value); - devModel.infoMessage.data.Add(new DeviceBase { DeviceMC = receiveModel.deviceContext.deviceName,DeviceMS = $"设备{receiveModel.status.value}了!",DeviceSJ = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); + devModel.infoMessage.data.Add(new DeviceBase { DeviceMC = receiveModel.deviceContext.deviceName, DeviceMS = $"设备{receiveModel.status.value}了!", DeviceSJ = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); DevStatus dev = devModel?.operatingDeviceStatus.data?.Find(par => par.deviceName == receiveModel.deviceContext.deviceName); if (dev != null) @@ -191,11 +192,11 @@ namespace 服务API.ProcessServices.阿里云处理流程One ApiAddLog(Tools.JsonConvertTools(new LogTable { devicename = receiveModel.deviceContext.deviceName, - ClientId= dev.clientId, - LogTime=DateTime.Now, - LogType="1", - LogMessage= $"设备{receiveModel.status.value}了!", - LogVla="上下线" + ClientId = dev.clientId, + LogTime = DateTime.Now, + LogType = "1", + LogMessage = $"设备{receiveModel.status.value}了!", + LogVla = "上下线" })); } } @@ -205,11 +206,11 @@ namespace 服务API.ProcessServices.阿里云处理流程One #region 1.设置data默认值 if (screen1Monitor.operatingDeviceStatus.data.Count == 0) { - screen1Monitor.operatingDeviceStatus.data.Add(new DevStatus { DeviceMC = "",DeviceMS = "",DeviceSJ = "",deviceName = "",DeviceZT = "",gmtCreate = "" }); + screen1Monitor.operatingDeviceStatus.data.Add(new DevStatus { DeviceMC = "", DeviceMS = "", DeviceSJ = "", deviceName = "", DeviceZT = "", gmtCreate = "" }); } if (screen1Monitor.infoMessage.data.Count == 0) { - screen1Monitor.infoMessage.data.Add(new DeviceBase { DeviceMC = "",DeviceMS = "",DeviceSJ = "" }); + screen1Monitor.infoMessage.data.Add(new DeviceBase { DeviceMC = "", DeviceMS = "", DeviceSJ = "" }); } #endregion @@ -217,7 +218,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One if (!string.IsNullOrEmpty(JSON)) { AddScreenCreateOrUpdate(JSON); - IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.ScreenShowPubTopic,JSON); + IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.ScreenShowPubTopic, JSON); } if (devModel.infoMessage.data != null && devModel.infoMessage.data.Count > 0) @@ -268,7 +269,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One } } - }),"队列任务执行"); + }), "队列任务执行"); } /// @@ -276,7 +277,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One /// /// /// - private void DevIOTActionHandler(string topic,string message) + private void DevIOTActionHandler(string topic, string message) { if (string.IsNullOrEmpty(topic)) return; @@ -297,7 +298,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One } else if (topic == IOTDevServer.HeartbeatSubTopic)//上下线订阅主题 { - ReceiveModel receiveModel =Tools.JsonToObjectTools(message); + ReceiveModel receiveModel = Tools.JsonToObjectTools(message); if (receiveModel != null && receiveModel.status != null)//上下线通知 { if (receiveModel.deviceContext.deviceName == "hbldev") return; @@ -328,7 +329,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One { ///api/Screen/CreateOrUpdate string url = APIurl + "/api/Screen/CreateOrUpdate"; - HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(new LargeScreen() { json = json,devicename = device.devicename,clientId = device.ClientId })); return true; + HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(new LargeScreen() { json = json, devicename = device.devicename, clientId = device.ClientId })); return true; } catch (Exception ex) { @@ -374,7 +375,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One al.devicename = devModel?.operatingDeviceStatus.data?.Find(par => par.clientId == al.ClientId)?.deviceName; } string url = APIurl + "/api/Alarm/Create"; - HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(al)); + HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(al)); } } @@ -400,7 +401,7 @@ namespace 服务API.ProcessServices.阿里云处理流程One lo.devicename = devModel?.operatingDeviceStatus.data?.Find(par => par.clientId == lo.ClientId)?.deviceName; } string url = APIurl + "/api/Log/Create"; - HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(lo)); + HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(lo)); } } catch (Exception ex) diff --git a/服务API.ServerDB/服务API.ServerDB.csproj b/DataVAPI.ServerDB/DataVAPI.ServerDB.csproj similarity index 100% rename from 服务API.ServerDB/服务API.ServerDB.csproj rename to DataVAPI.ServerDB/DataVAPI.ServerDB.csproj diff --git a/服务API.ServerDB/MongoDB/MongodbHelper.cs b/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs similarity index 81% rename from 服务API.ServerDB/MongoDB/MongodbHelper.cs rename to DataVAPI.ServerDB/MongoDB/MongodbHelper.cs index 2ee860a..b4d6365 100644 --- a/服务API.ServerDB/MongoDB/MongodbHelper.cs +++ b/DataVAPI.ServerDB/MongoDB/MongodbHelper.cs @@ -10,7 +10,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; -namespace 服务API.ServerDB.MongoDB +namespace DataVAPI.ServerDB.MongoDB { public class Db { @@ -24,7 +24,7 @@ namespace 服务API.ServerDB.MongoDB private Db() { } - public static IMongoDatabase GetDb(string conn,string dbna) + public static IMongoDatabase GetDb(string conn, string dbna) { if (db == null) { @@ -47,16 +47,16 @@ namespace 服务API.ServerDB.MongoDB private IMongoCollection collection = null; - public MongoDbHelper(string conn,string dbna) + public MongoDbHelper(string conn, string dbna) { - this.db = Db.GetDb(conn,dbna); + db = Db.GetDb(conn, dbna); collection = db.GetCollection(typeof(T).Name); } public T Insert(T entity) { var flag = ObjectId.GenerateNewId(); - entity.GetType().GetProperty("Id").SetValue(entity,flag); + entity.GetType().GetProperty("Id").SetValue(entity, flag); entity.State = "y"; entity.CreateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); entity.UpdateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); @@ -66,10 +66,10 @@ namespace 服务API.ServerDB.MongoDB public List Inserts(List entity) { - entity?.ForEach(par => + entity?.ForEach(par => { var flag = ObjectId.GenerateNewId(); - par.GetType().GetProperty("Id").SetValue(par,flag); + par.GetType().GetProperty("Id").SetValue(par, flag); par.State = "y"; par.CreateTime = DateTime.Now; par.UpdateTime = DateTime.Now; @@ -78,11 +78,11 @@ namespace 服务API.ServerDB.MongoDB return entity; } - public void Modify(string id,string field,string value) + public void Modify(string id, string field, string value) { - var filter = Builders.Filter.Eq("Id",ObjectId.Parse(id)); - var updated = Builders.Update.Set(field,value); - UpdateResult result = collection.UpdateOneAsync(filter,updated).Result; + var filter = Builders.Filter.Eq("Id", ObjectId.Parse(id)); + var updated = Builders.Update.Set(field, value); + UpdateResult result = collection.UpdateOneAsync(filter, updated).Result; } public void Update(T entity) @@ -97,15 +97,15 @@ namespace 服务API.ServerDB.MongoDB { if (!newValue.ToString().Equals(oldValue.ToString())) { - old.GetType().GetProperty(prop.Name).SetValue(old,newValue.ToString()); + old.GetType().GetProperty(prop.Name).SetValue(old, newValue.ToString()); } } } old.State = "y"; old.UpdateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); - var filter = Builders.Filter.Eq("Id",entity.Id); - ReplaceOneResult result = collection.ReplaceOneAsync(filter,old).Result; + var filter = Builders.Filter.Eq("Id", entity.Id); + ReplaceOneResult result = collection.ReplaceOneAsync(filter, old).Result; } @@ -119,14 +119,14 @@ namespace 服务API.ServerDB.MongoDB { try { - var Type =prop.PropertyType.Name; + var Type = prop.PropertyType.Name; var newValue = prop.GetValue(entity); var oldValue = old.GetType().GetProperty(prop.Name).GetValue(old); if (newValue != null) { if (!newValue.ToString().Equals(oldValue.ToString())) { - old.GetType().GetProperty(prop.Name).SetValue(old,newValue); + old.GetType().GetProperty(prop.Name).SetValue(old, newValue); //if (Type == typeof(DateTime).Name) } } @@ -140,19 +140,19 @@ namespace 服务API.ServerDB.MongoDB old.State = "y"; old.UpdateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); - var filter = Builders.Filter.Eq("IdStr",entity.IdStr); - ReplaceOneResult result = collection.ReplaceOneAsync(filter,old).Result; + var filter = Builders.Filter.Eq("IdStr", entity.IdStr); + ReplaceOneResult result = collection.ReplaceOneAsync(filter, old).Result; } public void Delete(T entity) { - var filter = Builders.Filter.Eq("Id",entity.Id); + var filter = Builders.Filter.Eq("Id", entity.Id); collection.DeleteOneAsync(filter); } public void Delete(string id) { - var filter = Builders.Filter.Eq("Id",ObjectId.Parse(id)); + var filter = Builders.Filter.Eq("Id", ObjectId.Parse(id)); collection.DeleteOneAsync(filter); } @@ -161,27 +161,28 @@ namespace 服务API.ServerDB.MongoDB return collection.Find(a => a.Id == ObjectId.Parse(id))?.ToList().FirstOrDefault(); } - public List QueryAllTime(string clientId,DateTime datesta ,DateTime datastop ) + public List QueryAllTime(string clientId, DateTime datesta, DateTime datastop) { if (string.IsNullOrEmpty(clientId)) { if (datastop >= datesta && datastop > DateTime.Parse("2011-10-11 00:00:00")) { - return collection.Find(a => (a.CreateTime >= datesta) && (a.CreateTime <= datastop))?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.CreateTime >= datesta && a.CreateTime <= datastop)?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } else { - return collection.Find(a => (a.CreateTime >= datesta))?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.CreateTime >= datesta)?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } - } else + } + else { if (datastop >= datesta && datastop > DateTime.Parse("2011-10-11 00:00:00")) { - return collection.Find(a => a.ClientId == clientId && (a.CreateTime >= datesta) && (a.CreateTime <= datastop))?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.ClientId == clientId && a.CreateTime >= datesta && a.CreateTime <= datastop)?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } else { - return collection.Find(a => a.ClientId == clientId && (a.CreateTime >= datesta))?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.ClientId == clientId && a.CreateTime >= datesta)?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } } } @@ -193,12 +194,12 @@ namespace 服务API.ServerDB.MongoDB public List QueryClientId(string clientId) { - return collection.Find(a => a.ClientId == clientId && (a.CreateTime >= DateTime.Now.Date) && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.ClientId == clientId && a.CreateTime >= DateTime.Now.Date && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } public List QueryDeviceId(string clientId, string deviceId) { - return collection.Find(a => a.DeviceId == deviceId && a.ClientId==clientId && (a.CreateTime >= DateTime.Now.Date) && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime).ToList(); + return collection.Find(a => a.DeviceId == deviceId && a.ClientId == clientId && a.CreateTime >= DateTime.Now.Date && a.State == "y")?.ToList().OrderByDescending(a => a.CreateTime).ToList(); } public List QueryAll() @@ -206,7 +207,7 @@ namespace 服务API.ServerDB.MongoDB return collection.Find(a => a.State.Equals("y"))?.ToList(); } - public PaginationListModel BasePagQuery(string chid,DateTime datesta,DateTime datastop,int PageNumber,int PageSize) + public PaginationListModel BasePagQuery(string chid, DateTime datesta, DateTime datastop, int PageNumber, int PageSize) { BasePaginationModel pagination = new BasePaginationModel() { @@ -214,14 +215,14 @@ namespace 服务API.ServerDB.MongoDB PageSize = PageSize }; - var RT = GetPagination(chid,datesta,datastop, ref pagination); + var RT = GetPagination(chid, datesta, datastop, ref pagination); return RT; } - public PaginationListModel GetPagination(string chid,DateTime datesta,DateTime datastop,ref BasePaginationModel Pagination) + public PaginationListModel GetPagination(string chid, DateTime datesta, DateTime datastop, ref BasePaginationModel Pagination) { - var mongorResult = collection.AsQueryable().Where(A => !string.IsNullOrEmpty(A.ClientId) && A.ClientId==chid && A.CreateTime>=datesta && A.CreateTime<=datastop).OrderByDescending(item => item.CreateTime); - var result = MongoPaginationService.BasePager(mongorResult,ref Pagination); + var mongorResult = collection.AsQueryable().Where(A => !string.IsNullOrEmpty(A.ClientId) && A.ClientId == chid && A.CreateTime >= datesta && A.CreateTime <= datastop).OrderByDescending(item => item.CreateTime); + var result = mongorResult.BasePager(ref Pagination); PaginationListModel M = new PaginationListModel() { Data = result?.ToList(), @@ -247,7 +248,7 @@ namespace 服务API.ServerDB.MongoDB } set { - _ID= value; + _ID = value; IdStr = _ID.ToString(); } } @@ -294,7 +295,7 @@ namespace 服务API.ServerDB.MongoDB /// /// /// - public static IQueryable BasePager(this IOrderedQueryable entitys,ref BasePaginationModel pagination) + public static IQueryable BasePager(this IOrderedQueryable entitys, ref BasePaginationModel pagination) { if (pagination != null) { @@ -311,7 +312,7 @@ namespace 服务API.ServerDB.MongoDB /// 数据源IQueryable /// 分页参数 /// - private static IQueryable GetBasePagination(this IOrderedQueryable source,BasePaginationModel pagination) + private static IQueryable GetBasePagination(this IOrderedQueryable source, BasePaginationModel pagination) { pagination.Total = source.Count(); return source.Skip((pagination.PageNumber - 1) * pagination.PageSize).Take(pagination.PageSize); diff --git a/服务API.Tools/API请求/HttpRequest.cs b/DataVAPI.Tools/API请求/HttpRequest.cs similarity index 91% rename from 服务API.Tools/API请求/HttpRequest.cs rename to DataVAPI.Tools/API请求/HttpRequest.cs index 02b1ae2..060d1cb 100644 --- a/服务API.Tools/API请求/HttpRequest.cs +++ b/DataVAPI.Tools/API请求/HttpRequest.cs @@ -6,7 +6,7 @@ using System.Net; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.API请求 +namespace DataVAPI.Tool.API请求 { /// /// HTTP请求类 @@ -49,7 +49,7 @@ namespace 服务API.Tool.API请求 /// http请求方式:GET/POST /// http请求附带数据 /// - public HttpWebRequest CreateHttpRequest(string url, string requestType, int _timeout = 5000,params object[] strjson) + public HttpWebRequest CreateHttpRequest(string url, string requestType, int _timeout = 5000, params object[] strjson) { HttpWebRequest request = null; const string get = "GET"; @@ -82,7 +82,7 @@ namespace 服务API.Tool.API请求 if (encoding == null || encoding.Length < 1) encoding = "UTF-8"; } - using (StreamReader reader = new StreamReader(response.GetResponseStream(),Encoding.GetEncoding(encoding))) + using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding))) { resultData = reader.ReadToEnd(); } @@ -98,7 +98,7 @@ namespace 服务API.Tool.API请求 /// 请求结果 private static HttpWebRequest CreateGetHttpRequest(string url) { - var getrequest = HttpWebRequest.Create(url) as HttpWebRequest; + var getrequest = WebRequest.Create(url) as HttpWebRequest; getrequest.Method = "GET"; getrequest.Timeout = Timeout; getrequest.ContentType = "application/json;charset=UTF-8"; @@ -114,7 +114,7 @@ namespace 服务API.Tool.API请求 /// 请求结果 private static HttpWebRequest CreatePostHttpRequest(string url, string postData) { - var postrequest = HttpWebRequest.Create(url) as HttpWebRequest; + var postrequest = WebRequest.Create(url) as HttpWebRequest; //postrequest.KeepAlive = false; postrequest.Timeout = Timeout; postrequest.Method = "POST"; @@ -133,16 +133,16 @@ namespace 服务API.Tool.API请求 return postrequest; } - public static HttpWebRequest CreateDeleteHttpRequest(string url,string postJson, int _timeout = 5000) + public static HttpWebRequest CreateDeleteHttpRequest(string url, string postJson, int _timeout = 5000) { - var deleteRequest = HttpWebRequest.Create(url) as HttpWebRequest; + var deleteRequest = WebRequest.Create(url) as HttpWebRequest; deleteRequest.Timeout = _timeout; deleteRequest.Method = "DELETE"; deleteRequest.ContentType = "application/json;charset=UTF-8"; byte[] data = Encoding.UTF8.GetBytes(postJson); using (Stream reqStream = deleteRequest.GetRequestStream()) { - reqStream.Write(data,0,data.Length); + reqStream.Write(data, 0, data.Length); reqStream.Close(); } return deleteRequest; diff --git a/服务API.Tools/API请求/HttpRequestHelper.cs b/DataVAPI.Tools/API请求/HttpRequestHelper.cs similarity index 95% rename from 服务API.Tools/API请求/HttpRequestHelper.cs rename to DataVAPI.Tools/API请求/HttpRequestHelper.cs index d9ce41b..1785860 100644 --- a/服务API.Tools/API请求/HttpRequestHelper.cs +++ b/DataVAPI.Tools/API请求/HttpRequestHelper.cs @@ -6,7 +6,7 @@ using System.Net; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.API请求 +namespace DataVAPI.Tool.API请求 { /// /// 该类实现客户端http 同步请求 @@ -106,7 +106,7 @@ namespace 服务API.Tool.API请求 /// public static string GetHttpGetResponseWithHead(string url, HttpRequestHeader head, string headInfo) { - HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "GET"; request.ContentType = "application/json;charset=UTF-8"; request.Timeout = 6000; @@ -156,12 +156,12 @@ namespace 服务API.Tool.API请求 /// /// /// - public static string HttpPostResponseWithHead(string url, HttpRequestHeader head,string headInfo,string postParam,int Timeout=6000) + public static string HttpPostResponseWithHead(string url, HttpRequestHeader head, string headInfo, string postParam, int Timeout = 6000) { string resultData = string.Empty; try { - var postrequest = HttpWebRequest.Create(url) as HttpWebRequest; + var postrequest = WebRequest.Create(url) as HttpWebRequest; postrequest.Timeout = Timeout; postrequest.Method = "POST"; postrequest.ContentType = "application/json;charset=UTF-8"; diff --git a/服务API.Tools/API请求/HttpResponseStatusBase.cs b/DataVAPI.Tools/API请求/HttpResponseStatusBase.cs similarity index 89% rename from 服务API.Tools/API请求/HttpResponseStatusBase.cs rename to DataVAPI.Tools/API请求/HttpResponseStatusBase.cs index 4455f2e..f5944fc 100644 --- a/服务API.Tools/API请求/HttpResponseStatusBase.cs +++ b/DataVAPI.Tools/API请求/HttpResponseStatusBase.cs @@ -1,8 +1,7 @@ - +using DataVAPI.Tool.IOT; using System; -using 服务API.Tool.IOT; -namespace 服务API.Tool.API请求 +namespace DataVAPI.Tool.API请求 { /// /// Http状态字段基类 @@ -53,28 +52,28 @@ namespace 服务API.Tool.API请求 public int icon { get; set; } - public static JsonMsg OK(T obj,string msg = "接口名称",string mso = "调用接口成功") + public static JsonMsg OK(T obj, string msg = "接口名称", string mso = "调用接口成功") { string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用成功,描述:" + mso + obj}"; ConsoleColor currentForeColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(str); Console.ForegroundColor = currentForeColor; - return new JsonMsg() { code = 1,ms = mso,msg = "成功",obj = obj,icon = 1 }; + return new JsonMsg() { code = 1, ms = mso, msg = "成功", obj = obj, icon = 1 }; } - public static JsonMsg Error(T obj,string msg = "接口名称",string mso = "调用接口成功失败") + public static JsonMsg Error(T obj, string msg = "接口名称", string mso = "调用接口成功失败") { string str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 接口名称为“ {msg + "”调用失败,描述:" + mso + obj}"; ConsoleColor currentForeColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(str); Console.ForegroundColor = currentForeColor; - return new JsonMsg() { code = 0,ms = mso,msg = "失败",obj = obj,icon = 1 }; + return new JsonMsg() { code = 0, ms = mso, msg = "失败", obj = obj, icon = 1 }; } } - public class DeviceTable :BaseEntity + public class DeviceTable : BaseEntity { /// /// 阿里云设备key @@ -106,7 +105,7 @@ namespace 服务API.Tool.API请求 /// /// 告警消息表 /// - public class AlarmTable :BaseEntity + public class AlarmTable : BaseEntity { /// /// 告警时间 @@ -128,7 +127,7 @@ namespace 服务API.Tool.API请求 /// IP 地址 /// public string IP { get; set; } - + public AlarmTable() { IP = Tools.GetLocalIp(); @@ -138,7 +137,7 @@ namespace 服务API.Tool.API请求 /// /// 日志表 /// - public class LogTable :BaseEntity + public class LogTable : BaseEntity { /// /// 日志时间 diff --git a/服务API.Tools/服务API.Tool.csproj b/DataVAPI.Tools/DataVAPI.Tool.csproj similarity index 100% rename from 服务API.Tools/服务API.Tool.csproj rename to DataVAPI.Tools/DataVAPI.Tool.csproj diff --git a/服务API.Tools/Executer.cs b/DataVAPI.Tools/Executer.cs similarity index 84% rename from 服务API.Tools/Executer.cs rename to DataVAPI.Tools/Executer.cs index 53adcc8..06a6aa9 100644 --- a/服务API.Tools/Executer.cs +++ b/DataVAPI.Tools/Executer.cs @@ -5,22 +5,22 @@ using System.Linq; using System.Threading; -namespace 服务API.Tool +namespace DataVAPI.Tool { /// /// 线程集中处理委托 /// /// public delegate void ActionKeyHandle(string action); - public delegate void ThreadExceptionHandle(string action,Exception ex); + public delegate void ThreadExceptionHandle(string action, Exception ex); public delegate void ThreadExitHandle(string action); /// /// 执行器 /// - public class Executer :Singleton + public class Executer : Singleton { private System.Timers.Timer _timer4Monitor = new System.Timers.Timer(1000); - private ConcurrentDictionary _actions = new ConcurrentDictionary(); + private ConcurrentDictionary _actions = new ConcurrentDictionary(); private object _async = new object(); public event ThreadExceptionHandle OnThreadException; public event ThreadExitHandle ThreadExit; @@ -49,7 +49,7 @@ namespace 服务API.Tool /// public List GetActionInfos() { - Monitor.TryEnter(_async,200); + Monitor.TryEnter(_async, 200); var actionInfos = _actions.Values.ToList(); Monitor.Exit(_async); return actionInfos; @@ -62,7 +62,7 @@ namespace 服务API.Tool /// public void Abort(string key) { - Monitor.TryEnter(_async,200); + Monitor.TryEnter(_async, 200); if (_actions.ContainsKey(key)) { try { _actions[key].Abort(); } @@ -77,7 +77,7 @@ namespace 服务API.Tool /// public bool ContainsKey(string key) { - Monitor.TryEnter(_async,200); + Monitor.TryEnter(_async, 200); var item = _actions[key]; Monitor.Exit(_async); if (null != item) @@ -93,7 +93,7 @@ namespace 服务API.Tool /// /// /// - public void Start(Action action,string name,bool isBackground = false,ThreadPriority priority = ThreadPriority.Normal) + public void Start(Action action, string name, bool isBackground = false, ThreadPriority priority = ThreadPriority.Normal) { Thread thread = new Thread(() => { @@ -104,14 +104,14 @@ namespace 服务API.Tool } catch (Exception ex) { - OnThreadException?.Invoke(name,ex); + OnThreadException?.Invoke(name, ex); } }); thread.IsBackground = isBackground; thread.Priority = priority; thread.Name = name; thread.Start(); - Monitor.TryEnter(_async,50); + Monitor.TryEnter(_async, 50); if (_actions.ContainsKey(name)) { try { _actions[name].Abort(); } @@ -126,7 +126,7 @@ namespace 服务API.Tool /// /// /// - public bool StartWhiteReturn(Func action,int timeout = 3) + public bool StartWhiteReturn(Func action, int timeout = 3) { DateTime beginTime = DateTime.Now; bool doResult = false; diff --git a/服务API.Tools/IOT/CommandModel.cs b/DataVAPI.Tools/IOT/CommandModel.cs similarity index 86% rename from 服务API.Tools/IOT/CommandModel.cs rename to DataVAPI.Tools/IOT/CommandModel.cs index ed3578e..b48fea5 100644 --- a/服务API.Tools/IOT/CommandModel.cs +++ b/DataVAPI.Tools/IOT/CommandModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.IOT +namespace DataVAPI.Tool.IOT { /// /// 命令实体类 @@ -22,6 +22,6 @@ namespace 服务API.Tool.IOT /// /// 命令变量:执行变量 key为属性或时间 value为值或者消息 /// - public Dictionary CommandValue { get; set; } + public Dictionary CommandValue { get; set; } } } diff --git a/服务API.Tools/IOT/IOTDevModel.cs b/DataVAPI.Tools/IOT/IOTDevModel.cs similarity index 91% rename from 服务API.Tools/IOT/IOTDevModel.cs rename to DataVAPI.Tools/IOT/IOTDevModel.cs index 2f8e361..b118657 100644 --- a/服务API.Tools/IOT/IOTDevModel.cs +++ b/DataVAPI.Tools/IOT/IOTDevModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.IOT +namespace DataVAPI.Tool.IOT { /// /// IOT Model @@ -98,7 +98,7 @@ namespace 服务API.Tool.IOT try { IotModel iotModel = new IotModel { @params = this }; - string json = Tools.JsonConvertTools>(iotModel); + string json = Tools.JsonConvertTools(iotModel); return json; } catch (Exception ex) @@ -115,7 +115,7 @@ namespace 服务API.Tool.IOT { try { - JBSX = Tools.JsonConvertTools(devSX); + JBSX = Tools.JsonConvertTools(devSX); } catch (Exception ex) { @@ -127,19 +127,20 @@ namespace 服务API.Tool.IOT /// /// /// - public void SetJBSXStatus(DevSXBase sXBase,bool Status) + public void SetJBSXStatus(DevSXBase sXBase, bool Status) { try { if (sXBase == null) return; - DevSX dev= Tools.JsonToObjectTools(JBSX); - dev.data?.ForEach(x => { + DevSX dev = Tools.JsonToObjectTools(JBSX); + dev.data?.ForEach(x => + { if (x.SXMC == sXBase.SXMC && x.SXLX == sXBase.SXLX) { - x.SXStatus= Status; + x.SXStatus = Status; } }); - JBSX = Tools.JsonConvertTools(dev); + JBSX = Tools.JsonConvertTools(dev); } catch (Exception ex) { @@ -154,7 +155,7 @@ namespace 服务API.Tool.IOT { try { - KZSX = Tools.JsonConvertTools(devSX); + KZSX = Tools.JsonConvertTools(devSX); } catch (Exception ex) { @@ -172,13 +173,14 @@ namespace 服务API.Tool.IOT { if (sXBase == null) return; DevSX dev = Tools.JsonToObjectTools(KZSX); - dev.data?.ForEach(x => { + dev.data?.ForEach(x => + { if (x.SXMC == sXBase.SXMC && x.SXLX == sXBase.SXLX) { x.SXStatus = Status; } }); - KZSX = Tools.JsonConvertTools(dev); + KZSX = Tools.JsonConvertTools(dev); } catch (Exception ex) { @@ -196,7 +198,7 @@ namespace 服务API.Tool.IOT /// /// 告警Model /// - public class AlarmModel :DeviceBase + public class AlarmModel : DeviceBase { /// /// 告警程度:提示 一般 严重 @@ -207,9 +209,9 @@ namespace 服务API.Tool.IOT set { _AlarmCD = value; - if (_AlarmCD == "提示") DeviceColor = new ALYColor { r = 13,g = 254,b = 73,a = 1 }; - else if (_AlarmCD == "一般") DeviceColor = new ALYColor { r = 245,g = 216,b = 13,a = 1 }; - else if (_AlarmCD == "严重") DeviceColor = new ALYColor { r = 245,g = 13,b = 13,a = 1 }; + if (_AlarmCD == "提示") DeviceColor = new ALYColor { r = 13, g = 254, b = 73, a = 1 }; + else if (_AlarmCD == "一般") DeviceColor = new ALYColor { r = 245, g = 216, b = 13, a = 1 }; + else if (_AlarmCD == "严重") DeviceColor = new ALYColor { r = 245, g = 13, b = 13, a = 1 }; } } private string _AlarmCD { get; set; } diff --git a/服务API.Tools/IOT/IOTDevServer.cs b/DataVAPI.Tools/IOT/IOTDevServer.cs similarity index 87% rename from 服务API.Tools/IOT/IOTDevServer.cs rename to DataVAPI.Tools/IOT/IOTDevServer.cs index 18f762b..9018c7f 100644 --- a/服务API.Tools/IOT/IOTDevServer.cs +++ b/DataVAPI.Tools/IOT/IOTDevServer.cs @@ -1,4 +1,5 @@  +using DataVAPI.Tool.API请求; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -10,9 +11,8 @@ using System.Text; using System.Threading; using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt.Messages; -using 服务API.Tool.API请求; -namespace 服务API.Tool.IOT +namespace DataVAPI.Tool.IOT { /// /// add fengyoufu @@ -36,7 +36,7 @@ namespace 服务API.Tool.IOT /// /// 设备消息数据回调 /// - public static Action DevIOTAction { get; set; } + public static Action DevIOTAction { get; set; } /// /// 重连事件 /// @@ -124,7 +124,7 @@ namespace 服务API.Tool.IOT /// /// /// - public void Set(string _ProductKey,string _DeviceName,string _DeviceSecret,string _RegionId = "cn-shanghai") + public void Set(string _ProductKey, string _DeviceName, string _DeviceSecret, string _RegionId = "cn-shanghai") { ProductKey = _ProductKey; DeviceName = _DeviceName; @@ -146,7 +146,7 @@ namespace 服务API.Tool.IOT /// 创建连接 /// /// - public bool CreateLinks(int ClientId,out DeviceTable device) + public bool CreateLinks(int ClientId, out DeviceTable device) { try { @@ -156,27 +156,27 @@ namespace 服务API.Tool.IOT if (jsonMsg.obj != null) { device = jsonMsg.obj.FirstOrDefault(); - if(device==null)return false; + if (device == null) return false; - Set(device.productkey,device.devicename,device.devicesecret); + Set(device.productkey, device.devicename, device.devicesecret); IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName()); string clientId = host.AddressList.FirstOrDefault( - ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToString(); + ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString(); string t = Convert.ToString(DateTimeOffset.Now.ToUnixTimeMilliseconds()); string signmethod = "hmacmd5"; - Dictionary dict = new Dictionary(); - dict.Add("productKey",ProductKey); - dict.Add("deviceName",DeviceName); - dict.Add("clientId",clientId); - dict.Add("timestamp",t); + Dictionary dict = new Dictionary(); + dict.Add("productKey", ProductKey); + dict.Add("deviceName", DeviceName); + dict.Add("clientId", clientId); + dict.Add("timestamp", t); mqttUserName = DeviceName + "&" + ProductKey; - mqttPassword = IotSignUtils.sign(dict,DeviceSecret,signmethod); + mqttPassword = IotSignUtils.sign(dict, DeviceSecret, signmethod); mqttClientId = clientId + "|securemode=3,signmethod=" + signmethod + ",timestamp=" + t + "|"; targetServer = ProductKey + ".iot-as-mqtt." + RegionId + ".aliyuncs.com"; - ConnectMqtt(targetServer,mqttClientId,mqttUserName,mqttPassword); + ConnectMqtt(targetServer, mqttClientId, mqttUserName, mqttPassword); return true; } else @@ -228,9 +228,9 @@ namespace 服务API.Tool.IOT /// /// /// - public void IOT_Publish(string topic,string message) + public void IOT_Publish(string topic, string message) { - var id = client.Publish(topic,Encoding.UTF8.GetBytes(message)); + var id = client.Publish(topic, Encoding.UTF8.GetBytes(message)); } /// @@ -243,7 +243,7 @@ namespace 服务API.Tool.IOT { SubTopicList.Add(topic); } - client.Subscribe(new string[] { topic },new byte[] { 0 }); + client.Subscribe(new string[] { topic }, new byte[] { 0 }); } #endregion @@ -255,11 +255,11 @@ namespace 服务API.Tool.IOT /// /// /// - private void ConnectMqtt(string targetServer,string mqttClientId,string mqttUserName,string mqttPassword) + private void ConnectMqtt(string targetServer, string mqttClientId, string mqttUserName, string mqttPassword) { client = new MqttClient(targetServer); client.ProtocolVersion = MqttProtocolVersion.Version_3_1_1; - client.Connect(mqttClientId,mqttUserName,mqttPassword,false,60); + client.Connect(mqttClientId, mqttUserName, mqttPassword, false, 60); client.MqttMsgPublishReceived += Client_MqttMsgPublishReceived; client.ConnectionClosed += Client_ConnectionClosed; } @@ -269,7 +269,7 @@ namespace 服务API.Tool.IOT /// /// /// - private static void Client_ConnectionClosed(object sender,EventArgs e) + private static void Client_ConnectionClosed(object sender, EventArgs e) { // 尝试重连 _TryContinueConnect(); @@ -280,13 +280,13 @@ namespace 服务API.Tool.IOT /// /// /// - private static void Client_MqttMsgPublishReceived(object sender,MqttMsgPublishEventArgs e) + private static void Client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) { string topic = e.Topic; string message = Encoding.UTF8.GetString(e.Message); if (DevIOTAction != null) { - DevIOTAction.Invoke(topic,message); + DevIOTAction.Invoke(topic, message); } } @@ -305,14 +305,14 @@ namespace 服务API.Tool.IOT { client = new MqttClient(targetServer); client.ProtocolVersion = MqttProtocolVersion.Version_3_1_1; - client.Connect(mqttClientId,mqttUserName,mqttPassword,false,60); + client.Connect(mqttClientId, mqttUserName, mqttPassword, false, 60); client.MqttMsgPublishReceived += Client_MqttMsgPublishReceived; client.ConnectionClosed += Client_ConnectionClosed; if (client.IsConnected) { - IOTDevServer.SubTopicList.ForEach(par => + SubTopicList.ForEach(par => { - client.Subscribe(new string[] { par },new byte[] { 0 }); + client.Subscribe(new string[] { par }, new byte[] { 0 }); }); } Thread.Sleep(3000); @@ -321,12 +321,12 @@ namespace 服务API.Tool.IOT try { - client.Connect(mqttClientId,mqttUserName,mqttPassword,false,60); + client.Connect(mqttClientId, mqttUserName, mqttPassword, false, 60); if (client.IsConnected) { - IOTDevServer.SubTopicList.ForEach(par => + SubTopicList.ForEach(par => { - client.Subscribe(new string[] { par },new byte[] { 0 }); + client.Subscribe(new string[] { par }, new byte[] { 0 }); }); UNConnectMqtt?.Invoke("重新连接阿里云MQTT成功!"); } @@ -353,8 +353,8 @@ namespace 服务API.Tool.IOT /// public class IotSignUtils { - public static string sign(Dictionary param, - string deviceSecret,string signMethod) + public static string sign(Dictionary param, + string deviceSecret, string signMethod) { string[] sortedKey = param.Keys.ToArray(); Array.Sort(sortedKey); @@ -373,7 +373,7 @@ namespace 服务API.Tool.IOT StringBuilder signBuilder = new StringBuilder(); foreach (byte b in hashBytes) - signBuilder.AppendFormat("{0:x2}",b); + signBuilder.AppendFormat("{0:x2}", b); return signBuilder.ToString(); } @@ -415,10 +415,10 @@ namespace 服务API.Tool.IOT /// public static long ConvertDateTimeToLong(DateTime dt) { - DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1)); + DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); TimeSpan toNow = dt.Subtract(dtStart); long timeStamp = toNow.Ticks; - timeStamp = long.Parse(timeStamp.ToString().Substring(0,timeStamp.ToString().Length - 4)); + timeStamp = long.Parse(timeStamp.ToString().Substring(0, timeStamp.ToString().Length - 4)); return timeStamp; } @@ -429,7 +429,7 @@ namespace 服务API.Tool.IOT /// public static DateTime ConvertLongToDateTime(long d) { - DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1)); + DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(d + "0000"); TimeSpan toNow = new TimeSpan(lTime); DateTime dtResult = dtStart.Add(toNow); diff --git a/服务API.Tools/IOT/ScreenMonitorModel.cs b/DataVAPI.Tools/IOT/ScreenMonitorModel.cs similarity index 95% rename from 服务API.Tools/IOT/ScreenMonitorModel.cs rename to DataVAPI.Tools/IOT/ScreenMonitorModel.cs index 8e23455..21933f4 100644 --- a/服务API.Tools/IOT/ScreenMonitorModel.cs +++ b/DataVAPI.Tools/IOT/ScreenMonitorModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.IOT +namespace DataVAPI.Tool.IOT { /// @@ -32,7 +32,7 @@ namespace 服务API.Tool.IOT { try { - return Tools.JsonConvertTools(this); + return Tools.JsonConvertTools(this); } catch (Exception ex) { @@ -121,7 +121,7 @@ namespace 服务API.Tool.IOT } } - + /// /// 通知消息 /// @@ -165,8 +165,8 @@ namespace 服务API.Tool.IOT set { _IsAlarm = value; - if (_IsAlarm) AlarmColor = new ALYColor { r = 245,g = 13,b = 13,a = 1 }; - else AlarmColor = new ALYColor { r = 245,g = 13,b = 13,a =0 }; + if (_IsAlarm) AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 1 }; + else AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 0 }; } } private bool _IsAlarm { get; set; } @@ -185,8 +185,8 @@ namespace 服务API.Tool.IOT public DevStatus() { IsAlarm = false; - AlarmColor = new ALYColor { r = 245,g = 13,b = 13,a = 0 }; - DeviceColor = new ALYColor { r = 249,g = 191,b = 0,a = 1 }; + AlarmColor = new ALYColor { r = 245, g = 13, b = 13, a = 0 }; + DeviceColor = new ALYColor { r = 249, g = 191, b = 0, a = 1 }; } /// /// 设置属性 diff --git a/服务API.Tools/Singleton.cs b/DataVAPI.Tools/Singleton.cs similarity index 97% rename from 服务API.Tools/Singleton.cs rename to DataVAPI.Tools/Singleton.cs index 3600d7d..e689642 100644 --- a/服务API.Tools/Singleton.cs +++ b/DataVAPI.Tools/Singleton.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool +namespace DataVAPI.Tool { /// /// 单例对象基类 diff --git a/服务API.Tools/控制台显示/ConsoleHelper.cs b/DataVAPI.Tools/控制台显示/ConsoleHelper.cs similarity index 67% rename from 服务API.Tools/控制台显示/ConsoleHelper.cs rename to DataVAPI.Tools/控制台显示/ConsoleHelper.cs index b4c6374..c715dce 100644 --- a/服务API.Tools/控制台显示/ConsoleHelper.cs +++ b/DataVAPI.Tools/控制台显示/ConsoleHelper.cs @@ -4,14 +4,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务API.Tool.控制台显示 +namespace DataVAPI.Tool.控制台显示 { /// /// 控制台帮助类 /// public static class ConsoleHelper { - static void WriteColorLine(string str,ConsoleColor color) + static void WriteColorLine(string str, ConsoleColor color) { str = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} {str}"; ConsoleColor currentForeColor = Console.ForegroundColor; @@ -24,36 +24,36 @@ namespace 服务API.Tool.控制台显示 /// /// 待打印的字符串 /// 想要打印的颜色 - public static void WriteErrorLine(this string str,ConsoleColor color = ConsoleColor.Red) + public static void WriteErrorLine(this string str, ConsoleColor color = ConsoleColor.Red) { - WriteColorLine(str,color); + WriteColorLine(str, color); } /// /// 打印警告信息 /// /// 待打印的字符串 /// 想要打印的颜色 - public static void WriteWarningLine(this string str,ConsoleColor color = ConsoleColor.Yellow) + public static void WriteWarningLine(this string str, ConsoleColor color = ConsoleColor.Yellow) { - WriteColorLine(str,color); + WriteColorLine(str, color); } /// /// 打印正常信息 /// /// 待打印的字符串 /// 想要打印的颜色 - public static void WriteInfoLine(this string str,ConsoleColor color = ConsoleColor.Green) + public static void WriteInfoLine(this string str, ConsoleColor color = ConsoleColor.Green) { - WriteColorLine(str,color); + WriteColorLine(str, color); } /// /// 打印成功的信息 /// /// 待打印的字符串 /// 想要打印的颜色 - public static void WriteSuccessLine(this string str,ConsoleColor color = ConsoleColor.Magenta) + public static void WriteSuccessLine(this string str, ConsoleColor color = ConsoleColor.Magenta) { - WriteColorLine(str,color); + WriteColorLine(str, color); } } } diff --git a/DataVAPI.sln b/DataVAPI.sln new file mode 100644 index 0000000..a5d5eb7 --- /dev/null +++ b/DataVAPI.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32210.238 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVIOT.Help", "IOT.Help\DataVIOT.Help.csproj", "{302A05E0-4AA1-4655-AE4B-0826B2C55EB9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVAPI", "DataVAPI\DataVAPI.csproj", "{FC535CBE-E799-41DD-83B6-79DC9F400A46}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVAPI.Model", "DataVAPI.Model\DataVAPI.Model.csproj", "{A5F32B66-9528-4DA7-84C1-0611BE65757F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVApi.Order", "DataVApi.Order\DataVApi.Order.csproj", "{43B0F1B2-E1AB-4714-B5CD-B3F9D5ECDCAB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVAPI.ProcessServices", "DataVAPI.ProcessServices\DataVAPI.ProcessServices.csproj", "{849D3E3C-1296-4383-8B51-D35737B92DFE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVAPI.ServerDB", "DataVAPI.ServerDB\DataVAPI.ServerDB.csproj", "{EA6E3A76-591F-4170-A3D7-B48A09E1C2ED}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataVAPI.Tool", "DataVAPI.Tools\DataVAPI.Tool.csproj", "{B8B324F6-068C-4E6B-820F-0447524F7760}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Release|Any CPU.Build.0 = Release|Any CPU + {FC535CBE-E799-41DD-83B6-79DC9F400A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC535CBE-E799-41DD-83B6-79DC9F400A46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC535CBE-E799-41DD-83B6-79DC9F400A46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC535CBE-E799-41DD-83B6-79DC9F400A46}.Release|Any CPU.Build.0 = Release|Any CPU + {A5F32B66-9528-4DA7-84C1-0611BE65757F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5F32B66-9528-4DA7-84C1-0611BE65757F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5F32B66-9528-4DA7-84C1-0611BE65757F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5F32B66-9528-4DA7-84C1-0611BE65757F}.Release|Any CPU.Build.0 = Release|Any CPU + {43B0F1B2-E1AB-4714-B5CD-B3F9D5ECDCAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43B0F1B2-E1AB-4714-B5CD-B3F9D5ECDCAB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43B0F1B2-E1AB-4714-B5CD-B3F9D5ECDCAB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43B0F1B2-E1AB-4714-B5CD-B3F9D5ECDCAB}.Release|Any CPU.Build.0 = Release|Any CPU + {849D3E3C-1296-4383-8B51-D35737B92DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {849D3E3C-1296-4383-8B51-D35737B92DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {849D3E3C-1296-4383-8B51-D35737B92DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {849D3E3C-1296-4383-8B51-D35737B92DFE}.Release|Any CPU.Build.0 = Release|Any CPU + {EA6E3A76-591F-4170-A3D7-B48A09E1C2ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA6E3A76-591F-4170-A3D7-B48A09E1C2ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA6E3A76-591F-4170-A3D7-B48A09E1C2ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA6E3A76-591F-4170-A3D7-B48A09E1C2ED}.Release|Any CPU.Build.0 = Release|Any CPU + {B8B324F6-068C-4E6B-820F-0447524F7760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8B324F6-068C-4E6B-820F-0447524F7760}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8B324F6-068C-4E6B-820F-0447524F7760}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8B324F6-068C-4E6B-820F-0447524F7760}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5E3567E1-6440-428F-A2E2-A7CF6A1EF45A} + EndGlobalSection +EndGlobal diff --git a/服务API/.config/dotnet-tools.json b/DataVAPI/.config/dotnet-tools.json similarity index 100% rename from 服务API/.config/dotnet-tools.json rename to DataVAPI/.config/dotnet-tools.json diff --git a/服务API/AppConfig/AppConfigurtaionServices.cs b/DataVAPI/AppConfig/AppConfigurtaionServices.cs similarity index 76% rename from 服务API/AppConfig/AppConfigurtaionServices.cs rename to DataVAPI/AppConfig/AppConfigurtaionServices.cs index b655373..af00a0f 100644 --- a/服务API/AppConfig/AppConfigurtaionServices.cs +++ b/DataVAPI/AppConfig/AppConfigurtaionServices.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Configuration.Json; using System; -namespace 服务API.AppConfig +namespace DataVAPI.AppConfig { public class AppConfigurtaionServices { @@ -17,8 +17,8 @@ namespace 服务API.AppConfig .Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true }) .Build(); - DataBus.DataBus.connStr = AppConfigurtaionServices.Configuration.GetSection("mongoDB:connStr").Value; - DataBus.DataBus.dbName = AppConfigurtaionServices.Configuration.GetSection("mongoDB:dbName").Value; + DataBus.connStr = Configuration.GetSection("mongoDB:connStr").Value; + DataBus.dbName = Configuration.GetSection("mongoDB:dbName").Value; } } diff --git a/服务API/ConfigureSwagger/ConfigureSwagger.cs b/DataVAPI/ConfigureSwagger/ConfigureSwagger.cs similarity index 97% rename from 服务API/ConfigureSwagger/ConfigureSwagger.cs rename to DataVAPI/ConfigureSwagger/ConfigureSwagger.cs index 57d5d6d..b70e072 100644 --- a/服务API/ConfigureSwagger/ConfigureSwagger.cs +++ b/DataVAPI/ConfigureSwagger/ConfigureSwagger.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.OpenApi.Models; -namespace 服务API.ConfigureSwagger +namespace DataVAPI.ConfigureSwagger { public static class ConfigureSwagger { diff --git a/服务API/Controllers/AlarmController.cs b/DataVAPI/Controllers/AlarmController.cs similarity index 69% rename from 服务API/Controllers/AlarmController.cs rename to DataVAPI/Controllers/AlarmController.cs index 35988fb..b39b6a7 100644 --- a/服务API/Controllers/AlarmController.cs +++ b/DataVAPI/Controllers/AlarmController.cs @@ -1,19 +1,19 @@ -using Microsoft.AspNetCore.Mvc; +using DataVAPI.Model; +using DataVAPI.ServerDB.MongoDB; +using DataVAPI.Tool.IOT; +using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using 服务API.Model; -using 服务API.ServerDB.MongoDB; -using 服务API.Tool.IOT; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// MG数据库:告警表 AlarmTable /// - public class AlarmController :BaseController + public class AlarmController : BaseController { - MongoDbHelper mg = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); - MongoDbHelper mgsb = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); + MongoDbHelper mg = new MongoDbHelper(DataBus.connStr, DataBus.dbName); + MongoDbHelper mgsb = new MongoDbHelper(DataBus.connStr, DataBus.dbName); string st = System.Reflection.MethodBase.GetCurrentMethod().Name; @@ -28,14 +28,14 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(auth.ClientId)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } mg.Insert(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -49,11 +49,11 @@ namespace 服务API.Controllers try { mg.Inserts(auth); - return JsonMsg>.OK(auth,st); + return JsonMsg>.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -68,11 +68,11 @@ namespace 服务API.Controllers try { mg.Update(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -86,11 +86,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg.OK(mg.QueryOne(id),st); + return JsonMsg.OK(mg.QueryOne(id), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -104,11 +104,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryClientId(clientId),st); + return JsonMsg>.OK(mg.QueryClientId(clientId), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -117,16 +117,16 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> QueryDeviceId(string clientId,string deviceId) + public JsonMsg> QueryDeviceId(string clientId, string deviceId) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - if(string.IsNullOrEmpty(clientId)) + if (string.IsNullOrEmpty(clientId)) return JsonMsg>.Error(null, st, "客户端ID不能为空"); ; - return JsonMsg>.OK(mg.QueryDeviceId(clientId,deviceId), st); + return JsonMsg>.OK(mg.QueryDeviceId(clientId, deviceId), st); } - catch (System.Exception ex) + catch (Exception ex) { return JsonMsg>.Error(null, st, ex.Message); } @@ -137,30 +137,30 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> QueryDeviceName(string DeviceName,string StartTime,string StopTime) + public JsonMsg> QueryDeviceName(string DeviceName, string StartTime, string StopTime) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - DeviceTable device= mgsb.QueryDeviceName(DeviceName); + DeviceTable device = mgsb.QueryDeviceName(DeviceName); //ConsoleHelper.WriteSuccessLine(Tools.JsonConvertTools(device)+ " "+Time); if (device != null) { if (!string.IsNullOrEmpty(StartTime) && !string.IsNullOrEmpty(StopTime)) { - DateTime starttime,stoptime; + DateTime starttime, stoptime; starttime = Tools.ConvertLongToDateTime(long.Parse(StartTime)); stoptime = Tools.ConvertLongToDateTime(long.Parse(StopTime)); - return JsonMsg>.OK(mg.QueryAllTime(device.ClientId,starttime,stoptime),st); + return JsonMsg>.OK(mg.QueryAllTime(device.ClientId, starttime, stoptime), st); } - else return JsonMsg>.OK(mg.QueryClientId(device.ClientId),st); + else return JsonMsg>.OK(mg.QueryClientId(device.ClientId), st); } - return JsonMsg>.OK(null,st); + return JsonMsg>.OK(null, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -171,16 +171,16 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> Query(string clientId,DateTime datesta,DateTime datastop) + public JsonMsg> Query(string clientId, DateTime datesta, DateTime datastop) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryAllTime(clientId,datesta,datastop),st); + return JsonMsg>.OK(mg.QueryAllTime(clientId, datesta, datastop), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -193,16 +193,16 @@ namespace 服务API.Controllers /// 大小 /// [HttpGet] - public JsonMsg> BasePagQuery(string clientId,DateTime datesta,DateTime datastop,int PageNumber=1,int PageSize=100) + public JsonMsg> BasePagQuery(string clientId, DateTime datesta, DateTime datastop, int PageNumber = 1, int PageSize = 100) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.BasePagQuery(clientId,datesta,datastop,PageNumber,PageSize),st); + return JsonMsg>.OK(mg.BasePagQuery(clientId, datesta, datastop, PageNumber, PageSize), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -218,17 +218,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { - mg.Modify(id,"State","n"); - return JsonMsg.OK("success!",st); + mg.Modify(id, "State", "n"); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -244,17 +244,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { mg.Delete(id); - return JsonMsg.OK("success!",st); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } } diff --git a/服务API/Controllers/BaseController.cs b/DataVAPI/Controllers/BaseController.cs similarity index 90% rename from 服务API/Controllers/BaseController.cs rename to DataVAPI/Controllers/BaseController.cs index 33816d1..b065442 100644 --- a/服务API/Controllers/BaseController.cs +++ b/DataVAPI/Controllers/BaseController.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// 自定义路由 基类 diff --git a/服务API/Controllers/DeviceController.cs b/DataVAPI/Controllers/DeviceController.cs similarity index 67% rename from 服务API/Controllers/DeviceController.cs rename to DataVAPI/Controllers/DeviceController.cs index 3a8d6fd..8aa330c 100644 --- a/服务API/Controllers/DeviceController.cs +++ b/DataVAPI/Controllers/DeviceController.cs @@ -1,18 +1,16 @@ -using Microsoft.AspNetCore.Mvc; +using DataVAPI.Model; +using DataVAPI.ServerDB.MongoDB; +using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using 服务API.AppConfig; -using 服务API.Model; -using 服务API.ServerDB.MongoDB; - -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// MG数据库:设备信息表 DeviceTable /// - public class DeviceController :BaseController + public class DeviceController : BaseController { - MongoDbHelper mg = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); + MongoDbHelper mg = new MongoDbHelper(DataBus.connStr, DataBus.dbName); string st = System.Reflection.MethodBase.GetCurrentMethod().Name; @@ -27,14 +25,14 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(auth.ClientId)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } mg.Insert(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -47,11 +45,11 @@ namespace 服务API.Controllers try { mg.Inserts(auth); - return JsonMsg>.OK(auth,st); + return JsonMsg>.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -64,11 +62,11 @@ namespace 服务API.Controllers try { mg.UpdateID(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -81,11 +79,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg.OK(mg.QueryOne(id),st); + return JsonMsg.OK(mg.QueryOne(id), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -96,16 +94,16 @@ namespace 服务API.Controllers /// 结束时间 /// [HttpGet] - public JsonMsg> Query(string clientId,DateTime starttime,DateTime endtime) + public JsonMsg> Query(string clientId, DateTime starttime, DateTime endtime) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryAllTime(clientId,starttime,endtime),st); + return JsonMsg>.OK(mg.QueryAllTime(clientId, starttime, endtime), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -118,16 +116,16 @@ namespace 服务API.Controllers /// 每页大小 /// [HttpGet] - public JsonMsg> BasePagQuery(string clientId,DateTime starttime,DateTime endtime,int PageNumber = 1,int PageSize = 100) + public JsonMsg> BasePagQuery(string clientId, DateTime starttime, DateTime endtime, int PageNumber = 1, int PageSize = 100) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.BasePagQuery(clientId,starttime,endtime,PageNumber,PageSize),st); + return JsonMsg>.OK(mg.BasePagQuery(clientId, starttime, endtime, PageNumber, PageSize), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -142,17 +140,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { - mg.Modify(id,"State","n"); - return JsonMsg.OK("success!",st); + mg.Modify(id, "State", "n"); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -167,17 +165,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { mg.Delete(id); - return JsonMsg.OK("success!",st); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } } diff --git a/服务API/Controllers/LogController.cs b/DataVAPI/Controllers/LogController.cs similarity index 70% rename from 服务API/Controllers/LogController.cs rename to DataVAPI/Controllers/LogController.cs index 700b99d..8edc649 100644 --- a/服务API/Controllers/LogController.cs +++ b/DataVAPI/Controllers/LogController.cs @@ -1,20 +1,20 @@ -using Microsoft.AspNetCore.Mvc; +using DataVAPI.Model; +using DataVAPI.ServerDB.MongoDB; +using DataVAPI.Tool.IOT; +using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using 服务API.Model; -using 服务API.ServerDB.MongoDB; -using 服务API.Tool.IOT; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// MG数据库:日志表 LogTable /// - public class LogController :BaseController + public class LogController : BaseController { - MongoDbHelper mg = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); - MongoDbHelper mgsb = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); + MongoDbHelper mg = new MongoDbHelper(DataBus.connStr, DataBus.dbName); + MongoDbHelper mgsb = new MongoDbHelper(DataBus.connStr, DataBus.dbName); string st = System.Reflection.MethodBase.GetCurrentMethod().Name; @@ -29,14 +29,14 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(auth.ClientId)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } mg.Insert(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -50,11 +50,11 @@ namespace 服务API.Controllers try { mg.Inserts(auth); - return JsonMsg>.OK(auth,st); + return JsonMsg>.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -69,11 +69,11 @@ namespace 服务API.Controllers try { mg.Update(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -87,11 +87,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg.OK(mg.QueryOne(id),st); + return JsonMsg.OK(mg.QueryOne(id), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -105,11 +105,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryClientId(clientId),st); + return JsonMsg>.OK(mg.QueryClientId(clientId), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -118,7 +118,7 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> QueryDeviceName(string DeviceName,string StartTime,string StopTime) + public JsonMsg> QueryDeviceName(string DeviceName, string StartTime, string StopTime) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try @@ -131,15 +131,15 @@ namespace 服务API.Controllers DateTime starttime, stoptime; starttime = Tools.ConvertLongToDateTime(long.Parse(StartTime)); stoptime = Tools.ConvertLongToDateTime(long.Parse(StopTime)); - return JsonMsg>.OK(mg.QueryAllTime(device.ClientId,starttime,stoptime),st); + return JsonMsg>.OK(mg.QueryAllTime(device.ClientId, starttime, stoptime), st); } - else return JsonMsg>.OK(mg.QueryClientId(device.ClientId),st); + else return JsonMsg>.OK(mg.QueryClientId(device.ClientId), st); } - return JsonMsg>.OK(null,st); + return JsonMsg>.OK(null, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -150,16 +150,16 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> Query(string clientId,DateTime datesta,DateTime datastop) + public JsonMsg> Query(string clientId, DateTime datesta, DateTime datastop) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryAllTime(clientId,datesta,datastop),st); + return JsonMsg>.OK(mg.QueryAllTime(clientId, datesta, datastop), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -172,16 +172,16 @@ namespace 服务API.Controllers /// /// [HttpGet] - public JsonMsg> BasePagQuery(string clientId,DateTime datesta,DateTime datastop,int PageNumber = 1,int PageSize = 100) + public JsonMsg> BasePagQuery(string clientId, DateTime datesta, DateTime datastop, int PageNumber = 1, int PageSize = 100) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.BasePagQuery(clientId,datesta,datastop,PageNumber,PageSize),st); + return JsonMsg>.OK(mg.BasePagQuery(clientId, datesta, datastop, PageNumber, PageSize), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -197,17 +197,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { - mg.Modify(id,"State","n"); - return JsonMsg.OK("success!",st); + mg.Modify(id, "State", "n"); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -223,17 +223,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"设备ID不能为空"); ; + return JsonMsg.Error(null, st, "设备ID不能为空"); ; } else { mg.Delete(id); - return JsonMsg.OK("success!",st); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } } diff --git a/服务API/Controllers/OrderController.cs b/DataVAPI/Controllers/OrderController.cs similarity index 68% rename from 服务API/Controllers/OrderController.cs rename to DataVAPI/Controllers/OrderController.cs index 0b8eaab..faec277 100644 --- a/服务API/Controllers/OrderController.cs +++ b/DataVAPI/Controllers/OrderController.cs @@ -1,17 +1,17 @@ -using Microsoft.AspNetCore.Mvc; -using 服务Api.Order; -using 服务Api.Order.RequestModel; -using 服务API.Model; +using DataVApi.Order; +using DataVApi.Order.RequestModel; +using DataVAPI.Model; +using Microsoft.AspNetCore.Mvc; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// 订单接口:统计订单或者营业额 /// - public class OrderController :BaseController + public class OrderController : BaseController { string st = System.Reflection.MethodBase.GetCurrentMethod().Name; - OrderProvider orderProvider=new OrderProvider(); + OrderProvider orderProvider = new OrderProvider(); /// /// 全部数据 /// @@ -21,12 +21,12 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - object retdata= orderProvider.GetAllOrderDataState(auth); - return JsonMsg.OK(retdata,st); + object retdata = orderProvider.GetAllOrderDataState(auth); + return JsonMsg.OK(retdata, st); } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } @@ -40,11 +40,11 @@ namespace 服务API.Controllers try { object retdata = orderProvider.OrderLine(auth); - return JsonMsg.OK(retdata,st); + return JsonMsg.OK(retdata, st); } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } @@ -58,11 +58,11 @@ namespace 服务API.Controllers try { object retdata = orderProvider.GetLocSale(); - return JsonMsg.OK(retdata,st); + return JsonMsg.OK(retdata, st); } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } @@ -76,11 +76,11 @@ namespace 服务API.Controllers try { object retdata = orderProvider.OrderNumber(input); - return JsonMsg.OK(retdata,st); + return JsonMsg.OK(retdata, st); } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } } diff --git a/服务API/Controllers/ScreenController.cs b/DataVAPI/Controllers/ScreenController.cs similarity index 73% rename from 服务API/Controllers/ScreenController.cs rename to DataVAPI/Controllers/ScreenController.cs index a2943ff..e11eb80 100644 --- a/服务API/Controllers/ScreenController.cs +++ b/DataVAPI/Controllers/ScreenController.cs @@ -1,17 +1,17 @@ -using Microsoft.AspNetCore.Mvc; +using DataVAPI.Model; +using DataVAPI.ServerDB.MongoDB; +using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using 服务API.Model; -using 服务API.ServerDB.MongoDB; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// MG数据库:大屏信息表 ScreenController /// - public class ScreenController :BaseController + public class ScreenController : BaseController { - MongoDbHelper mg = new MongoDbHelper(DataBus.DataBus.connStr,DataBus.DataBus.dbName); + MongoDbHelper mg = new MongoDbHelper(DataBus.connStr, DataBus.dbName); string st = System.Reflection.MethodBase.GetCurrentMethod().Name; /// @@ -25,9 +25,9 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(largeScreenTable.devicename)) { - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } - LargeScreenTable largeScreen= mg.QueryDeviceName(largeScreenTable.devicename); + LargeScreenTable largeScreen = mg.QueryDeviceName(largeScreenTable.devicename); if (largeScreen != null) { @@ -39,11 +39,11 @@ namespace 服务API.Controllers { mg.Insert(largeScreenTable); } - return JsonMsg.OK(largeScreenTable,st); + return JsonMsg.OK(largeScreenTable, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -57,14 +57,14 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(auth.ClientId)) { - return JsonMsg.Error(null,st,"大屏ID不能为空"); ; + return JsonMsg.Error(null, st, "大屏ID不能为空"); ; } mg.Insert(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -77,11 +77,11 @@ namespace 服务API.Controllers try { mg.Inserts(auth); - return JsonMsg>.OK(auth,st); + return JsonMsg>.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -94,11 +94,11 @@ namespace 服务API.Controllers try { mg.UpdateID(auth); - return JsonMsg.OK(auth,st); + return JsonMsg.OK(auth, st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -111,11 +111,11 @@ namespace 服务API.Controllers st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg.OK(mg.QueryOne(id),st); + return JsonMsg.OK(mg.QueryOne(id), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -126,16 +126,16 @@ namespace 服务API.Controllers /// 结束时间 /// [HttpGet] - public JsonMsg> Query(string clientId,DateTime starttime,DateTime endtime) + public JsonMsg> Query(string clientId, DateTime starttime, DateTime endtime) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.QueryAllTime(clientId,starttime,endtime),st); + return JsonMsg>.OK(mg.QueryAllTime(clientId, starttime, endtime), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -148,16 +148,16 @@ namespace 服务API.Controllers /// 每页大小 /// [HttpGet] - public JsonMsg> BasePagQuery(string clientId,DateTime starttime,DateTime endtime,int PageNumber = 1,int PageSize = 100) + public JsonMsg> BasePagQuery(string clientId, DateTime starttime, DateTime endtime, int PageNumber = 1, int PageSize = 100) { st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { - return JsonMsg>.OK(mg.BasePagQuery(clientId,starttime,endtime,PageNumber,PageSize),st); + return JsonMsg>.OK(mg.BasePagQuery(clientId, starttime, endtime, PageNumber, PageSize), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg>.Error(null,st,ex.Message); + return JsonMsg>.Error(null, st, ex.Message); } } /// @@ -173,13 +173,13 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(DeviceName)) { - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } - return JsonMsg.OK(mg.QueryDeviceName(DeviceName),st); + return JsonMsg.OK(mg.QueryDeviceName(DeviceName), st); } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -194,17 +194,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"大屏ID不能为空"); ; + return JsonMsg.Error(null, st, "大屏ID不能为空"); ; } else { - mg.Modify(id,"State","n"); - return JsonMsg.OK("success!",st); + mg.Modify(id, "State", "n"); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } /// @@ -219,17 +219,17 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(id)) { - return JsonMsg.Error(null,st,"大屏ID不能为空"); ; + return JsonMsg.Error(null, st, "大屏ID不能为空"); ; } else { mg.Delete(id); - return JsonMsg.OK("success!",st); + return JsonMsg.OK("success!", st); } } - catch (System.Exception ex) + catch (Exception ex) { - return JsonMsg.Error(null,st,ex.Message); + return JsonMsg.Error(null, st, ex.Message); } } } diff --git a/服务API/Controllers/UserController.cs b/DataVAPI/Controllers/UserController.cs similarity index 69% rename from 服务API/Controllers/UserController.cs rename to DataVAPI/Controllers/UserController.cs index 89c6f9b..039d5ae 100644 --- a/服务API/Controllers/UserController.cs +++ b/DataVAPI/Controllers/UserController.cs @@ -1,17 +1,17 @@ -using Microsoft.AspNetCore.Mvc; +using DataVAPI.Model; +using DataVAPI.Tool.IOT; +using DataVAPI.Tool.控制台显示; +using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Net.Http; using System.Text; -using 服务API.Model; -using 服务API.Tool.IOT; -using 服务API.Tool.控制台显示; -namespace 服务API.Controllers +namespace DataVAPI.Controllers { /// /// 老IOT设备查询API接口 /// - public class IOTDeviceController :BaseController + public class IOTDeviceController : BaseController { /// /// 根据设备名称查询设备状态 @@ -25,20 +25,20 @@ namespace 服务API.Controllers { if (string.IsNullOrEmpty(name)) { - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } else { //DataVModel dataV = SqlContext.Base.GetInfo(name); //return JsonMsg.OK(Tools.JsonToObjectTools(dataV?.json),st); - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } } catch (System.Exception ex) { - return JsonMsg.Error(null,ex.Message); + return JsonMsg.Error(null, ex.Message); } } @@ -52,25 +52,25 @@ namespace 服务API.Controllers try { - HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(Tools.JsonConvertTools(usersModel),Encoding.GetEncoding("UTF-8"),"application/json") }; + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(Tools.JsonConvertTools(usersModel), Encoding.GetEncoding("UTF-8"), "application/json") }; if (usersModel == null || string.IsNullOrEmpty(usersModel.deviceName)) { - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } else { string PubTopic = "/broadcast/" + "grgpECHSL7q" + "/" + usersModel.deviceName + "_SetDevice"; ConsoleHelper.WriteWarningLine("发送数据 " + PubTopic + Tools.JsonConvertTools(usersModel)); - IOTDevServer.GetInstance().IOT_Publish(PubTopic,Tools.JsonConvertTools(usersModel)); - return JsonMsg.OK(usersModel,st); + IOTDevServer.GetInstance().IOT_Publish(PubTopic, Tools.JsonConvertTools(usersModel)); + return JsonMsg.OK(usersModel, st); } } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); ; + return JsonMsg.Error(null, st, ex.Message); ; } } @@ -83,30 +83,30 @@ namespace 服务API.Controllers /// 命令变量:value为值或者消息 /// [HttpGet] - public JsonMsg SetDeviceProperty(string deviceName,int CommandName,string CommandKey,string CommandValue) + public JsonMsg SetDeviceProperty(string deviceName, int CommandName, string CommandKey, string CommandValue) { string st = System.Reflection.MethodBase.GetCurrentMethod().Name; try { if (string.IsNullOrEmpty(deviceName)) { - return JsonMsg.Error(null,st,"设备名称不能为空"); ; + return JsonMsg.Error(null, st, "设备名称不能为空"); ; } else { string PubTopic = "/broadcast/" + "grgpECHSL7q" + "/" + deviceName + "_SetDevice"; - Dictionary keyValuePair = new Dictionary(); - keyValuePair.Add(CommandKey,CommandValue); - CommandModel command = new CommandModel() { CommandName = CommandName,deviceName = deviceName,CommandValue = keyValuePair }; + Dictionary keyValuePair = new Dictionary(); + keyValuePair.Add(CommandKey, CommandValue); + CommandModel command = new CommandModel() { CommandName = CommandName, deviceName = deviceName, CommandValue = keyValuePair }; ConsoleHelper.WriteWarningLine("发送数据 " + PubTopic + Tools.JsonConvertTools(command)); - IOTDevServer.GetInstance().IOT_Publish(PubTopic,Tools.JsonConvertTools(command)); - return JsonMsg.OK(command,st); + IOTDevServer.GetInstance().IOT_Publish(PubTopic, Tools.JsonConvertTools(command)); + return JsonMsg.OK(command, st); } } catch (System.Exception ex) { - return JsonMsg.Error(null,st,ex.Message); ; + return JsonMsg.Error(null, st, ex.Message); ; } } diff --git a/服务API/DataBus/DataBus.cs b/DataVAPI/DataBus/DataBus.cs similarity index 96% rename from 服务API/DataBus/DataBus.cs rename to DataVAPI/DataBus/DataBus.cs index 1bc7493..051e09b 100644 --- a/服务API/DataBus/DataBus.cs +++ b/DataVAPI/DataBus/DataBus.cs @@ -1,4 +1,4 @@ -namespace 服务API.DataBus +namespace DataVAPI { /// /// 数据总线 diff --git a/服务API/服务API.csproj b/DataVAPI/DataVAPI.csproj similarity index 80% rename from 服务API/服务API.csproj rename to DataVAPI/DataVAPI.csproj index 1ad9c9b..51b809e 100644 --- a/服务API/服务API.csproj +++ b/DataVAPI/DataVAPI.csproj @@ -23,10 +23,10 @@ - - - - + + + + diff --git a/服务API/Program.cs b/DataVAPI/Program.cs similarity index 94% rename from 服务API/Program.cs rename to DataVAPI/Program.cs index 4c398dd..8984cfc 100644 --- a/服务API/Program.cs +++ b/DataVAPI/Program.cs @@ -6,15 +6,14 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using System; using System.Runtime.InteropServices; -using 服务API.Tool.控制台显示; -namespace 服务API +namespace DataVAPI { public class Program { public delegate bool ControlCtrlDelegate(int CtrlType); [DllImport("kernel32.dll")] - private static extern bool SetConsoleCtrlHandler(ControlCtrlDelegate HandlerRoutine,bool Add); + private static extern bool SetConsoleCtrlHandler(ControlCtrlDelegate HandlerRoutine, bool Add); private static ControlCtrlDelegate cancelHandler = new ControlCtrlDelegate(HandlerRoutine); public static bool HandlerRoutine(int CtrlType) @@ -44,7 +43,8 @@ namespace 服务API Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { //配置阿波罗 - webBuilder.ConfigureAppConfiguration((context,builder) => { + webBuilder.ConfigureAppConfiguration((context, builder) => + { builder.AddApolloConfiguration(op => { builder.Build().GetSection(nameof(ApolloOptions)).Bind(op); diff --git a/服务API/Properties/launchSettings.json b/DataVAPI/Properties/launchSettings.json similarity index 100% rename from 服务API/Properties/launchSettings.json rename to DataVAPI/Properties/launchSettings.json diff --git a/服务API/Startup.cs b/DataVAPI/Startup.cs similarity index 93% rename from 服务API/Startup.cs rename to DataVAPI/Startup.cs index a2f96d8..57f42ba 100644 --- a/服务API/Startup.cs +++ b/DataVAPI/Startup.cs @@ -1,14 +1,14 @@ +using DataVApi.Order; +using DataVAPI.AppConfig; +using DataVAPI.ConfigureSwagger; +using DataVAPI.Tool.控制台显示; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using 服务Api.Order; -using 服务API.AppConfig; -using 服务API.ConfigureSwagger; -using 服务API.Tool.控制台显示; -namespace 服务API +namespace DataVAPI { public class Startup { @@ -45,7 +45,7 @@ namespace 服务API app.UseSwagger(); //配置Cors app.UseCors("any"); - + app.UseSwaggerUI(c => { c.InjectJavascript($"/swagger/ui/zh_CN.js"); // 加载中文包 diff --git a/服务API/appsettings.Development.json b/DataVAPI/appsettings.Development.json similarity index 100% rename from 服务API/appsettings.Development.json rename to DataVAPI/appsettings.Development.json diff --git a/服务API/appsettings.json b/DataVAPI/appsettings.json similarity index 100% rename from 服务API/appsettings.json rename to DataVAPI/appsettings.json diff --git a/服务API/hbl.ico b/DataVAPI/hbl.ico similarity index 100% rename from 服务API/hbl.ico rename to DataVAPI/hbl.ico diff --git a/服务Api.Order/服务Api.Order.csproj b/DataVApi.Order/DataVApi.Order.csproj similarity index 100% rename from 服务Api.Order/服务Api.Order.csproj rename to DataVApi.Order/DataVApi.Order.csproj diff --git a/服务Api.Order/Dto/LocSaleDto.cs b/DataVApi.Order/Dto/LocSaleDto.cs similarity index 89% rename from 服务Api.Order/Dto/LocSaleDto.cs rename to DataVApi.Order/Dto/LocSaleDto.cs index ac7e612..8c8d6c9 100644 --- a/服务Api.Order/Dto/LocSaleDto.cs +++ b/DataVApi.Order/Dto/LocSaleDto.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.Dto +namespace DataVApi.Order.Dto { public class LocSaleDto { diff --git a/服务Api.Order/Dto/OrderDataStateDto.cs b/DataVApi.Order/Dto/OrderDataStateDto.cs similarity index 90% rename from 服务Api.Order/Dto/OrderDataStateDto.cs rename to DataVApi.Order/Dto/OrderDataStateDto.cs index 6c8d011..d2c9b9b 100644 --- a/服务Api.Order/Dto/OrderDataStateDto.cs +++ b/DataVApi.Order/Dto/OrderDataStateDto.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.Dto +namespace DataVApi.Order.Dto { public class OrderDataStateDto { diff --git a/服务Api.Order/Dto/OrderLineDto.cs b/DataVApi.Order/Dto/OrderLineDto.cs similarity index 92% rename from 服务Api.Order/Dto/OrderLineDto.cs rename to DataVApi.Order/Dto/OrderLineDto.cs index 6244eba..746681b 100644 --- a/服务Api.Order/Dto/OrderLineDto.cs +++ b/DataVApi.Order/Dto/OrderLineDto.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.Dto +namespace DataVApi.Order.Dto { public class OrderLineDto { diff --git a/服务Api.Order/Dto/OrderNumberDto.cs b/DataVApi.Order/Dto/OrderNumberDto.cs similarity index 87% rename from 服务Api.Order/Dto/OrderNumberDto.cs rename to DataVApi.Order/Dto/OrderNumberDto.cs index 5727772..bdb0004 100644 --- a/服务Api.Order/Dto/OrderNumberDto.cs +++ b/DataVApi.Order/Dto/OrderNumberDto.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.Dto +namespace DataVApi.Order.Dto { public class OrderNumberDto { diff --git a/服务Api.Order/OrderProvider.cs b/DataVApi.Order/OrderProvider.cs similarity index 95% rename from 服务Api.Order/OrderProvider.cs rename to DataVApi.Order/OrderProvider.cs index 5412c3c..d56daee 100644 --- a/服务Api.Order/OrderProvider.cs +++ b/DataVApi.Order/OrderProvider.cs @@ -1,14 +1,14 @@ -using System; +using DataVApi.Order.Dto; +using DataVApi.Order.RequestModel; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; using XExten.Advance.HttpFramework.MultiFactory; -using 服务Api.Order.Dto; -using 服务Api.Order.RequestModel; -namespace 服务Api.Order +namespace DataVApi.Order { public class OrderProvider : SugarDb { @@ -113,7 +113,8 @@ WHERE /// 区域销售 /// /// - public object GetLocSale() { + public object GetLocSale() + { var db = DbContext(); var baiduMap = "http://api.map.baidu.com/geocoder/v2/?ak=3ce7ddfda60046708248ea55e10b1435&callback=renderReverse&location={0}&output=xml"; @@ -135,12 +136,12 @@ WHERE if (http == null) http = IHttpMultiClient.HttpMulti.AddNode(opt => { - opt.NodePath = String.Format(baiduMap, item.Loc); + opt.NodePath = string.Format(baiduMap, item.Loc); }); else http = http.AddNode(opt => { - opt.NodePath = String.Format(baiduMap, item.Loc); + opt.NodePath = string.Format(baiduMap, item.Loc); }); }); XmlDocument doc = new XmlDocument(); @@ -170,7 +171,7 @@ WHERE /// 下单数量 /// /// - public object OrderNumber(FullScreenBasic input) + public object OrderNumber(FullScreenBasic input) { var db = DbContext(); diff --git a/服务Api.Order/RequestModel/FullScreenBasic.cs b/DataVApi.Order/RequestModel/FullScreenBasic.cs similarity index 90% rename from 服务Api.Order/RequestModel/FullScreenBasic.cs rename to DataVApi.Order/RequestModel/FullScreenBasic.cs index 344324b..8e6ad85 100644 --- a/服务Api.Order/RequestModel/FullScreenBasic.cs +++ b/DataVApi.Order/RequestModel/FullScreenBasic.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.RequestModel +namespace DataVApi.Order.RequestModel { public class FullScreenBasic { diff --git a/服务Api.Order/RequestModel/FullScreenInput.cs b/DataVApi.Order/RequestModel/FullScreenInput.cs similarity index 80% rename from 服务Api.Order/RequestModel/FullScreenInput.cs rename to DataVApi.Order/RequestModel/FullScreenInput.cs index 1e85297..c9601b2 100644 --- a/服务Api.Order/RequestModel/FullScreenInput.cs +++ b/DataVApi.Order/RequestModel/FullScreenInput.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace 服务Api.Order.RequestModel +namespace DataVApi.Order.RequestModel { - public class FullScreenInput: FullScreenBasic + public class FullScreenInput : FullScreenBasic { /// /// 开始时间 diff --git a/服务Api.Order/SugarDb.cs b/DataVApi.Order/SugarDb.cs similarity index 96% rename from 服务Api.Order/SugarDb.cs rename to DataVApi.Order/SugarDb.cs index 1963adf..8ac8f36 100644 --- a/服务Api.Order/SugarDb.cs +++ b/DataVApi.Order/SugarDb.cs @@ -2,7 +2,7 @@ using System; using System.Linq; -namespace 服务Api.Order +namespace DataVApi.Order { public class SugarDb { diff --git a/Dockerfile b/Dockerfile index f68be32..8bbc299 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,16 +7,16 @@ EXPOSE 80 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["NuGet.config", "."] -COPY ["服务API/服务API.csproj", "服务API/"] -RUN dotnet restore "服务API/服务API.csproj" --configfile "NuGet.config" +COPY ["DataVAPI/DataVAPI.csproj", "DataVAPI/"] +RUN dotnet restore "DataVAPI/DataVAPI.csproj" --configfile "NuGet.config" COPY . . WORKDIR "/src/DataV" -RUN dotnet build "服务API.csproj" -c Release -o /app/build +RUN dotnet build "DataVAPI.csproj" -c Release -o /app/build FROM build AS publish -RUN dotnet publish "服务API.csproj" -c Release -o /app/publish +RUN dotnet publish "DataVAPI.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "服务API.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "DataVAPI.dll"] \ No newline at end of file diff --git a/IOT.Help/IOT.Help.csproj b/IOT.Help/DataVIOT.Help.csproj similarity index 89% rename from IOT.Help/IOT.Help.csproj rename to IOT.Help/DataVIOT.Help.csproj index ee3f2f8..4cb88ea 100644 --- a/IOT.Help/IOT.Help.csproj +++ b/IOT.Help/DataVIOT.Help.csproj @@ -18,7 +18,7 @@ - + diff --git a/IOT.Help/MainWindow.xaml.cs b/IOT.Help/MainWindow.xaml.cs index f4c35ae..eab4514 100644 --- a/IOT.Help/MainWindow.xaml.cs +++ b/IOT.Help/MainWindow.xaml.cs @@ -1,6 +1,8 @@ using AduSkin.Controls.Metro; -using IOT.Help.Model; -using IOT.Help.ViewModel; +using DataVAPI.Tool.API请求; +using DataVAPI.Tool.IOT; +using DataVIOT.Help.Model; +using DataVIOT.Help.ViewModel; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -8,8 +10,6 @@ using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using 服务API.Tool.API请求; -using 服务API.Tool.IOT; namespace IOT.Help { diff --git a/IOT.Help/Model/Carousel.cs b/IOT.Help/Model/Carousel.cs index 56d4725..ec9460e 100644 --- a/IOT.Help/Model/Carousel.cs +++ b/IOT.Help/Model/Carousel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace IOT.Help.Model +namespace DataVIOT.Help.Model { public class Carouselname { diff --git a/IOT.Help/ViewModel/MainViewModel.cs b/IOT.Help/ViewModel/MainViewModel.cs index 571313c..78c6c01 100644 --- a/IOT.Help/ViewModel/MainViewModel.cs +++ b/IOT.Help/ViewModel/MainViewModel.cs @@ -1,14 +1,14 @@ -using Microsoft.Toolkit.Mvvm.ComponentModel; +using DataVAPI.Tool.API请求; +using DataVAPI.Tool.IOT; +using Microsoft.Toolkit.Mvvm.ComponentModel; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using 服务API.Tool.API请求; -using 服务API.Tool.IOT; -namespace IOT.Help.ViewModel +namespace DataVIOT.Help.ViewModel { - public class MainViewModel :ObservableObject + public class MainViewModel : ObservableObject { #region 公有变量 /// @@ -67,7 +67,7 @@ namespace IOT.Help.ViewModel public MainViewModel() { deviceTable = new ObservableCollection(); - device=new DeviceTable(); + device = new DeviceTable(); deviceTableSelectedItem = new DeviceTable(); //Refresh(); } @@ -82,7 +82,8 @@ namespace IOT.Help.ViewModel public void Refresh() { deviceTable.Clear(); - Inquire()?.OrderBy(o=>int.Parse(o.ClientId)).ToList().ForEach(d => { + Inquire()?.OrderBy(o => int.Parse(o.ClientId)).ToList().ForEach(d => + { deviceTable.Add(d); }); } @@ -91,12 +92,12 @@ namespace IOT.Help.ViewModel /// 根据客户端iD查询 /// /// - public List Inquire(string clientId="") + public List Inquire(string clientId = "") { try { string url = ApiURL + "/api/Device/Query"; - if (!string.IsNullOrEmpty(clientId)) url = ApiURL + "/api/Device/Query?clientId="+clientId; + if (!string.IsNullOrEmpty(clientId)) url = ApiURL + "/api/Device/Query?clientId=" + clientId; string json = HttpRequestHelper.HttpGetRequest(url); JsonMsg> jsonMsg = Tools.JsonToObjectTools>>(json); return jsonMsg.obj; @@ -117,7 +118,7 @@ namespace IOT.Help.ViewModel try { string url = ApiURL + "/api/Device/Modify"; - string json = HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(device)); + string json = HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(device)); Refresh(); return true; } @@ -137,7 +138,7 @@ namespace IOT.Help.ViewModel try { string url = ApiURL + "/api/Device/Create"; - string json = HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(device)); + string json = HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(device)); Refresh(); return true; } @@ -153,7 +154,7 @@ namespace IOT.Help.ViewModel try { string url = ApiURL + "/api/Device/Create"; - string json = HttpRequestHelper.HttpPostRequest(url,Tools.JsonConvertTools(deviceTable)); + string json = HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(deviceTable)); Refresh(); return true; } @@ -172,7 +173,7 @@ namespace IOT.Help.ViewModel { try { - string url = ApiURL + "/api/Device/DeleteDate?id="+ device.IdStr; + string url = ApiURL + "/api/Device/DeleteDate?id=" + device.IdStr; string json = HttpRequestHelper.HttpGetRequest(url); Refresh(); return true; diff --git a/服务API.sln b/服务API.sln deleted file mode 100644 index bc4ac10..0000000 --- a/服务API.sln +++ /dev/null @@ -1,61 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.32210.238 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务API", "服务API\服务API.csproj", "{0F350854-541C-41B9-8B5C-788384E293E5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务API.Model", "服务API.Model\服务API.Model.csproj", "{6338B18D-A3B2-4458-AB7C-756CBE23A574}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务API.ProcessServices", "服务API.ProcessServices\服务API.ProcessServices.csproj", "{C7F090EE-AA2D-4ABB-B301-00443C2D062B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务API.Tool", "服务API.Tools\服务API.Tool.csproj", "{9A7B217F-7038-4CD1-ABC3-D0F3B92D9297}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务API.ServerDB", "服务API.ServerDB\服务API.ServerDB.csproj", "{B32B6FE9-E40F-4461-8AD0-364B63C12E4B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "服务Api.Order", "服务Api.Order\服务Api.Order.csproj", "{76E3E5FA-F2B6-48E8-81DA-397E84A2C76B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IOT.Help", "IOT.Help\IOT.Help.csproj", "{302A05E0-4AA1-4655-AE4B-0826B2C55EB9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0F350854-541C-41B9-8B5C-788384E293E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F350854-541C-41B9-8B5C-788384E293E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F350854-541C-41B9-8B5C-788384E293E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F350854-541C-41B9-8B5C-788384E293E5}.Release|Any CPU.Build.0 = Release|Any CPU - {6338B18D-A3B2-4458-AB7C-756CBE23A574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6338B18D-A3B2-4458-AB7C-756CBE23A574}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6338B18D-A3B2-4458-AB7C-756CBE23A574}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6338B18D-A3B2-4458-AB7C-756CBE23A574}.Release|Any CPU.Build.0 = Release|Any CPU - {C7F090EE-AA2D-4ABB-B301-00443C2D062B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7F090EE-AA2D-4ABB-B301-00443C2D062B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7F090EE-AA2D-4ABB-B301-00443C2D062B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7F090EE-AA2D-4ABB-B301-00443C2D062B}.Release|Any CPU.Build.0 = Release|Any CPU - {9A7B217F-7038-4CD1-ABC3-D0F3B92D9297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A7B217F-7038-4CD1-ABC3-D0F3B92D9297}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A7B217F-7038-4CD1-ABC3-D0F3B92D9297}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A7B217F-7038-4CD1-ABC3-D0F3B92D9297}.Release|Any CPU.Build.0 = Release|Any CPU - {B32B6FE9-E40F-4461-8AD0-364B63C12E4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B32B6FE9-E40F-4461-8AD0-364B63C12E4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B32B6FE9-E40F-4461-8AD0-364B63C12E4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B32B6FE9-E40F-4461-8AD0-364B63C12E4B}.Release|Any CPU.Build.0 = Release|Any CPU - {76E3E5FA-F2B6-48E8-81DA-397E84A2C76B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76E3E5FA-F2B6-48E8-81DA-397E84A2C76B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76E3E5FA-F2B6-48E8-81DA-397E84A2C76B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76E3E5FA-F2B6-48E8-81DA-397E84A2C76B}.Release|Any CPU.Build.0 = Release|Any CPU - {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {302A05E0-4AA1-4655-AE4B-0826B2C55EB9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5E3567E1-6440-428F-A2E2-A7CF6A1EF45A} - EndGlobalSection -EndGlobal