import request from '@/utils/request'

// 用户信息
export function getMember(id){
  return request({
    url: '/transaction/member/userId/'+id,
    method: 'get',
  })
}

// 展示图片
export function showUserImg(id){
  return request({
    url: 'transaction/member/showImg/memberId/'+id,
    method: 'get',
  })
}

//更新用户资料
export function userUpdate(query){
  return request({
    url: '/transaction/member/edit',
    method: 'post',
    data: query
  })
}

//更新密码
export function passWordUpdate(query){
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'post',
    data: query
  })
}

//上传用户图片
export function base64Attach(query){
  return request({
    url: '/common/base64Attach',
    method: 'post',
    data: query
  })
}

//删除用户图片
export function deleteUserImg(id){
  return request({
    url: '/transaction/member/deleteImg/attachId/'+id,
    method: 'delete',
  })
}

//发布咨询
export function userCommunicate(query){
  return request({
    url: '/transaction/communicate/add',
    method: 'post',
    data: query
  })
}

//查询咨询
export function userConsulting(query){
  return request({
    url: '/transaction/communicate/communicateList/member',
    method: 'get',
    params: query
  })
}

//修改咨询
export function updateCommunicate(query){
  return request({
    url: '/transaction/communicate/edit',
    method: 'post',
    data: query
  })
}

//咨询详情
export function selectCommunicate(id){
  return request({
    url: '/transaction/communicate/'+id,
    method: 'get'
  })
}

//删除咨询
export function deleteInteraction(id){
  return request({
    url: '/transaction/communicate/remove/'+id,
    method: 'get'
  })
}

//查询供求
export function supplyList(query){
  return request({
    url: '/transaction/demand/supplyDemandList/member',
    method: 'get',
    params: query
  })
}

//发布供求
export function userDemand(query){
  return request({
    url: '/transaction/demand/add',
    method: 'post',
    data: query
  })
}

//修改供求
export function updateDemand(query){
  return request({
    url: '/transaction/demand/edit',
    method: 'post',
    data: query
  })
}

//供求查询
export function selectDemand(id){
  return request({
    url: '/transaction/demand/'+id,
    method: 'get',
  })
}

//删除供求
export function deleteSupply(id){
  return request({
    url: '/transaction/demand/remove/'+id,
    method: 'get'
  })
}

// 展示图片
export function showImg(id){
  return request({
    url: '/transaction/website/supplyDemand/showImg/id/'+id,
    method: 'get',
  })
}

//我的竞价
export function biddinglist(query){
  return request({
    url: '/transaction/outproject/biddinglist/member',
    method: 'get',
    params: query
  })
}
