first commit
Cette révision appartient à :
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementEx;
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementReader;
|
||||
import org.zhiqim.httpd.HttpRequest;
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.orm.ORM;
|
||||
import org.zhiqim.orm.dbo.Selector;
|
||||
|
||||
/**
|
||||
* 公告数据访问对象
|
||||
*
|
||||
* @version v1.0.0 @author zouzhigang 2017-11-17 新建与整理
|
||||
*/
|
||||
@AnAlias("ZoaAnnouncementDao")
|
||||
public class ZoaAnnouncementDao
|
||||
{
|
||||
/**
|
||||
* 获取是否有未读公告
|
||||
*
|
||||
* @param request 请求
|
||||
* @return =true表示有,=false表示没有
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public static boolean hasUnReadAnnouncement(HttpRequest request) throws Exception
|
||||
{
|
||||
Selector selector = new Selector();
|
||||
selector.addJoin(ZoaAnnouncementReader.class, new Selector("operatorCode", request.getSessionName()));
|
||||
selector.addMust("announcementStatus", 0);
|
||||
selector.addMustIsNull("operatorCode");
|
||||
|
||||
return ORM.view().count(ZoaAnnouncementEx.class, selector) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement;
|
||||
|
||||
import org.zhiqim.httpd.HttpSession;
|
||||
import org.zhiqim.httpd.HttpSessionUser;
|
||||
import org.zhiqim.httpd.HttpWebsocket;
|
||||
import org.zhiqim.httpd.HttpWebsocketConnection;
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.kernel.util.Ids;
|
||||
|
||||
@AnAlias("zoa_announcement")
|
||||
public class ZoaAnnouncementWS implements HttpWebsocket
|
||||
{
|
||||
@Override
|
||||
public void onOpen(HttpWebsocketConnection conn)
|
||||
{
|
||||
HttpSessionUser sessionUser = conn.getSession().getSessionUser();
|
||||
if (sessionUser == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(HttpWebsocketConnection conn)
|
||||
{
|
||||
HttpSessionUser sessionUser = conn.getSession().getSessionUser();
|
||||
if (sessionUser == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onException(HttpWebsocketConnection conn, Throwable e)
|
||||
{
|
||||
HttpSessionUser sessionUser = conn.getSession().getSessionUser();
|
||||
if (sessionUser == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(HttpWebsocketConnection conn, String message)
|
||||
{
|
||||
HttpSession session = conn.getSession();
|
||||
|
||||
HttpSessionUser sessionUser = session.getSessionUser();
|
||||
if (sessionUser == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
conn.send("" + Ids.longId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(HttpWebsocketConnection conn, byte[] message)
|
||||
{
|
||||
HttpSessionUser sessionUser = conn.getSession().getSessionUser();
|
||||
if (sessionUser == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
conn.send("" + Ids.longId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.action;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncement;
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementEx;
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementReader;
|
||||
import org.zhiqim.httpd.HttpRequest;
|
||||
import org.zhiqim.httpd.HttpSessionManager;
|
||||
import org.zhiqim.httpd.HttpSessionUser;
|
||||
import org.zhiqim.httpd.HttpWebsocketConnection;
|
||||
import org.zhiqim.httpd.context.extend.StdSwitchAction;
|
||||
import org.zhiqim.httpd.validate.ones.IsIntegerValue;
|
||||
import org.zhiqim.httpd.validate.ones.IsLen;
|
||||
import org.zhiqim.httpd.validate.ones.IsNotEmpty;
|
||||
import org.zhiqim.kernel.paging.PageResult;
|
||||
import org.zhiqim.kernel.util.Ids;
|
||||
import org.zhiqim.kernel.util.Sqls;
|
||||
import org.zhiqim.orm.ORM;
|
||||
import org.zhiqim.orm.dbo.Selector;
|
||||
import org.zhiqim.orm.dbo.Updater;
|
||||
|
||||
/**
|
||||
* 公告管理,支持公告的增加、修改和删除权限
|
||||
*
|
||||
* @version v1.0.0 @author duanxiaohui 2017-11-13 新建与整理
|
||||
*/
|
||||
public class AnnouncementAction extends StdSwitchAction
|
||||
{
|
||||
|
||||
@Override
|
||||
protected void validateId(HttpRequest request)
|
||||
{
|
||||
request.addValidate(new IsNotEmpty("announcementId", "请选择一个选项"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void validateForm(HttpRequest request)
|
||||
{
|
||||
request.addValidate(new IsLen("announcementTitle", "公告标题不能为空,[1, 60]范围", 1, 60));
|
||||
request.addValidate(new IsIntegerValue("announcementType", "公告类型请选择一项", 1, 3));
|
||||
request.addValidate(new IsLen("announcementContent", "公告内容不能为空,[1, 1000]范围", 1, 1000));
|
||||
}
|
||||
|
||||
protected void item(HttpRequest request) throws Exception
|
||||
{
|
||||
long announcementId = request.getParameterLong("announcementId");
|
||||
ZoaAnnouncement item = ORM.table().item(ZoaAnnouncement.class, announcementId);
|
||||
if (item == null)
|
||||
{
|
||||
request.returnHistory("该公告不存在或数据不完整!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ORM.table().count(ZoaAnnouncementReader.class, announcementId, request.getSessionName()) == 0)
|
||||
{//未读的,更新为已读
|
||||
ZoaAnnouncementReader reader = new ZoaAnnouncementReader();
|
||||
reader.setAnnouncementId(announcementId);
|
||||
reader.setOperatorCode(request.getSessionName());
|
||||
ORM.table().insert(reader);
|
||||
}
|
||||
|
||||
request.setAttribute("item", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void list(HttpRequest request) throws Exception
|
||||
{
|
||||
int pageNo = request.getParameterInt("page", 1);
|
||||
int pageSize = request.getContextAttributeInt("fmr_page_size", 20);
|
||||
|
||||
Selector selector = new Selector();
|
||||
selector.addJoin(ZoaAnnouncementReader.class, new Selector("operatorCode", request.getSessionName()));
|
||||
selector.addMaybeLike("announcementTitle", request.getParameter("announcementTitle"));
|
||||
selector.addMust("announcementStatus", 0);
|
||||
selector.addOrderbyDesc("announcementTime");
|
||||
|
||||
PageResult<ZoaAnnouncementEx> result = ORM.view().page(ZoaAnnouncementEx.class, pageNo, pageSize, selector);
|
||||
result.addConditionMap(request.getParameterMap());
|
||||
|
||||
request.setAttribute("result", result);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void add(HttpRequest request) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void insert(HttpRequest request) throws Exception
|
||||
{
|
||||
String announcementTitle = request.getParameter("announcementTitle");
|
||||
int announcementType = request.getParameterInt("announcementType");
|
||||
String announcementContent = request.getParameter("announcementContent");
|
||||
|
||||
ZoaAnnouncement item = new ZoaAnnouncement();
|
||||
item.setAnnouncementId(Ids.longId());
|
||||
item.setAnnouncementTitle(announcementTitle);
|
||||
item.setAnnouncementType(announcementType);
|
||||
item.setAnnouncementStatus(0);
|
||||
item.setAnnouncementContent(announcementContent);
|
||||
item.setAnnouncementTime(Sqls.nowTimestamp());
|
||||
item.setAnnouncementPublisher(request.getSessionName());
|
||||
|
||||
ORM.table().insert(item);
|
||||
|
||||
//对所有连上来的WS进行消息推送
|
||||
HttpSessionManager manager = request.getContext().getSessionManager();
|
||||
List<HttpSessionUser> list = manager.getSessionUserList();
|
||||
for (HttpSessionUser sessionUser : list)
|
||||
{
|
||||
List<HttpWebsocketConnection> connList = request.getContext().getWebsocketManager().get("zoa_announcement", sessionUser.getSessionId());
|
||||
for (HttpWebsocketConnection conn : connList)
|
||||
{
|
||||
conn.send("zoa_announcement_new");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void delete(HttpRequest request) throws Exception
|
||||
{//实际为修改为已删除状态
|
||||
|
||||
Updater updater = new Updater();
|
||||
updater.addMust("announcementId", request.getParameterLong("announcementId"));
|
||||
updater.addField("announcementStatus", 1);
|
||||
|
||||
ORM.table().update(ZoaAnnouncement.class, updater);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
//不支持修改
|
||||
/****************************************************************************************/
|
||||
|
||||
@Override
|
||||
protected void modify(HttpRequest request) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void update(HttpRequest request) throws Exception
|
||||
{
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.action;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementReaderEx;
|
||||
import org.zhiqim.httpd.HttpRequest;
|
||||
import org.zhiqim.httpd.context.core.Action;
|
||||
import org.zhiqim.kernel.paging.PageResult;
|
||||
import org.zhiqim.kernel.util.Validates;
|
||||
import org.zhiqim.orm.ORM;
|
||||
import org.zhiqim.orm.dbo.Selector;
|
||||
|
||||
/**
|
||||
* 公告阅读列表
|
||||
*
|
||||
* @version v1.0.0 @author duanxiaohui 2017-11-13 新建与整理
|
||||
*/
|
||||
public class AnnouncementReaderListAction implements Action
|
||||
{
|
||||
@Override
|
||||
public void execute(HttpRequest request) throws Exception
|
||||
{
|
||||
int pageNo = request.getParameterInt("page", 1);
|
||||
int pageSize = request.getContextAttributeInt("fmr_page_size", 20);
|
||||
|
||||
long announcementId = request.getParameterLong("announcementId");
|
||||
|
||||
Selector selector = new Selector();
|
||||
selector.addMust("announcementId", announcementId);
|
||||
String operatorKey = request.getParameter("operatorKey");
|
||||
|
||||
if (Validates.isNotEmpty(operatorKey))
|
||||
{//条件
|
||||
selector.addOr(new Selector().addMaybeLike("operatorCode", operatorKey).addMaybeLike("operatorName", operatorKey));
|
||||
}
|
||||
|
||||
PageResult<ZoaAnnouncementReaderEx> result = ORM.view().page(ZoaAnnouncementReaderEx.class, pageNo, pageSize, selector);
|
||||
result.addConditionMap(request.getParameterMap());
|
||||
|
||||
request.setAttribute("result", result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.action;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementEx;
|
||||
import org.zhiqim.httpd.HttpRequest;
|
||||
import org.zhiqim.httpd.context.core.Action;
|
||||
import org.zhiqim.kernel.paging.PageResult;
|
||||
import org.zhiqim.orm.ORM;
|
||||
import org.zhiqim.orm.dbo.Selector;
|
||||
|
||||
/**
|
||||
* 公告回收站(已删除列表)
|
||||
*
|
||||
* @version v1.0.0 @author duanxiaohui 2017-11-16 新建与整理
|
||||
*/
|
||||
public class AnnouncementRecycleAction implements Action
|
||||
{
|
||||
@Override
|
||||
public void execute(HttpRequest request) throws Exception
|
||||
{
|
||||
int pageNo = request.getParameterInt("page", 1);
|
||||
int pageSize = request.getContextAttributeInt("fmr_page_size", 20);
|
||||
|
||||
Selector selector = new Selector();
|
||||
selector.addMust("announcementStatus", 1);
|
||||
selector.addOrderbyDesc("announcementTime");
|
||||
|
||||
PageResult<ZoaAnnouncementEx> result = ORM.view().page(ZoaAnnouncementEx.class, pageNo, pageSize, selector);
|
||||
result.addConditionMap(request.getParameterMap());
|
||||
|
||||
request.setAttribute("result", result);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.action;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncement;
|
||||
import org.zhiqim.httpd.HttpRequest;
|
||||
import org.zhiqim.httpd.context.core.Action;
|
||||
import org.zhiqim.orm.ORM;
|
||||
|
||||
/**
|
||||
* 公告彻底删除
|
||||
*
|
||||
* @version v1.0.0 @author zouzhigang 2017-11-17 新建与整理
|
||||
*/
|
||||
public class AnnouncementRecycleDeleteAction implements Action
|
||||
{
|
||||
@Override
|
||||
public void execute(HttpRequest request) throws Exception
|
||||
{
|
||||
long announcementId = request.getParameterLong("announcementId");
|
||||
if(announcementId == -1)
|
||||
{
|
||||
request.returnHistory("该公告不存在");
|
||||
return;
|
||||
}
|
||||
|
||||
ORM.table().delete(ZoaAnnouncement.class, announcementId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.dbo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.kernel.json.Jsons;
|
||||
import org.zhiqim.orm.annotation.*;
|
||||
|
||||
/**
|
||||
* 公告表 对应表《ZOA_ANNOUNCEMENT》
|
||||
*/
|
||||
@AnAlias("ZoaAnnouncement")
|
||||
@AnTable(table="ZOA_ANNOUNCEMENT", key="ANNOUNCEMENT_ID", type="InnoDB")
|
||||
public class ZoaAnnouncement implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@AnTableField(column="ANNOUNCEMENT_ID", type="long", notNull=true) private long announcementId; //1.公告编号
|
||||
@AnTableField(column="ANNOUNCEMENT_TITLE", type="string,60", notNull=true) private String announcementTitle; //2.公告标题
|
||||
@AnTableField(column="ANNOUNCEMENT_TYPE", type="byte", notNull=true) private int announcementType; //3.公告类型:1,行政公告 2,假日公告 3,会议公告
|
||||
@AnTableField(column="ANNOUNCEMENT_STATUS", type="int", notNull=true) private int announcementStatus; //4.公告状态:0,正常 1,已删除
|
||||
@AnTableField(column="ANNOUNCEMENT_CONTENT", type="string,1000", notNull=true) private String announcementContent; //5.公告内容
|
||||
@AnTableField(column="ANNOUNCEMENT_PUBLISHER", type="string,32", notNull=true) private String announcementPublisher; //6.公告发布人
|
||||
@AnTableField(column="ANNOUNCEMENT_TIME", type="datetime", notNull=true) private Timestamp announcementTime; //7.公告发布时间
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return Jsons.toString(this);
|
||||
}
|
||||
|
||||
public long getAnnouncementId()
|
||||
{
|
||||
return announcementId;
|
||||
}
|
||||
|
||||
public void setAnnouncementId(long announcementId)
|
||||
{
|
||||
this.announcementId = announcementId;
|
||||
}
|
||||
|
||||
public String getAnnouncementTitle()
|
||||
{
|
||||
return announcementTitle;
|
||||
}
|
||||
|
||||
public void setAnnouncementTitle(String announcementTitle)
|
||||
{
|
||||
this.announcementTitle = announcementTitle;
|
||||
}
|
||||
|
||||
public int getAnnouncementType()
|
||||
{
|
||||
return announcementType;
|
||||
}
|
||||
|
||||
public void setAnnouncementType(int announcementType)
|
||||
{
|
||||
this.announcementType = announcementType;
|
||||
}
|
||||
|
||||
public int getAnnouncementStatus()
|
||||
{
|
||||
return announcementStatus;
|
||||
}
|
||||
|
||||
public void setAnnouncementStatus(int announcementStatus)
|
||||
{
|
||||
this.announcementStatus = announcementStatus;
|
||||
}
|
||||
|
||||
public String getAnnouncementContent()
|
||||
{
|
||||
return announcementContent;
|
||||
}
|
||||
|
||||
public void setAnnouncementContent(String announcementContent)
|
||||
{
|
||||
this.announcementContent = announcementContent;
|
||||
}
|
||||
|
||||
public String getAnnouncementPublisher()
|
||||
{
|
||||
return announcementPublisher;
|
||||
}
|
||||
|
||||
public void setAnnouncementPublisher(String announcementPublisher)
|
||||
{
|
||||
this.announcementPublisher = announcementPublisher;
|
||||
}
|
||||
|
||||
public Timestamp getAnnouncementTime()
|
||||
{
|
||||
return announcementTime;
|
||||
}
|
||||
|
||||
public void setAnnouncementTime(Timestamp announcementTime)
|
||||
{
|
||||
this.announcementTime = announcementTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.dbo;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncement;
|
||||
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.kernel.json.Jsons;
|
||||
import org.zhiqim.orm.annotation.*;
|
||||
|
||||
/**
|
||||
* 公告扩展视图 对应视图《ZOA_ANNOUNCEMENT_EX》
|
||||
*/
|
||||
@AnAlias("ZoaAnnouncementEx")
|
||||
@AnView("ZOA_ANNOUNCEMENT,ZOA_ANNOUNCEMENT_READER")
|
||||
@AnViewJoin({@AnViewJoinValue(type="LEFT", lTable="ZOA_ANNOUNCEMENT", lColumn="ANNOUNCEMENT_ID", rTable="ZOA_ANNOUNCEMENT_READER", rColumn="ANNOUNCEMENT_ID")})
|
||||
public class ZoaAnnouncementEx extends ZoaAnnouncement
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@AnViewField(table="ZOA_ANNOUNCEMENT_READER", column="OPERATOR_CODE") private String operatorCode; //2.公告阅读操作员
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return Jsons.toString(this);
|
||||
}
|
||||
|
||||
public String getOperatorCode()
|
||||
{
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode)
|
||||
{
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.dbo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.kernel.json.Jsons;
|
||||
import org.zhiqim.orm.annotation.*;
|
||||
|
||||
/**
|
||||
* 公告阅读表 对应表《ZOA_ANNOUNCEMENT_READER》
|
||||
*/
|
||||
@AnAlias("ZoaAnnouncementReader")
|
||||
@AnTable(table="ZOA_ANNOUNCEMENT_READER", key="ANNOUNCEMENT_ID,OPERATOR_CODE", type="InnoDB")
|
||||
public class ZoaAnnouncementReader implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@AnTableField(column="OPERATOR_CODE", type="string,32", notNull=true) private String operatorCode; //1.公告阅读操作员
|
||||
@AnTableField(column="ANNOUNCEMENT_ID", type="long", notNull=true) private long announcementId; //2.公告编号
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return Jsons.toString(this);
|
||||
}
|
||||
|
||||
public String getOperatorCode()
|
||||
{
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode)
|
||||
{
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public long getAnnouncementId()
|
||||
{
|
||||
return announcementId;
|
||||
}
|
||||
|
||||
public void setAnnouncementId(long announcementId)
|
||||
{
|
||||
this.announcementId = announcementId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.announcement.dbo;
|
||||
|
||||
import org.zhiqim.announcement.dbo.ZoaAnnouncementReader;
|
||||
|
||||
import org.zhiqim.kernel.annotation.AnAlias;
|
||||
import org.zhiqim.kernel.json.Jsons;
|
||||
import org.zhiqim.orm.annotation.*;
|
||||
|
||||
/**
|
||||
* 公告阅读扩展视图 对应视图《ZOA_ANNOUNCEMENT_READER_EX》
|
||||
*/
|
||||
@AnAlias("ZoaAnnouncementReaderEx")
|
||||
@AnView("ZOA_ANNOUNCEMENT_READER,ZMR_OPERATOR")
|
||||
@AnViewJoin({@AnViewJoinValue(type="EQUAL", lTable="ZOA_ANNOUNCEMENT_READER", lColumn="OPERATOR_CODE", rTable="ZMR_OPERATOR", rColumn="OPERATOR_CODE")})
|
||||
public class ZoaAnnouncementReaderEx extends ZoaAnnouncementReader
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@AnViewField(table="ZMR_OPERATOR", column="OPERATOR_CODE") private String operatorCode; //2.操作员编码
|
||||
@AnViewField(table="ZMR_OPERATOR", column="OPERATOR_NAME") private String operatorName; //3.操作员名称
|
||||
@AnViewField(table="ZMR_OPERATOR", column="OPERATOR_AVATAR") private long operatorAvatar; //4.操作员头像编号
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return Jsons.toString(this);
|
||||
}
|
||||
|
||||
public String getOperatorCode()
|
||||
{
|
||||
return operatorCode;
|
||||
}
|
||||
|
||||
public void setOperatorCode(String operatorCode)
|
||||
{
|
||||
this.operatorCode = operatorCode;
|
||||
}
|
||||
|
||||
public String getOperatorName()
|
||||
{
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName)
|
||||
{
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public long getOperatorAvatar()
|
||||
{
|
||||
return operatorAvatar;
|
||||
}
|
||||
|
||||
public void setOperatorAvatar(long operatorAvatar)
|
||||
{
|
||||
this.operatorAvatar = operatorAvatar;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.httpd.context.config;
|
||||
|
||||
import org.zhiqim.httpd.context.config.ZAttribute;
|
||||
|
||||
public class ZAttributeTest
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ZAttribute attribute = new ZAttribute();
|
||||
attribute.setName("验证码长度");
|
||||
attribute.setKey("validateCode.width");
|
||||
attribute.setValue("30");
|
||||
|
||||
String ret = "<attribute name=\"验证码长度\" key=\"validateCode.width\" value=\"30\" />";
|
||||
|
||||
System.out.println(attribute.toString());
|
||||
System.out.println(ret.equals(attribute.toString()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
|
||||
*
|
||||
* 知启蒙WEB容器(zhiqim_httpd)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_httpd.htm
|
||||
*
|
||||
* This file is part of [zhiqim_httpd].
|
||||
*
|
||||
* [zhiqim_httpd] is free software: you can redistribute
|
||||
* it and/or modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* [zhiqim_httpd] is distributed in the hope that it will
|
||||
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with [zhiqim_httpd].
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.zhiqim.httpd.test;
|
||||
|
||||
import org.zhiqim.httpd.HttpSessionUser;
|
||||
|
||||
public class SessionUser extends HttpSessionUser
|
||||
{
|
||||
@Override
|
||||
public String getSessionName()
|
||||
{
|
||||
return "abc";
|
||||
}
|
||||
|
||||
}
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur