using System; using Sog; using LitJson; using SimpleHttpServer; using MySql.Data.MySqlClient; using ProtoCSStruct; namespace Operation { [MenuMapping(MenuName.BAN_MANAGER,MenuIcon.BAN,5,PermissionCode.BAN_MANAGER)] public class SelectBanUser { [RequestMapping("封号查询",PermissionCode.BAN_SELECT,true)] public static int OnSelectBanUserHttpReq(string httpApiCmd, JsonData Jsondata, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId) { TraceLog.Trace("SelectBanUser.OnSelectBanUserHttpReq url {0} ,param count {1} ,httpContextId {2}", request.Url, query.Count, httpContextId); int type = query.GetValue("type").Toint32(0); string startDate = query.GetValue("startDate"); string endDate = (query.GetValue("endDate") + " 23:59:59"); TraceLog.Trace("SelectBanUser.OnSelectBanUserHttpReq start {0} ,end {1}", startDate, endDate); RepeatedFixedStructString128_10 data = new RepeatedFixedStructString128_10(); data.Add(type.ToString()); data.Add(startDate); data.Add(endDate); HttpApiRootHandler.FillHttpApiDbReq2MessageTaskDistributor(httpApiCmd, httpContextId, ref data); rsp.IsWaitFor = true; return 0; } public static int DoSelectBanUser(string httpApiCmd, SSHttpApiDbReq req, DBOperator dbOperator) { TraceLog.Trace("SelectBanUser.DoSelectBanUser HttpContextId {0} httpApiCmd {1}", req.HttpContextId, httpApiCmd); 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); if (req.Data.Count < 3) { TraceLog.Error("SelectBanUser.DoSelectBanUser param error"); builder["ret"] = 2; builder["msg"] = "参数Id错误"; } else dbOperator.DBSelectBanUser(int.Parse(req.Data[0].ToString()), req.Data[1].ToString(), req.Data[2].ToString(), builder); } catch (Exception ex) { TraceLog.Error("SelectBanUser.DoSelectBanUser Error Msg {0}", ex.Message); } finally { if (m_request != null) { m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson(); m_request.ProcessEnd = true; } } TraceLog.Trace("SelectBanUser.DoSelectBanUser success httpContextId {0}", req.HttpContextId); return 0; } } }