import request from '@/utils/request'

// 查询元器件列表
export function RecommendlistComponent(query) {
  return request({
    url: '/biz/component/recommend/querylist',
    method: 'get',
    params: query
  })
}

// 查询元器件详细
export function getComponent(id) {
  return request({
    url: '/biz/component/' + id,
    method: 'get'
  })
}


//查询元器件的使用场景和使用日期
export function getBycomponentId(componentId) {
  return request({
    url: '/biz/record/componentId/' + componentId,
    method: 'get'
  })
}

//新增一条评分
export function addEvaluation(data) {
  return request({
    url: '/biz/evaluation',
    method: 'post',
    data: data
  })
}

// 新增元器件详情浏览时长记录
export function addTime(data) {
  return request({
    url: '/biz/time',
    method: 'post',
    data: data
  })
}
//得到元器件的评分
export function getscore(componentid) {
  return request({
    url: '/biz/evaluation/componentid/'+componentid,
    method: 'get',

  })
}
