import request from '@/utils/request'

export function GetMembers(params) {
  return request({
    url: '/api/members',
    method: 'get',
    params: params
  })
}

export function CreateMember(data) {
  console.log("data是神",data)
  return request({
    url: '/api/member/create',
    method: 'post',
    data: data
  })
}

export function EditMember(id, data) {
  return request({
    url: '/api/member/edit?id=' + id,
    method: 'put',
    data: data
  })
}

export function EditMemberTags(id, data) {
  return request({
    url: '/api/member/tag/edit?id=' + id,
    method: 'post',
    data: data
  })
}

export function AddMembersTags(data) {
  return request({
    url: '/api/members/tags/add',
    method: 'post',
    data: data
  })
}

export function DeleteMembers(data) {
  return request({
    url: '/api/members/delete',
    method: 'delete',
    data: data
  })
}

export function EditMemberCard(params) {
  return request({
    url: '/api/member/card/edit',
    method: 'put',
    params: params
  })
}

export function GetTags(params) {
  return request({
    url: '/api/members/tags',
    method: 'get',
    params: params
  })
}

export function CreateTag(data) {
  return request({
    url: '/api/members/tag/create',
    method: 'post',
    data: data
  })
}

export function EditTag(id,data) {
  return request({
    url: '/api/members/tag/edit?id='+id,
    method: 'put',
    data: data
  })
}
export function DeleteTags(data) {
  return request({
    url: '/api/members/tags/delete',
    method: 'delete',
    data: data
  })
}

export function GetCards() {
  return request({
    url: '/api/membercards',
    method: 'get',
  })
}

export function CreateMemberShipCard(data) {
  return request({
    url: '/api/membercard/create',
    method: 'post',
    data: data
  })
}

export function EditMemberShipCard(id,data) {
  return request({
    url: '/api/membercard/edit?id='+id,
    method: 'put',
    data: data
  })
}

export function DeleteMemberShipCard(data) {
  return request({
    url: '/api/membercards/delete',
    method: 'delete',
    data: data
  })
}


export function EditRight(data) {
  return request({
    url: '/api/membercard/right/edit',
    method: 'put',
    data: data
  })
}