import http from '@/utils/request'

/**
 * 查询推荐问题列表
 * @params
 */
export function fetchQuestionList(data: any) {
  return http.post('/config-center/api/commonconfig/mobile/v1/query_config_list', data)
}

/**
 * 查询工具列表
 * @params params.userRoles: 角色数组，用于按角色返回工具
 */
export function fetchToolList(params?: { userRoles?: string[] }) {
  const requestBody: Record<string, string | string[]> = {
    toolType: '03',
    userRoles: [],
  }
  if (params?.userRoles)
    requestBody.userRoles = params.userRoles
  return http.post('/config-center/api/tool/mobile/v1/get_tool_list', requestBody)
}

/**
 * 查询 提质增效 推荐问题列表
 * @params
 * toolId: 工具id
 */
export function fetchEfficiencyQuestionList(data: any) {
  return http.post('/conversation/api/conversation/mobile/v1/generate_question', data)
}

/**
 * 清空记录 接口
 * @params
 * conversationIdList: 会话id (只传一个)
 */
export function deleteUserConversation(data: any) {
  return http.post('/api/conversation/mobile/v1/delete_user_conversation', data)
}
