import request from '/@/utils/request';
import type { AddTicketParams, TicketListParams } from './types';


/**
 * 添加工单
 * @param data 
 * @returns 
 */
export function addTicketApi(data: AddTicketParams) {
    return request({
        url: '/user/ticket/add',
        method: 'post',
        data
    })
}

/**
 * 获取用户工单列表
 * @param params 
 * @returns 
 */
export function ticketListApi(params: TicketListParams) {
    return request({
        url: '/user/ticket/list',
        method: 'post',
        params
    })
}


/**
 * 获取工单详情
 * @param code 
 * @returns 
 */
export function ticketInfoApi(code: string) {
    return request({
        url: '/user/ticket/detail2',
        method: 'post',
        params: { code }
    })
}


/**
 * 更新工单
 * @param data 
 * @returns 
 */
export function updateTicketApi(data: any) {
    return request({
        url: '/user/ticket/update',
        method: 'post',
        data
    })
}