import Request from '@/utils/request/request-util';

/**
 * 门户后台管理 - 新闻api
 *
 */
export class NewApi {
    /**
     * 获取新闻列表（带分页）
     * @param {*} params
     */
    static findPage(params) {
        return Request.get('/portalNews/page', params);
    }

    /**
     * 添加
     * @param {*} params
     */
    static add(params) {
        return Request.post('/portalNews/add', params);
    }
    /**
     * 编辑
     * @param {*} params
     */
    static edit(params) {
        return Request.post('/portalNews/edit', params);
    }
    /**
     * 删除单个
     * @param {*} params
     */
    static delete(params) {
        return Request.post('/portalNews/delete', params);
    }
    /**
     * 删除多个
     * @param {*} params
     */
    static batchDelete(params) {
        return Request.post('/portalNews/batchDelete', params);
    }
    /**
     * 详情
     * @param {*} params
     */
    static detail(params) {
        return Request.getAndLoadData('/portalNews/detail', params);
    }
    /**
     * 列表
     * @param {*} params
     */
    static getSelect(params) {
        return Request.getAndLoadData('/portalNews/getSelect', params);
    }
    /**
     * 获取门户首页下的所有新闻分类
     * @param {*} params
     */
    static summary(params) {
        return Request.post('/component/news/summary', params);
    }
    /**
     * 获取门户下的所有新闻分类
     * @param {*} params
     */
    static getCategoryList(params) {
        return Request.get('/component/news/getCategoryList', params);
    }
    /**
     * 首页渲染-新闻分页列表
     * @param {*} params
     */
    static pageList(params) {
        return Request.get('/component/news/pageList', params);
    }
    /**
     * 首页渲染-获取文章详情
     * @param {*} params
     */
    static newsDetail(params) {
        return Request.get('/component/news/detail', params);
    }
}