import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { FactoryInfoVO, FactoryInfoForm, FactoryInfoQuery } from './model';

/**
 * 查询生产厂家基础信息;列表
 * @param params
 * @returns
 */
export function factoryInfoList(params?: FactoryInfoQuery) {
  return defHttp.get<FactoryInfoVO[]>({ url: '/factory/factoryInfo/list', params });
}

/**
 * 导出生产厂家基础信息;列表
 * @param params
 * @returns
 */
export function factoryInfoExport(params?: FactoryInfoQuery) {
  return commonExport('/factory/factoryInfo/export', params ?? {});
}

/**
 * 查询生产厂家基础信息;详细
 * @param id id
 * @returns
 */
export function factoryInfoInfo(id: ID) {
  return defHttp.get<FactoryInfoVO>({ url: '/factory/factoryInfo/' + id });
}

/**
 * 新增生产厂家基础信息;
 * @param data
 * @returns
 */
export function factoryInfoAdd(data: FactoryInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/factory/factoryInfo', data });
}

/**
 * 更新生产厂家基础信息;
 * @param data
 * @returns
 */
export function factoryInfoUpdate(data: FactoryInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/factory/factoryInfo', data });
}

/**
 * 删除生产厂家基础信息;
 * @param id id
 * @returns
 */
export function factoryInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/factory/factoryInfo/' + id });
}
