57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
// api/ai.js - AI 推荐接口
|
|
|
|
const { get, post, del } = require('../utils/request');
|
|
|
|
/**
|
|
* 获取活动参与者推荐
|
|
* @param {string} activityId - 活动 ID
|
|
* @returns {Promise}
|
|
*/
|
|
const getAIRecommendations = (activityId, options) => {
|
|
return get(`/ai/recommendations/${activityId}`, {}, options);
|
|
};
|
|
|
|
/**
|
|
* 获取智能匹配推荐
|
|
* @param {object} params - 查询参数
|
|
* @returns {Promise}
|
|
*/
|
|
const getSmartRecommendations = (params) => {
|
|
return get('/ai/smart-match', params);
|
|
};
|
|
|
|
/**
|
|
* 分析活动匹配度
|
|
* @param {string} activityId - 活动 ID
|
|
* @returns {Promise}
|
|
*/
|
|
const analyzeActivityMatch = (activityId) => {
|
|
return post(`/ai/analyze/${activityId}`);
|
|
};
|
|
|
|
/**
|
|
* 刷新AI推荐(清除缓存,下次获取时重新生成)
|
|
* @param {string} activityId - 活动 ID
|
|
* @returns {Promise}
|
|
*/
|
|
const refreshAIRecommendations = (activityId) => {
|
|
return del(`/ai/recommendations/${activityId}`);
|
|
};
|
|
|
|
/**
|
|
* 合作可能性分析
|
|
* @param {string} targetUserId - 目标用户 ID
|
|
* @returns {Promise}
|
|
*/
|
|
const getCollaborationAnalysis = (targetUserId) => {
|
|
return post('/ai/collaboration-analysis', { targetUserId }, { timeout: 30000, showLoading: false });
|
|
};
|
|
|
|
module.exports = {
|
|
getAIRecommendations,
|
|
getSmartRecommendations,
|
|
analyzeActivityMatch,
|
|
refreshAIRecommendations,
|
|
getCollaborationAnalysis,
|
|
};
|