package com.cm.common.article.service.articlecontent;

import com.cm.common.article.pojo.dtos.articlecontent.ArticleContentDTO;
import com.cm.common.article.pojo.vos.articlecontent.ArticleContentVO;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IArticleContentService
 * @Description: 文章内容
 * @Author: WenG
 * @Date: 2020-04-03 15:37
 * @Version: 1.0
 **/
public interface IArticleContentService {

    /**
     * 新增文章内容
     *
     * @param articleContentVO
     * @return
     * @throws Exception
     */
    SuccessResult saveArticleContent(ArticleContentVO articleContentVO) throws Exception;

    /**
     * 新增文章内容(APP)
     *
     * @param token
     * @param articleContentVO
     * @return
     * @throws Exception
     */
    SuccessResult saveArticleContentByToken(String token, ArticleContentVO articleContentVO) throws Exception;

    /**
     * 删除文章内容
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeArticleContent(String ids) throws RemoveException;

    /**
     * 删除文章内容(APP)
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeArticleContentByToken(String token, String ids) throws RemoveException;

    /**
     * 修改文章内容
     *
     * @param articleContentId
     * @param articleContentVO
     * @return
     * @throws Exception
     */
    SuccessResult updateArticleContent(String articleContentId, ArticleContentVO articleContentVO) throws Exception;

    /**
     * 修改文章内容(APP)
     *
     * @param token
     * @param articleContentId
     * @param articleContentVO
     * @return
     * @throws Exception
     */
    SuccessResult updateArticleContentByToken(String token, String articleContentId, ArticleContentVO articleContentVO) throws Exception;

    /**
     * 修改文章发布状态
     *
     * @param articleContentId
     * @param isPublish
     * @return
     * @throws UpdateException
     */
    SuccessResult updateArticleContentPublishStatus(String articleContentId, Integer isPublish) throws UpdateException;

    /**
     * 文章内容详情(通过ID)
     *
     * @param articleContentId
     * @return
     * @throws SearchException
     */
    ArticleContentDTO getArticleContentById(String articleContentId) throws SearchException;

    /**
     * 文章内容列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ArticleContentDTO> listArticleContent(Map<String, Object> params) throws SearchException;

    /**
     * 文章内容分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<ArticleContentDTO>> listPageArticleContent(ListPage page) throws SearchException;

    /**
     * 统计文章数量
     *
     * @param params
     * @return
     * @throws SearchException
     */
    SuccessResultData<Integer> countArticleCount(Map<String, Object> params) throws SearchException;

    /**
     * 文章内容列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ArticleContentDTO> listArticleContentAll(Map<String, Object> params) throws SearchException;

}
