📄 infomsgaction.java
字号:
package com.redmoon.forum.plugin.info;import javax.servlet.http.HttpServletRequest;import cn.js.fan.util.ErrMsgException;import javax.servlet.ServletContext;import com.redmoon.forum.plugin.base.IPluginMsgAction;import org.apache.log4j.Logger;import com.redmoon.forum.MsgDb;import cn.js.fan.util.ResKeyException;import com.redmoon.kit.util.FileUpload;public class InfoMsgAction implements IPluginMsgAction { Logger logger = Logger.getLogger(this.getClass().getName()); public InfoMsgAction() { } public synchronized boolean editTopic(ServletContext application, HttpServletRequest request, MsgDb md, FileUpload fu) throws ErrMsgException { boolean re = true; if (md.getReplyid() == -1) { InfoDb infoDb = new InfoDb(); infoDb = infoDb.getInfoDb(md.getId()); String typeCode = fu.getFieldValue("typeCode"); if (typeCode==null || typeCode.equals("") || typeCode.equals("not")) throw new ErrMsgException(InfoSkin.LoadString(request, "err_want_typecode")); infoDb.setTypeCode(typeCode); re = infoDb.save(); } return re; } public boolean AddNew(ServletContext application, HttpServletRequest request, MsgDb md, FileUpload fu) throws ErrMsgException { String typeCode = fu.getFieldValue("typeCode"); if (typeCode==null || typeCode.equals("") || typeCode.equals("not")) throw new ErrMsgException(InfoSkin.LoadString(request, "err_want_typecode")); InfoDb infoDb = new InfoDb(); infoDb.setId(md.getId()); infoDb.setTypeCode(typeCode); infoDb.setUserName(md.getName()); boolean re = false; try { re = infoDb.create(); } catch (ResKeyException e) { throw new ErrMsgException(e.getMessage(request)); } return re; } public boolean AddQuickReply(ServletContext application, HttpServletRequest request, long replyMsgId) throws ErrMsgException { return true; } public boolean delTopic(ServletContext application, HttpServletRequest request, MsgDb md) throws ErrMsgException { if (md.getReplyid() == -1) { InfoDb sd = new InfoDb(); sd = sd.getInfoDb(md.getId()); sd.del(); } return true; } public boolean delSingleMsg(long delId) throws ResKeyException { return true; } public boolean AddReply(ServletContext application, HttpServletRequest request, MsgDb md, FileUpload fu) throws ErrMsgException { return true; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -