import request from "../../utils/request.js";
import MethodsENUM from "../../enum/MethodsENUM.js";

const system = {
    getData: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/m1/5995958-5684445-default/getList",
            data: data,
        });
    },
    getBarrageList: async () => {
        return request({
            method: MethodsENUM.POST,
            url: "/index/getBarrageList",
        });
    },
    sendSms: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/login/sendSms",
            data: data,
        });
    },
    register: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/login/register",
            data: data,
        });
    },
    smsLogin: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/login/smsLogin",
            data: data,
        });
    },
    accountLogin: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/login/login",
            data: data,
        });
    },
    editPassword: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/login/editPassword",
            data: data,
        });
    },
    getTaskType: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/task/getTaskType",
            data: data,
        });
    },
    getPlatform: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/task/getPlatform",
            data: data,
        });
    },
    getAccountStatus: async (data) => {
        return Promise.resolve({
            data: [
                {
                    id: 0,
                    name: '审核中',
                    hidden: true,
                },
                {
                    id: 1,
                    name: '正常',
                },
                {
                    id: 2,
                    name: '异常',
                },
                {
                    id: 3,
                    name: '隐藏',
                },
                {
                    id: -1,
                    name: '未通过',
                    hidden: true,
                },
                {
                    id: -2,
                    name: '禁用',
                    hidden: true,
                },
            ]
        });
    },
    getTask: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/task/getTask",
            data: data,
        });
    },
    getTaskinfo: async (id) => {
        return request({
            method: MethodsENUM.POST,
            url: "/task/getTaskinfo",
            data: {id},
        });
    },
    getArticleCategory: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/article/getArticleCategory",
            data: data,
        });
    },
    getArticle: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/article/getArticle",
            data: data,
        });
    },
    getTopArticle: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/article/getTopArticle",
            data: data,
        });
    },
    getSingle: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/article/getSingle",
            data: data,
        });
    },
    getAdvList: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/index/getAdvList",
            data: data,
        });
    },
    getQrcode: async (position) => {
        return request({
            method: MethodsENUM.POST,
            url: "/index/getQrcode",
            data: {position},
        });
    },
    getMessageCenter: async (data) => {
        if (data.type === 1) {
            return request({
                method: MethodsENUM.POST,
                url: "/notice/getNotice",
                data: data,
            });
        } else {
            return request({
                method: MethodsENUM.POST,
                url: "/notice/getNotice",
                data: data,
            });
        }
    },
    getInfo: async () => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/getInfo",
        });
    },
    saveInfo: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/saveInfo",
            data: data,
        });
    },
    saveMobile: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/saveMobile",
            data: data,
        });
    },
    savePassword: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/savePassword",
            data: data,
        });
    },
    myTeamInfo: async () => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/myTeamInfo",
        });
    },
    addAccount: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/addAccount",
            data: data
        });
    },
    myAccount: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/myAccount",
            data: data
        });
    },
    getAccountInfo: async (id) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/getAccountInfo",
            data: {id}
        });
    },
    editAccount: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/editAccount",
            data: data
        });
    },
    delAccount: async (id) => {
        return request({
            method: MethodsENUM.POST,
            url: "/user/delAccount",
            data: {id}
        });
    },
    acceptTask: async (data) => {
        return request({
            method: MethodsENUM.POST,
            url: "/task/acceptTask",
            data: data
        });
    },
}

export default system;
