import { get, post } from "@/utils/request";

// 获取列表
export function getFieldList({ modularId, fieldName, page, perPage }) {
  return get({
    url: "/api/v1/field/list",
    params: {
      modularId,
      fieldName,
      page,
      perPage,
    },
  });
}

// 获取详情
export function getFieldDetail({ fieldId }) {
  return get({
    url: "/api/v1/field/info",
    params: {
      fieldId,
    },
  });
}

// 保存字段
export function saveField(data) {
  return post({
    url: "/api/v1/field/save",
    data,
  });
}

// 删除字段
export function deleteField(data) {
  return post({
    url: "/api/v1/field/del",
    data,
  });
}
