123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790 |
- using Newtonsoft.Json.Linq;
- using PMS.BusinessModels.Account;
- using PMS.BusinessModels.CloudMonitorManage;
- using PMS.BusinessModels.SMS;
- using PMS.BusinessModels.SysManager;
- using PMS.Interface;
- using PMS.Interface.CloudMonitorManage;
- using PMS.Interface.MessageManage;
- using PMS.Interface.SysManager;
- using PMS.Plugins.Common;
- using QWPlatform.SystemLibrary;
- using QWPlatform.SystemLibrary.Utils;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Web;
- using System.Web.Mvc;
- namespace PMS.WebUI.Controllers
- {
- /// <summary>
- /// 云监控
- /// </summary>
- public class CloudMonitorController : BaseController
- {
- ICloudMonitor _cloudMonitor = InterfaceFactory.CreateBusinessInstance<ICloudMonitor>();
- //推送消息
- IMessageManage notice = InterfaceFactory.CreateBusinessInstance<IMessageManage>();
- /// <summary>
- /// 采集配置
- /// </summary>
- /// <returns></returns>
- public ActionResult CollectionConfigIndex()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.CollectionConfig;
- if (config == null) config = new CollectionConfig();
- ViewBag.CollectionConfig = config;
- return View();
- }
- /// <summary>
- /// 预警配置
- /// </summary>
- /// <returns></returns>
- public ActionResult EarlyWarningConfigIndex()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.AlertConfig;
- if (config == null) config = new AlertConfig();
- ViewBag.AlertConfig = config;
- return View();
- }
- /// <summary>
- /// 自定义预警配置
- /// </summary>
- /// <returns></returns>
- public ActionResult CustomAlertsConfigIndex()
- {
- return View();
- }
- /// <summary>
- /// 自定义预警编辑界面
- /// </summary>
- /// <returns></returns>
- public ActionResult EditCustomAlertsConfig()
- {
- return View();
- }
- /// <summary>
- /// API预警配置
- /// </summary>
- /// <returns></returns>
- public ActionResult APIAlertsConfigIndex()
- {
- return View();
- }
- /// <summary>
- /// API预警编辑界面
- /// </summary>
- /// <returns></returns>
- public ActionResult EditAPIAlertsConfig()
- {
- return View();
- }
- /// <summary>
- /// 服务器硬件监控
- /// </summary>
- /// <returns></returns>
- public ActionResult ServerHardwareMonitoringIndex()
- {
- return View();
- }
- /// <summary>
- /// 预警管理
- /// </summary>
- /// <returns></returns>
- public ActionResult EarlyWarningManagementIndex()
- {
- return View();
- }
- /// <summary>
- /// 未处理预警处理
- /// </summary>
- /// <returns></returns>
- public ActionResult UnprocessedEarlyWarningManagementIndex()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.AlertConfig;
- if (config == null) config = new AlertConfig();
- ViewBag.Model = config;
- return View();
- }
- /// <summary>
- /// 预警详情
- /// </summary>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult EarlyWarningInfo(string id)
- {
- ViewBag.Model = _cloudMonitor.GetServerAlertByAlertlId(id);
- return View();
- }
- /// <summary>
- /// 预警处理
- /// </summary>
- /// <returns></returns>
- public ActionResult WarningProcessing()
- {
- var data = GetCurrentUser();
- ViewBag.UserName = data.Name;
- return View();
- }
- /// <summary>
- /// 批量预警处理
- /// </summary>
- /// <returns></returns>
- public ActionResult BatchWarningProcessing()
- {
- var data = GetCurrentUser();
- ViewBag.UserName = data.Name;
- return View();
- }
- /// <summary>
- /// 项目监控管理
- /// </summary>
- /// <returns></returns>
- public ActionResult ProjectMonitoringManagementIndex()
- {
- return View();
- }
- /// <summary>
- /// 服务器信息
- /// </summary>
- /// <returns></returns>
- public ActionResult ServerInfo()
- {
- return View();
- }
- /// <summary>
- /// 上传指标记录
- /// </summary>
- /// <returns></returns>
- public ActionResult UploadIndicatorRecordIndex()
- {
- return View();
- }
- /// <summary>
- /// 保存采集配置
- /// </summary>
- /// <param name="config"></param>
- /// <returns></returns>
- public ActionResult SaveCollectionConfig(CollectionConfig config)
- {
- return Content(_cloudMonitor.SaveCollectionConfig(config) ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 保存预警配置
- /// </summary>
- /// <param name="config"></param>
- /// <returns></returns>
- public ActionResult SaveAlertConfig(AlertConfig config)
- {
- return Content(_cloudMonitor.SaveAlertConfig(config) ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 获取预警配置
- /// </summary>
- /// <returns></returns>
- public ActionResult GetAlertConfiguration()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.AlertConfig;
- if (config == null) config = new AlertConfig();
- return Content(Strings.ObjectToJson(config), "application/json");
- }
- /// <summary>
- /// 获取自定义配置
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCustomAlertModel(string search)
- {
- var data = _cloudMonitor.GetCustomAlertModelByChannelId(GetAuthDats()?.Channel, search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取自定义API配置
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCustomAPIModel(string search)
- {
- var data = _cloudMonitor.GetCustomAPIModelByChannelId(GetAuthDats()?.Channel, search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据项目id获取 启动的自定义预警配置
- /// </summary>
- /// <param name="itemId"></param>
- /// <returns></returns>
- public ActionResult GetCustomAlertModelByItemIdAndStart(string itemid)
- {
- var data = _cloudMonitor.GetCustomAlertModelByItemIdAndStart(itemid);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 新增自定义配置
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult SaveCustomAlert(CustomAlertModel model)
- {
- var data = false;
- if (string.IsNullOrEmpty(model.ID))
- {
- model.ID = Guid.NewGuid().ToString("N");
- model.创建人ID = GetCurrentUser().ID;
- data = _cloudMonitor.InsertCustomAlert(model);
- }
- else
- {
- data = _cloudMonitor.UpdateCustomAlert(model);
- }
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 新增自定义API配置
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult SaveCustomAPI(CustomAPIModel model)
- {
- var data = false;
- if (string.IsNullOrEmpty(model.ID))
- {
- model.ID = Guid.NewGuid().ToString("N");
- model.创建人ID = GetCurrentUser().ID;
- data = _cloudMonitor.InsertCustomAPI(model);
- }
- else
- {
- data = _cloudMonitor.UpdateCustomAPI(model);
- }
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 根据项目id获取服务器信息
- /// </summary>
- /// <param name="itemid"></param>
- /// <returns></returns>
- public ActionResult GetServerByItemId(string itemid)
- {
- var data = _cloudMonitor.GetServerByItemId(itemid);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据id删除
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult DeleteCustomAlertById(string id)
- {
- var data = _cloudMonitor.DeleteCustomAlertById(id);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 根据id删除
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult DeleteCustomAPIById(string id)
- {
- var data = _cloudMonitor.DeleteCustomAPIById(id);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 获取采集配置
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCollectionConfig()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.CollectionConfig;
- return Content(Strings.ObjectToJson(config), "application/json");
- }
- /// <summary>
- /// 获取所有服务器信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerInfoAll(string search)
- {
- var data = _cloudMonitor.GetServerIndexInfoByChannelId(GetAuthDats().Channel, search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取所有服务器信息 通过项目id过滤
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerInfoByProjectId(string projectId)
- {
- var data = new List<ServerIndexInfoModel>();
- if (!string.IsNullOrEmpty(projectId))
- {
- var projectArr = projectId.Split(',');
- var authProjectArr = GetAuthDats().Project.Split(',');
- //传入的渠道id和自身有的权限的渠道id 取交集
- var intersection = projectArr.Intersect(authProjectArr);
- if (intersection.Any())
- data = _cloudMonitor.GetServerIndexInfoByProjectId(string.Join(",", intersection));
- }
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取所有服务器信息 通过渠道id过滤
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerInfoByChannelId(string channelId)
- {
- var data = new List<ServerIndexInfoModel>();
- if (!string.IsNullOrEmpty(channelId))
- {
- var channelArr = channelId.Split(',');
- var authChannelArr = GetAuthDats().Channel.Split(',');
- //传入的渠道id和自身有的权限的渠道id 取交集
- var intersection = channelArr.Intersect(authChannelArr);
- if (intersection.Any())
- data = _cloudMonitor.GetServerIndexInfoByChannelId(string.Join(",", intersection));
- }
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取指标详情 根据指标id
- /// </summary>
- /// <param name="indexId"></param>
- public ActionResult GetServerDetailByIndexId(string indexId, DateTime startTime, DateTime endTime)
- {
- var data = _cloudMonitor.GetServerIndexDetailByIndexId(indexId, startTime, endTime);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取指标详情 根据服务器id
- /// </summary>
- /// <param name="indexId"></param>
- public ActionResult GetServerDetailByServerId(string serverId, DateTime startTime, DateTime endTime)
- {
- var data = _cloudMonitor.GetServerIndexDetailByServerId(serverId, startTime, endTime);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取所有服务器预警
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerAlertAll(string search)
- {
- var data = _cloudMonitor.GetServerAlertAll(search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据条件获取服务器预警
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetServerAlertBySearch(ServerAlertSearch search)
- {
- if (string.IsNullOrEmpty(search.QDID))
- {
- search.QDID = GetAuthDats().Channel;
- }
- var data = _cloudMonitor.GetServerAlertBySearch(search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 插入服务器预警处理
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult InsertServerAlertProcess(ServerAlertProcessModel model)
- {
- var data = _cloudMonitor.InsertServerAlertProcess(model);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 查询服务器预警处理过程
- /// </summary>
- /// <param name="alertId"></param>
- /// <returns></returns>
- public ActionResult GetServerAlertProcessByAlertId(string alertId)
- {
- var data = _cloudMonitor.GetServerAlertProcessByAlertId(alertId);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取全部项目监控数据
- /// </summary>
- /// <returns></returns>
- public ActionResult GetProjectMonitorAll()
- {
- var data = _cloudMonitor.GetProjectMonitorAll();
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据查询获取全部项目监控
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetProjectMonitorBySearch(ServerAlertSearch search)
- {
- if (string.IsNullOrEmpty(search.QDID))
- {
- search.QDID = GetAuthDats().Channel;
- }
- var data = _cloudMonitor.GetProjectMonitorBySearch(search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 停止项目监控
- /// </summary>
- /// <param name="projectId"></param>
- public ActionResult StopProjectMonitor(string projectId)
- {
- var data = _cloudMonitor.StartOrStopProjectMonitor(projectId, false);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 插入数据库数据
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult InsertDbInfo(DbInfoModel model)
- {
- var data = _cloudMonitor.InsertDbInfo(model);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 修改数据库数据
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public ActionResult UpdateDbInfo(DbInfoModel model)
- {
- var data = _cloudMonitor.UpdateDbInfo(model);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 获取数据库数据,根据服务器ID过滤
- /// </summary>
- /// <param name="channelId"></param>
- /// <returns></returns>
- public ActionResult GetDbInfoByServerId(string serverId)
- {
- var data = _cloudMonitor.GetDbInfoByServerId(serverId);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取数据库数据,根据ID过滤
- /// </summary>
- /// <param name="channelId"></param>
- /// <returns></returns>
- public ActionResult GetDbInfoById(string id)
- {
- var data = _cloudMonitor.GetDbInfoById(id);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 删除数据库数据,根据ID
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult DeleteDbInfoById(string id)
- {
- var data = _cloudMonitor.DeleteDbInfoById(id);
- return Content(data ? "1" : "0", "text/plain");
- }
- /// <summary>
- /// 查询上传指标数据
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetPushIndexData(IndexSearch search)
- {
- if (string.IsNullOrEmpty(search.QDID))
- {
- search.QDID = GetAuthDats().Channel;
- }
- var data = _cloudMonitor.GetPushIndexData(search);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- }
- /// <summary>
- /// 云监控对外部开放的接口
- /// </summary>
- [Encryption()]
- public class CloudMonitorExternalController : BaseController
- {
- ICloudMonitor _cloudMonitor = InterfaceFactory.CreateBusinessInstance<ICloudMonitor>();
- //推送消息
- IMessageManage notice = InterfaceFactory.CreateBusinessInstance<IMessageManage>();
- public static string IsCollection = ConfigurationManager.AppSettings["IsCollection"].ToStringEx();
- //执行登录
- [HttpPost]
- [CheckLogin(false)]
- public ActionResult CheckLogin(DecryInput<LoginInput> input)
- {
- string account = input.Value.account;
- string pwd = input.Value.pwd;
- string vcode = input.Value.vcode;
- var code = this.Session["vcode"];
- var json = new PmsJsonResoult(System.Net.HttpStatusCode.OK, "登录成功", null);
- if (code == null || code.ToString().ToLower() != vcode.ToLower())
- {//验证码不正确
- json.msg = "验证码不正确,请重新录入";
- json.code = System.Net.HttpStatusCode.PreconditionFailed;
- return Content(json.ToString(), "application/json");
- }
- //清空验证码
- this.Session["vcode"] = null;
- //读取IP
- var ip = QWPlatform.SystemLibrary.Utils.Strings.GetWebClientIP();
- //到数据库中验证是否正确
- var r = account_obj.Login(account, pwd, ip);
- if (r.Success)
- {//登录成功
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, r.Message, null).ToString(), "application/json");
- }
- else
- {//登录失败
- return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, r.Message, null).ToString(), "application/json");
- }
- }
- /// <summary>
- /// 获取用户信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetUserInfo()
- {
- var data = GetCurrentUser();
- var userInfo = new UserInfo();
- userInfo.ID = data.ID;
- userInfo.Account = data.Account;
- userInfo.Name = data.Name;
- userInfo.Email = data.Email;
- userInfo.Company = data.Company;
- userInfo.CompanyID = data.CompanyID;
- userInfo.PersonJob = data.PersonJob;
- return Content(Strings.ObjectToJson(userInfo), "application/json");
- }
- /// <summary>
- /// 获取项目监控状态
- /// </summary>
- /// <returns></returns>
- public ActionResult GetItemList()
- {
- var data = _cloudMonitor.GetProjectMonitorByChannelId(GetAuthDats().Channel);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据项目id获取服务器信息
- /// </summary>
- /// <param name="itemid"></param>
- /// <returns></returns>
- public ActionResult GetServerByItemId(string itemid)
- {
- var data = _cloudMonitor.GetServerByItemId(itemid);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 获取采集配置
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCollectionConfig()
- {
- var cloudMonitorConfig = _cloudMonitor.GetCloudMonitorConfig();
- var config = cloudMonitorConfig?.CollectionConfig;
- return Content(Strings.ObjectToJson(config), "application/json");
- }
- /// <summary>
- /// 根据项目id获取 启动的自定义预警配置
- /// </summary>
- /// <param name="itemId"></param>
- /// <returns></returns>
- public ActionResult GetCustomAlertModelByItemIdAndStart(string itemid)
- {
- var data = _cloudMonitor.GetCustomAlertModelByItemIdAndStart(itemid);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 根据项目id获取 启动的API预警配置
- /// </summary>
- /// <param name="itemId"></param>
- /// <returns></returns>
- public ActionResult GetCustomServerModelByItemIdAndStart(string itemid)
- {
- var data = _cloudMonitor.GetCustomServerModelByItemIdAndStart(itemid);
- return Content(Strings.ObjectToJson(data), "application/json");
- }
- /// <summary>
- /// 启动或者停止项目监控
- /// </summary>
- /// <param name="projectId"></param>
- public ActionResult StartOrStopProjectMonitor(string projectId, bool state, string clientId)
- {
- var data = _cloudMonitor.StartOrStopProjectMonitor(projectId, state, clientId);
- return Content(data ? "1" : "0", "text/plain");
- }
- #region 接收处理上报数据
- /// <summary>
- /// 接收上报的服务器信息
- /// </summary>
- /// <param name="serverInfos"></param>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveServerInfo(string clientId, DecryInput<List<Ret<ServerInfo>>> input)
- {
- if(IsCollection=="0")
- {
- return Content("1");
- }
- List<Ret<ServerInfo>> serverInfos = input.Value;
- _cloudMonitor.ReceiveServerInfo(clientId, serverInfos);
- return Content("1");
- }
- /// <summary>
- /// 接收上报的数据库连接数信息
- /// </summary>
- /// <param name="dbConnectInfos"></param>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveDbConnectInfo(string clientId, DecryInput<List<Ret<DbConnectInfo>>> input)
- {
- if (IsCollection == "0")
- {
- return Content("1");
- }
- List<Ret<DbConnectInfo>> dbConnectInfos = input.Value;
- _cloudMonitor.ReceiveDbConnectInfo(clientId, dbConnectInfos);
- return Content("1");
- }
- /// <summary>
- /// 接收上报的数据库死锁信息
- /// </summary>
- /// <param name="dbLockedInfos"></param>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveDbLockedInfo(string clientId, DecryInput<List<Ret<DbLockedInfo>>> input)
- {
- if (IsCollection == "0")
- {
- return Content("1");
- }
- List<Ret<DbLockedInfo>> dbLockedInfos = input.Value;
- _cloudMonitor.ReceiveDbLockedInfo(clientId, dbLockedInfos);
- return Content("1");
- }
- /// <summary>
- /// 接收上报的服务发现信息
- /// </summary>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveServiceWorkStateInfo(string clientId, DecryInput<List<Ret<ServiceWorkStateInfo>>> input)
- {
- if (IsCollection == "0")
- {
- return Content("1");
- }
- List<Ret<ServiceWorkStateInfo>> serviceWorkStateInfos = input.Value;
- _cloudMonitor.ReceiveServiceWorkStateInfo(clientId, serviceWorkStateInfos);
- return Content("1");
- }
- /// <summary>
- /// 接收上报的自定义预警信息
- /// </summary>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveDbCustomAlertInfo(string clientId, DecryInput<Ret<DbCustomAlertInfo>> input)
- {
- if (IsCollection == "0")
- {
- return Content("1");
- }
- Ret<DbCustomAlertInfo> info = input.Value;
- _cloudMonitor.ReceiveDbCustomAlertInfo(clientId, info);
- return Content("1");
- }
- /// <summary>
- /// 接收上报的自定义服务信息
- /// </summary>
- /// <returns></returns>
- [CheckLogin(false)]
- public ActionResult ReceiveCustomServiceInfo(string clientId, DecryInput<Ret<CustomServiceInfo>> input)
- {
- if (IsCollection == "0")
- {
- return Content("1");
- }
- Ret<CustomServiceInfo> info = input.Value;
- _cloudMonitor.ReceiveCustomServiceInfo(clientId, info);
- return Content("1");
- }
- #endregion
- }
- }
|