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.
97 lines
3.5 KiB
97 lines
3.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
using Operation;
|
|
using Sog;
|
|
using LitJson;
|
|
using SimpleHttpServer;
|
|
using MySql.Data.MySqlClient;
|
|
|
|
using ProtoCSStruct;
|
|
|
|
namespace Operation
|
|
{
|
|
public class SelectEmail
|
|
{
|
|
[RequestMapping("查询邮件",PermissionCode.MAIL_SELECT_LIST)]
|
|
public static int OnSelectEmailHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
|
|
{
|
|
TraceLog.Trace("SelectEmail.OnSelectEmailHttpReq url {0} ,param count {1} ,httpContextId {2}", request.Url, query.Count, httpContextId);
|
|
|
|
string startDate = query.GetValue("startDate");
|
|
string endDate = (query.GetValue("endDate") + " 23:59:59");
|
|
int page = query.GetValue("page").Toint32(0);
|
|
int pageCount = query.GetValue("limit").Toint32(10);
|
|
int tail = query.GetValue("tail").Toint32(0);
|
|
|
|
|
|
TraceLog.Trace("SelectEmail.OnSelectEmailHttpReq startDate {0} ,endDate {1} ,page {2} ,pageCount {3}", startDate, endDate, page, pageCount);
|
|
|
|
RepeatedFixedStructString128_10 data = new RepeatedFixedStructString128_10();
|
|
data.Add(startDate);
|
|
data.Add(endDate);
|
|
data.Add(page.ToString());
|
|
data.Add(pageCount.ToString());
|
|
data.Add(tail.ToString());
|
|
HttpApiRootHandler.FillHttpApiDbReq2MessageTaskDistributor(httpApiCmd, httpContextId, ref data);
|
|
|
|
rsp.IsWaitFor = true;
|
|
|
|
return 0;
|
|
}
|
|
|
|
public static int DoSelectEmail(string httpApiCmd, SSHttpApiDbReq req, DBOperator dbOperator)
|
|
{
|
|
TraceLog.Trace("SelectEmail.DoSelectEmail 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);
|
|
|
|
if (req.Data.Count < 5)
|
|
{
|
|
TraceLog.Error("SelectEmail.DoSelectEmail param error");
|
|
builder["ret"] = 2;
|
|
builder["msg"] = "参数错误";
|
|
}
|
|
else
|
|
{
|
|
int tail = Convert.ToInt32(req.Data[4].ToString());
|
|
if (tail < 0)
|
|
{
|
|
dbOperator.DBSelectReviewEmail(req.Data[0].ToString(), req.Data[1].ToString(), int.Parse(req.Data[2].ToString()), int.Parse(req.Data[3].ToString()), builder);
|
|
}
|
|
else
|
|
{
|
|
dbOperator.DBSelectEmail(req.Data[0].ToString(), req.Data[1].ToString(), int.Parse(req.Data[2].ToString()), int.Parse(req.Data[3].ToString()), builder);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
TraceLog.Error("SelectEmail.DoSelectEmail Error Msg {0}", ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
if (m_request != null)
|
|
{
|
|
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
|
|
m_request.ProcessEnd = true;
|
|
}
|
|
}
|
|
|
|
TraceLog.Trace("SelectEmail.DoSelectEmail success httpContextId {0}", req.HttpContextId);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
|