import request from '@/utils/request'

// 查询专业分类列表
export function listMallMajorClass(query) {
  return request({
    url: '/mall/mallMajorClass/list',
    method: 'get',
    params: query
  })
}

// 父级Id查询专业分类列表
export function selectMajorListByPid(pid) {
  return request({
    url: '/mall/mallMajorClass/selectMajorListByPid',
    method: 'get',
    params: {
      pid: pid
    }
  })
}

// 二级专业分类列表
export function selectMajorListByLowLevel() {
  return request({
    url: '/mall/mallMajorClass/selectMajorListByLowLevel',
    method: 'get'
  })
}

// 查询专业分类详细
export function getMallMajorClass(majorId) {
  return request({
    url: '/mall/mallMajorClass/' + majorId,
    method: 'get'
  })
}

// 新增专业分类
export function addMallMajorClass(data) {
  return request({
    url: '/mall/mallMajorClass',
    method: 'post',
    data: data
  })
}

// 修改专业分类
export function updateMallMajorClass(data) {
  return request({
    url: '/mall/mallMajorClass',
    method: 'put',
    data: data
  })
}

// 删除专业分类
export function delMallMajorClass(majorId) {
  return request({
    url: '/mall/mallMajorClass/' + majorId,
    method: 'delete'
  })
}

// 查询专业分类树列表
export function treeListMallMajorClass(query) {
  return request({
    url: '/mall/mallMajorClass/treeList',
    method: 'get',
    params: query
  })
}

// 专业级联列表
export function getMajorList() {
  return request({
    url: '/mall/mallMajorClass/getMajorList',
    method: 'get',
  })
}


