⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 articledao.java

📁 前台:文章浏览、发表留言、Game、Music 后台:文章相关:发表文章、修改文章、删除文章、批量移动文章 栏目相关:增加栏目、修改栏目、删除栏目、栏目链接、栏目排序系统栏目分为系统内部栏目和外部栏目
💻 JAVA
字号:
package com.yhcms.article.itface;

import java.util.List;

import com.yhcms.article.bean.Article;
import com.yhcms.db.DBConnException;

/**
 * <p>Title:系统文章的相关操作</p>
 * <li>文章与数据库相关的各项操作</li>
 * <b>CopyRight: yyhweb[由由华网]</b>
 * @author stephen
 * @version YH-2.0
 */
public interface ArticleDao {
	
	/** 发表一篇文章
	 * @param article 一篇文章
	 * @return 成功:ture  失败:false
	 * @throws DBConnException
	 */
	public abstract boolean addArticle(Article article) throws DBConnException;
	
	/** 删除一篇文章,同时更新和该文章相关的文章Bid
	 * @param id 文章Id
	 * @return 成功:ture  失败:false
	 * @throws DBConnException
	 */
	public abstract boolean delArticle(int id) throws DBConnException;
	
	/** 修改文章
	 * @param article 修改后的文章
	 * @return 成功:ture  失败:false
	 * @throws DBConnException
	 */
	public abstract boolean updateArticle(Article article) throws DBConnException;
	
	/** 取得系统某栏目某段区间内的所有文章(按照录入的时间反排序)
	 * @param classid 栏目Id
	 * @param begin 开始文章Id
	 * @param size 一次查询的长度
	 * @return 某栏目的所有文章DTO对象
	 * @throws DBConnException
	 */
	public abstract List getArtByClassId(int classid,int begin,int size) throws DBConnException;
	
	/** 取得系统某栏目某段区间内的所有文章(按照录入的时间反排序)
	 * 主要获得首页前两个栏目文章
	 * @param classid 栏目Id
	 * @param begin 开始文章Id
	 * @param size 一次查询的长度
	 * @return 某栏目的所有文章DTO对象
	 * @throws DBConnException
	 */
	public List getIndexArt(int classid,int begin,int size) throws DBConnException;
	
	/** 取得系统某段区间内的所有文章(按照录入的时间反排序)
	 * @param begin 开始文章Id
	 * @param size 一次查询的长度
	 * @return 某栏目的所有文章DTO对象
	 * @throws DBConnException
	 */
	public abstract List getAllArts(int begin,int size) throws DBConnException;
	
	/** 取得某文章的相关文章(前后文章)
	 * @param artid 文章Id
	 * @param bid 前文章Id
	 * @return 相关文章列表
	 * @throws DBConnException
	 */
	public abstract List getPreNextArt(int artid,int bid) throws DBConnException;
	
	/** 由文章Id取得文章对象
	 * @param id 文章Id
	 * @return 文章
	 * @throws DBConnException
	 */
	public abstract Article getArticleById(int id) throws DBConnException;
	
	/** 批量移动文章,用于某栏目删除之前将其下所有文章保留到另外一个栏目中
	 * @param fromId 原栏目Id
	 * @param toId 目标栏目Id
	 * @param toCName 目标栏目名称
	 * @return 成功:ture  失败:false
	 * @throws DBConnException
	 */
	public abstract boolean moveAllArt(int fromId,int toId,String toCName) throws DBConnException;
	
	/** 取得系统文章最大Id
	 * @return 系统文章最大Id
	 * @throws DBConnException
	 */
	public abstract int getArtMaxId() throws DBConnException;
	
	/** 由栏目Id取得该栏目文章最大Id
	  * @param classid 栏目Id
	 * @return 系统文章最大Id
	 * @throws DBConnException
	 */
	public abstract int getArtMaxId(int classid) throws DBConnException;
	
	/** 由栏目Id取得该栏目的所有文章数
	 * @param classid 栏目Id
	 * @return 某栏目的文章总数
	 * @throws DBConnException
	 */
	public abstract int getArtNum(int classid) throws DBConnException;
	
	/** 取得所有文章数
	 * @return 系统文章总数
	 * @throws DBConnException
	 */
	public abstract int getArtNum() throws DBConnException;
	
	/** 取得最新文章列表
	 ** @param length 取得文章数
	 * @return 最新文章列表
	 * @throws DBConnException
	 */
	public abstract List getNewArts(int length) throws DBConnException;
	
	/** 当文章被打开一次,其浏览次数就要加一。
	 * @param id 文章Id
	 * @throws DBConnException
	 */
	public abstract void addOneReadTime(int id) throws DBConnException;
	
	/** 取得搜索的文章数
	 * @param content 查询的内容
	 * @param classid 要搜索的某栏目
	 * @return 搜索的文章数
	 * @throws DBConnException
	 */
	public abstract int searchTitleNum(String content,int classid) throws DBConnException;
	
	/** 取得系统某段区间内的所有文章(按照录入的时间反排序)
	 * @param begin 开始文章Id
	 * @param size 一次查询的长度
	 * @param content 查询的内容
	 * @param classid 要搜索的某栏目
	 * @return 某栏目的所有文章DTO对象
	 * @throws DBConnException
	 */
	public abstract List searchTitle(String content,int classid,int begin,int size) throws DBConnException;
	
}

⌨️ 快捷键说明

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