📄 usergroupprivdb.java~16~
字号:
package com.redmoon.forum.person;
import com.cloudwebsoft.framework.base.*;
import com.cloudwebsoft.framework.db.JdbcTemplate;
import com.redmoon.forum.Config;
import com.cloudwebsoft.framework.util.LogUtil;
import cn.js.fan.util.ResKeyException;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class UserGroupPrivDb extends QObjectDb {
public UserGroupPrivDb() {
}
public boolean init(String groupCode, String boardCode) {
Config cfg = new Config();
// 发表贴子 回复贴子
String priv = "11";
String strMaxAttachmentSize = cfg.getProperty("forum.maxAttachmentSize");
int maxAttachmentSize = Integer.parseInt(strMaxAttachmentSize);
String attach_upload = cfg.getProperty("forum.canUserUploadAttach").
equals("true") ? "1" : "0";
String attach_download = cfg.getProperty("forum.canUserDownloadAttach").
equals("true") ? "1" : "0";
String add_topic = cfg.getProperty("forum.canUserAddTopic").equals(
"true") ? "1" : "0";
String reply_topic = cfg.getProperty("forum.canUserReplyTopic").equals(
"true") ? "1" : "0";
String vote = cfg.getProperty("forum.canUserVote").equals("true") ? "1" :
"0";
String search = cfg.getProperty("forum.canUserSearch").equals("true")?"1":"0";
boolean re = false;
try {
re = create(new JdbcTemplate(), new Object[] {
groupCode, boardCode, priv,
new Integer(maxAttachmentSize), attach_upload,
attach_download, add_topic, reply_topic, vote, search
});
}
catch (ResKeyException e) {
// LogUtil.getLog(getClass()).error("create:" + e.getMessage());
throw new IllegalArgumentException(e.getMessage());
}
return re;
}
public UserGroupPrivDb getUserGroupPrivDb(String groupCode, String boardCode) {
primaryKey.setKeyValue("group_code", groupCode);
primaryKey.setKeyValue("board_code", boardCode);
UserGroupPrivDb ugp = (UserGroupPrivDb)getQObjectDb(primaryKey.getKeys());
// LogUtil.getLog(getClass()).info("getUserGroupPrivDb:" + primaryKey);
if (ugp==null) {
init(groupCode, boardCode);
return (UserGroupPrivDb)getQObjectDb(primaryKey.getKeys());
}
else
return ugp;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -