import service from "../../utils/request"

/**
 * 创建mock
 * @returns 
 */
export function createMock(title, path, response) {
    return service.request({
        method: "post",
        url: "admin/mock/create",
        data: {
            path: path,
            title: title,
            response: response
        }
    })
}

/**
 * 获取mockList
 * @returns
 */
export function mockList(page, size, search) {
    return service.request({
        method: "post",
        url: "admin/mock/list",
        data: {
            page: page,
            size: size,
            search: search
        }
    })
}

/**
 * mock详情
 * @returns
 */
export function mockDetails(mockId) {
    return service.request({
        method: "post",
        url: "admin/mock/details",
        data: {
            mockId: mockId
        }
    })
}

/**
 * mock删除
 * @returns
 */
export function mockDelete(mockId) {
    return service.request({
        method: "post",
        url: "admin/mock/delete",
        data: {
            mockId: mockId
        }
    })
}

/**
 * 更新mock
 * @returns
 */
export function mockUpdate(mockId, title, response) {
    return service.request({
        method: "post",
        url: "admin/mock/update",
        data: {
            mockId: mockId,
            response: response,
            title: title
        }
    })
}