import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { IndustryQuery, IndustryVO, IndustryForm, IndustrySkillVO } from './types';

// 查询行业列表
export const listIndustry = (query?: IndustryQuery): AxiosPromise<IndustryVO[]> => {
  return request({
    url: '/system/industry/list',
    method: 'get',
    params: query
  });
};

// 查询行业详细
export const getIndustry = (industryId: string | number): AxiosPromise<IndustryVO> => {
  return request({
    url: '/system/industry/' + industryId,
    method: 'get'
  });
};

// 新增行业
export const addIndustry = (data: IndustryForm) => {
  return request({
    url: '/system/industry',
    method: 'post',
    data: data
  });
};

// 修改行业
export const updateIndustry = (data: IndustryForm) => {
  return request({
    url: '/system/industry',
    method: 'put',
    data: data
  });
};

// 删除行业
export const delIndustry = (industryId: string | number) => {
  return request({
    url: '/system/industry/' + industryId,
    method: 'delete'
  });
};

// 查询职位列表
export const listIndustrySkill = (query?: any): AxiosPromise<IndustrySkillVO[]> => {
  return request({
    url: '/system/industry/skill/list',
    method: 'get',
    params: query
  });
};

// 查询职位详细
export const getIndustrySkill = (skillId: string | number): AxiosPromise<IndustrySkillVO> => {
  return request({
    url: '/system/industry/skill/' + skillId,
    method: 'get'
  });
};

// 新增职位
export const addIndustrySkill = (data: any) => {
  return request({
    url: '/system/industry/skill',
    method: 'post',
    data: data
  });
};

// 修改职位
export const updateIndustrySkill = (data: any) => {
  return request({
    url: '/system/industry/skill',
    method: 'put',
    data: data
  });
};

// 删除职位
export const delIndustrySkill = (skillId: string | number) => {
  return request({
    url: '/system/industry/skill/' + skillId,
    method: 'delete'
  });
};
