import service from '@/utils/service'

const baseUrl = process.env.VUE_APP_HOST + '/manager/api';

const messageList = {};

messageList.baseUrl = baseUrl;



messageList.getMessageList = () => {
    return service({
        url: `${baseUrl}/message/v1/list`,
        method: 'get',
    })
};
messageList.getMessageById = id => {
    return service({
        url: `${baseUrl}/message/v1/${id}`,
        method: 'get',
    })
};
messageList.updateMessage = date => {
    return service({
        url: `${baseUrl}/message/v1/`,
        method: 'put',
        data:date
    })
};
messageList.addMessage = date => {
    return service({
        url: `${baseUrl}/message/v1/`,
        method: 'post',
        data:date
    })
};

messageList.deleteMessage = id => {
    return service({
        url: `${baseUrl}/message/v1/${id}`,
        method: 'delete',
    })
};

messageList.refreshMessage = () => {
    return service({
        url: `${baseUrl}/message/refreshMessage`,
        method: 'post',
    })
};


export default messageList
