package com.mortals.xhx.module.news.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.news.model.NewsEntity;
import com.mortals.xhx.module.news.dao.NewsDao;
/**
* NewsService
*
* 新闻 service接口
*
* @author zxfei
* @date 2023-09-18
*/
public interface NewsService extends ICRUDService<NewsEntity,Long>{

    NewsDao getDao();

    /**
     * 点赞
     * @param id
     * @param context
     * @param increment 点赞次数增减值
     * @return
     */
    NewsEntity upNews(Long id, Context context, int increment) throws AppException;

    /**
     * 浏览新闻
     * @param id
     * @param context
     * @return
     * @throws AppException
     */
    NewsEntity viewNews(Long id, Context context) throws AppException;

    /**
     * 分享新闻
     * @param id
     * @param context
     * @return
     * @throws AppException
     */
    NewsEntity shareNews(Long id, Context context) throws AppException;
}