userconfigmgr.java

来自「cwbbs 云网论坛源码」· Java 代码 · 共 56 行

JAVA
56
字号
package com.redmoon.blog;import javax.servlet.http.HttpServletRequest;import cn.js.fan.util.ErrMsgException;import cn.js.fan.util.ResKeyException;import cn.js.fan.web.SkinUtil;import javax.servlet.ServletContext;public class UserConfigMgr {    long blogId;    public UserConfigMgr() {    }    public boolean create(ServletContext application, HttpServletRequest request) throws            ErrMsgException {        com.redmoon.forum.Privilege pvg = new com.redmoon.forum.Privilege();        if (pvg.isUserLogin(request)) {            UserConfigForm ucf = new UserConfigForm(application, request);            ucf.checkCreate();            UserConfigDb ucd = ucf.getUserConfigDb();            boolean re = ucd.create(ucf.fileUpload);            if (re) {                BlogDb bd = BlogDb.getInstance();                bd.setNewBlogId(ucd.getId());                bd.save();                blogId = ucd.getId();            }            return re;        } else            throw new ErrMsgException(SkinUtil.LoadString(request, "err_not_login"));     }    public UserConfigDb getUserConfigDb(long blogId) {        UserConfigDb ucd = new UserConfigDb();        return ucd.getUserConfigDb(blogId);    }    public boolean modify(ServletContext application, HttpServletRequest request) throws            ErrMsgException, ResKeyException {        com.redmoon.forum.Privilege pvg = new com.redmoon.forum.Privilege();        if (pvg.isUserLogin(request)) {            UserConfigForm ucf = new UserConfigForm(application, request);            ucf.checkModify();            UserConfigDb ucd = ucf.getUserConfigDb();            return ucd.save(ucf.fileUpload);        } else            throw new ErrMsgException(SkinUtil.LoadString(request, "err_not_login"));     }    public long getBlogId() {        return blogId;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?