public object GetInterfaceLogs(string id)
 {
     try
     {
         SystemSettingBase settings = SystemSettingBase.CreateInstance();
         if (settings.SysMySqlDB != null)
         {
             ConnString.MySqldb = settings.SysMySqlDB.ConnectionString;
         }
         StringBuilder sb = new StringBuilder();
         if (!string.IsNullOrEmpty(id))
         {
             sb.AppendFormat(" where ConfigId = '{0}' order by CreateTime desc ", id);
         }
         List <InterfaceExceptionlog> logs = InterfaceExceptionlogOperation.GetInterfaceExceptionlogList(string.Empty, sb.ToString());
         return(new JsonResult(logs));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public object GetInterfaceLogsPageList(string fields, string id, int page, int rows)
 {
     try
     {
         SystemSettingBase settings = SystemSettingBase.CreateInstance();
         if (settings.SysMySqlDB != null)
         {
             ConnString.MySqldb = settings.SysMySqlDB.ConnectionString;
         }
         PageInfo pageInfo = new PageInfo()
         {
             PageIndex = rows * (page - 1),
             PageSize  = rows,
             RecCount  = 0
         };
         if (string.IsNullOrEmpty(fields))
         {
             fields = "*";
         }
         string where = string.Empty;
         if (!string.IsNullOrEmpty(id))
         {
             where = string.Format(" where ConfigId = '{0}' order by CreateTime desc ", id);
         }
         string limit = string.Empty;
         limit = string.Format("limit {0},{1}", pageInfo.PageIndex, pageInfo.PageSize);
         List <InterfaceExceptionlog> list = InterfaceExceptionlogOperation.GetInterfaceExceptionlogList(fields, where);
         pageInfo.RecCount = list.Count;
         List <InterfaceExceptionlog>       target = InterfaceExceptionlogOperation.GetInterfaceExceptionByCondition(fields, where, limit);
         GridResult <InterfaceExceptionlog> result = new GridResult <InterfaceExceptionlog>(target, pageInfo.RecCount);
         return(new JsonResult(result));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 /// <summary>
 /// 获取接口异常日志信息列表
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button14_Click(object sender, EventArgs e)
 {
     string fields        = "Id,ConfigId,StateCode,ExceptionInfo,CreateTime";
     string whereCndition = "where StateCode = 500";
     List <InterfaceExceptionlog> list = InterfaceExceptionlogOperation.GetInterfaceExceptionlogList(fields, whereCndition);
 }