You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
3.2 KiB
74 lines
3.2 KiB
using System;
|
|
using Sog;
|
|
using LitJson;
|
|
using SimpleHttpServer;
|
|
using ProtoCSStruct;
|
|
using System.Globalization;
|
|
|
|
namespace Operation
|
|
{
|
|
[MenuMapping(MenuName.SYSTEM_MANAGER, MenuIcon.SYSTEM_MANAGER, 10, PermissionCode.SYSTEM_DEFAULT)]
|
|
class OperationLog
|
|
{
|
|
[RequestMapping("系统日志", PermissionCode.SYSTEM_OPERATION_LOG, true)]
|
|
public static int OnSelectOperationLogHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
|
|
{
|
|
TraceLog.Trace("OperationLog.OnSelectOperationLogHttpReq url {0} ,param count {1} ,httpContextId {2}", request.Url, query.Count, httpContextId);
|
|
|
|
int pageSize = query.GetValue("limit").Toint32(0) == 0 ? 10 : query.GetValue("limit").Toint32(0);
|
|
int pageIndex = query.GetValue("page").Toint32(0) == 0 ? 1 : query.GetValue("page").Toint32(0);
|
|
string account = query.GetValue("account") ?? "";
|
|
string method = query.GetValue("method") ?? "";
|
|
string url = query.GetValue("url") ?? "";
|
|
string start = query.GetValue("start") ?? "";//DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd HH:mm:ss");
|
|
string end = query.GetValue("end") ?? "";// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
TraceLog.Trace("OperationLog.OnSelectOperationLogHttpReq account {0}", account);
|
|
RepeatedFixedStructString128_10 data = new RepeatedFixedStructString128_10();
|
|
|
|
|
|
data.Add(pageIndex.ToString());
|
|
data.Add(pageSize.ToString());
|
|
|
|
data.Add(account);
|
|
data.Add(method);
|
|
data.Add(url);
|
|
data.Add(start);
|
|
data.Add(end);
|
|
HttpApiRootHandler.FillHttpApiDbReq2MessageTaskDistributor(httpApiCmd, httpContextId, ref data);
|
|
|
|
rsp.IsWaitFor = true;
|
|
|
|
return 0;
|
|
}
|
|
|
|
public static int DoSelectOperationLog(string httpApiCmd, SSHttpApiDbReq req, DBOperator dbOperator)
|
|
{
|
|
TraceLog.Trace("OperationLog.DoSelectOperationLog HttpContextId {0}", req.HttpContextId);
|
|
HttpRequestInfo m_request = null;
|
|
LitJson.JsonData builder = new LitJson.JsonData();
|
|
try
|
|
{
|
|
var httpContextId = req.HttpContextId;
|
|
m_request = OperationServer.m_httpService.m_requestList.Find(f => f.Http.id == httpContextId);
|
|
dbOperator.SelectOperationLog(builder,int.Parse(req.Data[0].ToString()),int.Parse(req.Data[1].ToString()),req.Data[2].ToString(),req.Data[3].ToString(),req.Data[4].ToString(), req.Data[5].ToString(), req.Data[6].ToString());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
TraceLog.Error("OperationLog.DoSelectOperationLog Error Msg {0}", ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
if (m_request != null)
|
|
{
|
|
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
|
|
m_request.ProcessEnd = true;
|
|
}
|
|
}
|
|
|
|
TraceLog.Trace("OperationLog.DoSelectOperationLog success httpContextId {0}", req.HttpContextId);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
}
|