// 上传请求
import { otherHttp } from '/@/utils/http/axios'

enum Api {
    list = '/news/list',
    detail = '/news/detail',
    viewCount = '/news/viewCount',
}

/**
 * @description: 获取列表
 */
export function getList(params) {
    return otherHttp.get({ url: Api.list, params })
}

/**
 * @description: 获取详情
 */
export function getDetail(params) {
    return otherHttp.get({ url: Api.detail, params })
}

/**
 * @description: 记录浏览次数
 */
export function addViewCount(params) {
    return otherHttp.post({
        url: Api.viewCount,
        params,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}
