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.
172 lines
6.6 KiB
172 lines
6.6 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 Language
|
|
{
|
|
public int id { get; set; } // //ID
|
|
public string language { get; set; } // //语言类型
|
|
public string lang_abbr { get; set; } // //语言简写
|
|
public string skip { get; set; } // //语言简写
|
|
}
|
|
|
|
[MenuMapping(refc = typeof(SendEmail))]
|
|
public class SelectNotice
|
|
{
|
|
[RequestMapping("语言配置查询",PermissionCode.LANGUAGE_SEARCH)]
|
|
public static int OnSelectLanguageAbbrCfgHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
|
|
{
|
|
TraceLog.Trace("SelectNotice.OnSelectLanguageAbbrCfgHttpReq url {0} ,param count {1}", request.Url, query.Count);
|
|
|
|
jsonData["Data"] = JsonConfig.stringify(LanguageAbbrCfgDescMgr.Instance.ItemTable.Select(s => new Language()
|
|
{
|
|
id = s.Value.id,
|
|
language = s.Value.language,
|
|
lang_abbr= s.Value.lang_abbr,
|
|
skip=s.Value.lang_skip
|
|
}).ToList());
|
|
|
|
return 0;
|
|
}
|
|
|
|
[RequestMapping("显示当日公告",PermissionCode.SHOW_NOTICE_DAY_NOTICE)]
|
|
public static int OnShowNoticeDayNoticeHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
|
|
{
|
|
TraceLog.Trace("SelectNotice.OnShowNoticeDayNoticeHttpReq url {0} ,param count {1} ,httpContextId {2}", request.Url, query.Count, httpContextId);
|
|
|
|
string noticeId = query.GetValue("noticeId");
|
|
|
|
if (noticeId.Toint32(0) <= 0)
|
|
{
|
|
TraceLog.Trace("SelectNotice.DoShowNoticeDayNotice noticeId 错误");
|
|
jsonData["ret"] = 6;
|
|
jsonData["msg"] = "noticeId 错误!";
|
|
return 6;
|
|
}
|
|
|
|
TraceLog.Trace("SelectNotice.OnShowNoticeDayNoticeHttpReq noticeId {0}", noticeId);
|
|
|
|
RepeatedFixedStructString128_10 data = new RepeatedFixedStructString128_10();
|
|
data.Add(noticeId);
|
|
HttpApiRootHandler.FillHttpApiDbReq2MessageTaskDistributor(httpApiCmd, httpContextId, ref data);
|
|
|
|
rsp.IsWaitFor = true;
|
|
|
|
return 0;
|
|
}
|
|
|
|
public static int DoShowNoticeDayNotice(string httpApiCmd, SSHttpApiDbReq req, DBOperator dbOperator)
|
|
{
|
|
TraceLog.Trace("SelectNotice.DoShowNoticeDayNotice 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 < 1)
|
|
{
|
|
TraceLog.Error("SelectNotice.DoShowNoticeDayNotice param error");
|
|
builder["ret"] = 2;
|
|
builder["msg"] = "参数错误";
|
|
}
|
|
else
|
|
dbOperator.DBShowNoticeDayNotice(req.Data[0].ToString(), builder);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
TraceLog.Error("SelectNotice.DoShowNoticeDayNotice Error Msg {0}", ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
if (m_request != null)
|
|
{
|
|
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
|
|
m_request.ProcessEnd = true;
|
|
}
|
|
}
|
|
|
|
TraceLog.Trace("SelectNotice.DoShowNoticeDayNotice success httpContextId {0}", req.HttpContextId);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
[RequestMapping("公告&拍脸图管理",PermissionCode.NOTIFIC_SELECT,true)]
|
|
public static int OnSelectNoticeHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
|
|
{
|
|
TraceLog.Trace("SelectNotice.OnSelectNoticeHttpReq url {0} ,param count {1} ,httpContextId {2}", request.Url, query.Count, httpContextId);
|
|
|
|
int page = query.GetValue("page").Toint32(0);
|
|
int pageCount = query.GetValue("limit").Toint32(10);
|
|
int popUp = query.GetValue("popUp").Toint32(0);
|
|
string noticeId = query.GetValue("noticeId");
|
|
|
|
TraceLog.Trace("SelectNotice.OnSelectNoticeHttpReq page {0} ,pageCount {1}, popUp {2}, noticeId {3}", page, pageCount, popUp, noticeId);
|
|
|
|
RepeatedFixedStructString128_10 data = new RepeatedFixedStructString128_10();
|
|
data.Add(page.ToString());
|
|
data.Add(pageCount.ToString());
|
|
data.Add(popUp.ToString());
|
|
data.Add(noticeId);
|
|
HttpApiRootHandler.FillHttpApiDbReq2MessageTaskDistributor(httpApiCmd, httpContextId, ref data);
|
|
|
|
rsp.IsWaitFor = true;
|
|
|
|
return 0;
|
|
}
|
|
|
|
public static int DoSelectNotice(string httpApiCmd, SSHttpApiDbReq req, DBOperator dbOperator)
|
|
{
|
|
TraceLog.Trace("SelectNotice.DoSelectNotice 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 < 4)
|
|
{
|
|
TraceLog.Error("SelectNotice.DoSelectNotice param error");
|
|
builder["ret"] = 2;
|
|
builder["msg"] = "参数错误";
|
|
}
|
|
else
|
|
dbOperator.DBSelectNotice(int.Parse(req.Data[0].ToString()), int.Parse(req.Data[1].ToString()), int.Parse(req.Data[2].ToString()), req.Data[3].ToString(), builder);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
TraceLog.Error("SelectNotice.DoSelectNotice Error Msg {0}", ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
if (m_request != null)
|
|
{
|
|
m_request.Http.httpResponse.ContentAsUTF8 = builder.ToJson();
|
|
m_request.ProcessEnd = true;
|
|
}
|
|
}
|
|
|
|
TraceLog.Trace("SelectNotice.DoSelectNotice success httpContextId {0}", req.HttpContextId);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|