import request from '@/config/axios'

export const talentLabelingApi = {
	// 获取所有名片列表
	getCardList: async () => {
		return await request.get({ 
			url: `/api/parse/get-business-cards`, 
			baseURL: import.meta.env.VITE_BASE_URL 
		})
	},

	// 根据人才id获取关联的标签列表
	getTalentTagById: async (talent_id: number) => {
		return await request.get({ 
			url: `/api/parse/talent-get-tags/${talent_id}`, 
			baseURL: import.meta.env.VITE_BASE_URL
		})
	},

	// 更新人才关联标签
	updateTalentTags: async (data: any) => {
		return await request.post({ 
			url: `/api/parse/talent-update-tags`, 
			data, 
			baseURL: import.meta.env.VITE_BASE_URL 
		})
	},

	// 人才启用/禁用
	updateTalentStatus: async (talent_id: number, data: any) => {
		return await request.put({ 
			url: `/api/parse/update-business-cards/${talent_id}/status`,
			data,
			baseURL: import.meta.env.VITE_BASE_URL 
		})
	},

	// 获取人才名片
	getTalentCardByImagePath: async (image_path: string) => {
		return await request.download({ 
			url: `/api/parse/business-cards/image/${image_path}`,
			baseURL: import.meta.env.VITE_BASE_URL 
		})
	},

  // 非结构化数据源 名片解析
	businessCardParse: async (data: any) => {
		return await request.upload({ 
			url: `/api/parse/business-card-parse`,
			baseURL: import.meta.env.VITE_BASE_URL,
			data 
		})
	},
}