import request from '@/utils/request'

// 注意 URL 已变为 /inbound/product/...

export function getProductList(params: any) {
    return request({
        url: '/inbound/product/list',
        method: 'get',
        params
    })
}

export function createProductInbound(data: any) {
    return request({
        url: '/inbound/product/submit',
        method: 'post',
        data
    })
}

export function updateProductInbound(id: number, data: any) {
    return request({
        url: `/inbound/product/${id}`,
        method: 'put',
        data
    })
}

export function deleteProductInbound(id: number) {
    return request({
        url: `/inbound/product/${id}`,
        method: 'delete'
    })
}

export function searchMaterialBase(keyword: string) {
    return request({
        url: '/inbound/product/search-base',
        method: 'get',
        params: { keyword }
    })
}