import type {IStockScanSearch} from "@/interface/page/scan/IStockScanSearch.ts";
import axiosInstance from "@/api/axios.ts";
import type {IAppStockScan} from "@/model/table/IAppStockScan.ts";

export default class StockScanApi {

    // 分页查询
    static query(query: IStockScanSearch, pageSize: number, pageIndex: number) {
        return axiosInstance.post('/app/stockScan/queryWithPage', query, {
            params: {
                pageSize: pageSize,
                pageIndex: pageIndex
            }
        })
    };
    // 查询所有
    static queryAll() {
        return axiosInstance.get('/app/stockScan/queryAll')
    };
    // 查询所有扫码方法
    static queryAllScanMethod() {
        return axiosInstance.get('/app/stockScan/queryBaseScanMethod');
    };
    // 插入扫码数据
    static insertStockScan(data: IAppStockScan) {
        return axiosInstance.post('/app/stockScan/addStockScan', data);
    };
    // 更新数据
    static updateStockScan(data: IAppStockScan) {
        return axiosInstance.post('/app/stockScan/updateStockScan', data);
    };
    // 删除数据
    static deleteStockScan(stockScanId: string | undefined) {
        return axiosInstance.delete('/app/stockScan/deleteStockScan', {
            params: {
                stockScanId: stockScanId
            }
        });
    }

}