📄 bbspropbiz.java
字号:
package com.yhbbs.bbs.biz;
import java.sql.SQLException;
import org.apache.log4j.Logger;
import com.yhbbs.bbs.dao.BbsPropDaoIm;
import com.yhbbs.bbs.itface.BbsProp;
import com.yhbbs.bbs.itface.Parameter;
import com.yhbbs.bbs.itface.dao.BbsPropDao;
/**
* <p>Title:系统属性相关操作</p>
* <li> 系统属性的所有相关操作<br>
* <br><b>WebSite: www.yyhweb.com</b>
* <br><b>CopyRight: yyhweb[由由华网]</b>
* @author stephen
* @version YHBBS-2.0
*/
public class BbsPropBiz {
private static Logger bbslog = Logger.getLogger(BbsPropBiz.class);
private static BbsPropDao propdao = BbsPropDaoIm.getInstance();
/**
* @return 取得系统属性
*/
public static BbsProp getBbsProp(){
try {
return propdao.getSysProp();
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke getBbsProp():\n" + e.toString());
}
return null;
}
/** 取得系统不允许注册的用户,e_mail,ip
* @param i 0:用户 1:mail 2:ip 3:regip
* @return String 不允许注册或登录的字符串
*/
public static String getForbid(int i){
try {
return propdao.getForbid(i);
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke getForbid(int i):\n" + e.toString());
}
return "";
}
// 后台管理使用
/** 更新系统属性
* @param property 系统属性
* @return true:成功 false:失败
*/
public static boolean updateProperty(BbsProp property){
boolean flag = true;
try {
flag = propdao.updateSysProp(property);
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke updateSysProp(property):\n" + e.toString());
flag = false;
}
return flag;
}
/** 更新系统不允许注册的用户、e_mail或IP
* @param i 0:用户 1:mail 2:ip 3:regip
* @param content
* @return true:成功 false:失败
* @throws SQLException
*/
public static boolean updateForbid(int i,String content) {
boolean flag = true;
try {
flag = propdao.updateForbid(i, content);
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke updateForbid(int i,String content):\n" + e.toString());
flag = false;
}
return flag;
}
/** 取得系统参数设置
* @return Parameter 系统参数
*/
public static Parameter getParameter(){
try {
return propdao.getParameter();
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke getParameter():\n" + e.toString());
}
return null;
}
/** 更新系统参数设置
* @param parameter 系统参数
* @return true:成功 false:失败
*/
public static boolean updateParameter(Parameter parameter) {
boolean flag = true;
try {
flag = propdao.updateParameter(parameter);
}
catch(SQLException e) {
bbslog.error("Throws a SqlException when invoke updateParameter(Parameter parameter) :\n" + e.toString());
flag = false;
}
return flag;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -