📄 articledao.java
字号:
package com.yhbbs.article.itface;
import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* <p>Title:论坛帖子数据存取模块Interface</p>
* <li> 论坛帖子相关存取和管理操作
* <li> 注:本论坛将帖子内容作为一个单独的对象处理,故在处理帖子时应该注意该帖子内容的相关处理<br>
* <br><b>WebSite: www.yyhweb.com</b>
* <br><b>CopyRight: yyhweb[由由华网]</b>
* @author stephen
* @version YHBBS-2.0
*/
public interface ArticleDao {
/**
* @return 获得昨天此刻时间
*/
public Date getYesterdayDate();
/** 取得某一个主题帖子标题
* @param articleId 文章Id
* @return String 帖子标题
* @throws SQLException
*/
public abstract String getArtTitle(int articleId) throws SQLException;
/** 取得某帖子发表时间
* <li>与当前时间比较看是否允许用户再次修改帖子
* @param articleId 文章Id
* @return String 帖子标题
* @throws SQLException
*/
public abstract Date getArtPostTime(int articleId) throws SQLException;
/** 取得某回复帖子的主题帖子ID
* @param articleId 文章Id
* @return String 帖子标题
* @throws SQLException
*/
public abstract int getReplayParentId(int articleId) throws SQLException;
/** 取得发表帖子的用户Id
* @param articleId 文章Id
* @return int 发表帖子用户Id
* @throws SQLException
*/
public abstract int getArtUserId(int articleId) throws SQLException;
/** 由帖子Id取得某一个帖子内容
* @param articleId 文章Id
* @return ArticleDto 帖子Dto
* @throws SQLException
*/
public abstract ArticleDto getArticle(int articleId) throws SQLException;
/** 由帖子ID取得某一个帖子内容
* @param id
* @return Content
* @throws SQLException
*/
public abstract Content getContent(int id) throws SQLException;
/** 由帖子ID取得某一个帖子信息和内容
* @param id
* @return Article
* @throws SQLException
*/
public abstract Article getArtContent(int id) throws SQLException;
/** 发表一个帖子时写入相关信息
* @param article
* @return boolean 成功:true 失败:false
* @throws SQLException
*/
public abstract boolean addArticle(Article article) throws SQLException;
/** 发表一个帖子时写入内容
* @param content
* @return boolean 成功:true 失败:false
* @throws SQLException
*/
public abstract boolean addContent(Content content) throws SQLException;
/** 当发表一个回复时,修改主题帖的最后回复用户和时间
* @param userMap 主题帖子Id,用户Id,用户名字
* @throws SQLException
*/
public abstract void replayArt(HashMap userMap) throws SQLException;
/** 删除一个帖子,删除恢复帖子则其主体帖子的回复数减一
* @param artId 帖子Id
* @param flag true:主题贴 false:回复贴
* @return true:成功 false:失败
* @throws SQLException
*/
public abstract boolean delArticle(int artId,boolean flag) throws SQLException;
/** 更新(编辑)一个帖子信息
* @param article
* @return true:成功 false:失败
* @throws SQLException
*/
public abstract boolean editArticle(Article article) throws SQLException;
/** 更新(编辑)一个帖子内容
* @param content
* @return true:成功 false:失败
* @throws SQLException
*/
public abstract boolean editContent(Content content) throws SQLException;
/** 移动一个帖子
* @param moveMap 区论坛\论坛及帖子Id(classId,forumId,artId)
* @return true:成功 false:失败
* @throws SQLException
*/
public abstract boolean moveArticle(HashMap moveMap) throws SQLException;
/** 设置一个帖子固顶
* @param topMap 帖子Id和固定方式(topId,artId)
* @throws SQLException
*/
public abstract void setArtTop(HashMap topMap) throws SQLException;
/** 设置帖子为精华帖
* @param artId 帖子Id
* @param flag ture:设置精华 false:取消精华
* @throws SQLException
*/
public abstract void setElite(int artId,boolean flag) throws SQLException;
/** 设置帖子为推荐帖
* @param artId 帖子Id
* @param flag ture:设置推荐 false:取消推荐
* @throws SQLException
*/
public abstract void setCommend(int artId,boolean flag) throws SQLException;
/** 设置帖子为推荐帖
* @param artId 帖子Id
* @param flag ture:锁定 false:取消锁定
* @throws SQLException
*/
public abstract void setLock(int artId,boolean flag) throws SQLException;
/** 获得系统帖子最大ID
* @return int
* @throws SQLException
*/
public abstract int getMaxArtId() throws SQLException;
/** 返回某论坛帖子最大ID
* @param forumId
* @return int
* @throws SQLException
*/
public abstract int getMaxArtId(int forumId) throws SQLException;
/** 返回某主题帖子的回复帖子的最大ID
* @param articleId
* @return int
* @throws SQLException
*/
public abstract int getMaxReplayId(int articleId) throws SQLException;
/** 返回在所有论坛固顶的所有帖子
* @return List
* @throws SQLException
*/
public abstract List getAllTop() throws SQLException;
/** 返回在某一区论坛固顶的所有帖子
* @param classId
* @return list
* @throws SQLException
*/
public abstract List getClassTop(int classId) throws SQLException;
/** 返回在某一论坛固顶的所有帖子
* @param forumId
* @return list
* @throws SQLException
*/
public abstract List getForumTop(int forumId) throws SQLException;
/** 取得某一个某论坛的精华帖子数目
* @param forumId 论坛Id
* @return int
* @throws SQLException
*/
public abstract int getForumEliteC(int forumId) throws SQLException;
/** 取得论坛精华帖子
* @param forumpage (论坛Id,start:读取数据库的开始位置,end:结束位置)
* @return list
* @throws SQLException
*/
public abstract List getForumElite(HashMap forumpage) throws SQLException;
/** 取得论坛除了固顶帖子之外的所有帖子
* @param forumpage (论坛Id,start:读取数据库的开始位置,end:结束位置)
* @return list
* @throws SQLException
*/
public abstract List getForumArt(HashMap forumpage) throws SQLException;
/** 取得论坛最后的一个帖子
* @param forumId 论坛Id
* @return 帖子
* @throws SQLException
*/
public abstract Article getForumLastArt(int forumId) throws SQLException;
/** 取得某一个帖子的回复数
* @param articleId 帖子Id
* @return int
* @throws SQLException
*/
public abstract int getArtReplayC(int articleId) throws SQLException;
/** 取得帖子的所有回复帖子的信息和内容,范围是:start-end
* @param artrp (帖子ID,start:读取数据库的开始位置,end:结束位置)
* @return list
* @throws SQLException
*/
public abstract List getArtReplay(HashMap artrp) throws SQLException;
/** 取得论坛除了固顶帖子之外的帖子数
* @param forumId 论坛Id
* @return int
* @throws SQLException
*/
public abstract int getForumNoTopC(int forumId) throws SQLException;
/** 取得所有论坛今天的帖子数
* @return int 今天的帖子数
* @throws SQLException
*/
public abstract int getTodayCount() throws SQLException;
/** 取得所有论坛昨天的帖子数
* @return int 昨天的帖子数
* @throws SQLException
*/
public abstract int getYesdayCount() throws SQLException;
/** 取得某论坛昨天的帖子数
* @param forumId 论坛Id
* @return int 昨天的帖子数
* @throws SQLException
*/
public abstract int getForumYesdayC(int forumId) throws SQLException;
/** 取得论坛的所有帖子数
* @param forumId 论坛Id
* @return int
* @throws SQLException
*/
public abstract int getForumArtC(int forumId) throws SQLException;
/** 取得论坛6个最新帖子
* @param size 取得帖子总数
* @return list
* @throws SQLException
*/
public abstract List getNewArticle(int size) throws SQLException;
/** 取得论坛6个精华帖子
* @param size 取得帖子总数
* @return list
* @throws SQLException
*/
public abstract List getEliteArticle(int size) throws SQLException;
/** 取得论坛推荐帖子
* @param size 取得帖子总数
* @return list
* @throws SQLException
*/
public abstract List getComArticle(int size) throws SQLException;
/** 增加某帖子的点击数一次
* @param articleId 帖子Id
* @throws SQLException
*/
public abstract void addOneHitTime(int articleId) throws SQLException;
/** 判断某用户是否回复了某帖
* @param isuserrpart :用户ID和帖子ID
* @return boolean 是:true 否:false
* @throws SQLException
*/
public abstract boolean isUserRepArt(HashMap isuserrpart) throws SQLException;
/** 取得用户发表帖子总数
* @param userId 用户Id
* @param i 0:主题贴 1:回复贴
* @return 用户发表帖子总数
* @throws SQLException
*/
public abstract int getUserArtcount(int userId,int i) throws SQLException;
/** 取得用户发表帖子列表
* @param artpage 用户Id
* @param i 0:主题贴 1:回复贴
* @return list 用户发表帖子列表
* @throws SQLException
*/
public abstract List getUserArt(HashMap artpage,int i) throws SQLException;
/** 取得所有帖子建立系统索引
* @return 系统所有帖子
* @throws SQLException
*/
public abstract List getArtForSearchIndex() throws SQLException;
// 后台管理使用
/** 当移动论坛后,属于该论坛的所有帖子都要移动
* @param forumId 论坛Id
* @param classId 目标区论坛Id
* @return true:成功 false:失败
* @throws SQLException
*/
public abstract boolean moveForum(int forumId,int classId) throws SQLException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -