import request from '@/services/http.request.js'
const env = process.env.NODE_ENV === 'development' ? 'https://core-b.caimei365.com' : 'https://core.caimei365.com'
/* 获取消息列表 */
/**
 * messageType
    commonId
    pageNum
    pageNum
 * @param {Object} params
 */
export function fetchMessageList(params) {
    return request({
        url: env + '/user/login/auth/heheMessageList',
        method: 'GET',
        params
    })
}

/**
 * messageType
 * commonId
 * 获取未读消息
 * @param {Object} params
 */
export function fetchMessageCount(params) {
    return request({
        url: env + '/user/login/auth/heheMessageCount',
        method: 'GET',
        params
    })
}

/**
 * messageType
 * commonId
 * 获取单独一个消息模块的未读消息
 * @param {Object} params
 */
export function fetchOneMessageCount(params) {
    return request({
        url: env + '/user/login/auth/heheOneMessageCount',
        method: 'GET',
        params
    })
}

/**
 *@删除通知消息
 *@param id：消息Id
 */
export function authDeleteMessage(data) {
    return request({
        url: env + '/user/login/auth/deleteMessage',
        method: 'POST',
        data
    })
}

/**
 *@机构标记通知消息已读
 *@param userType: 4
 *@param Id: userId
 */
export function authUpdateMessageAsRead(data) {
    return request({
        url: env + '/user/login/auth/updateRead',
        data,
        method: 'POST'
    })
}
/**
 * @信息标记为已读
 */
export function updateHeheMessageAsRead(data) {
    return request({
        url: env + '/user/login/auth/updateHeheMessageAsRead',
        data,
        method: 'GET'
    })
}