import { del, get, post, put, download } from '../http'

const group = {
  getGroupPages(data) {
    return post('group/getGroupPages', data)
  },
  addUserGroup(data) {
    return post('group/addUserGroup', data)
  },
  updateUserGroup(data) {
    return post('group/updateUserGroup', data)
  },
  getUserGroupInfo(params) {
    return get('group/getUserGroup', params)
  },
  deleteUserGroup(params) {
    return get('group/delUserGroup', params)
  },
  getUserGroupType() {
    return get('group/getUserGroupType')
  },
  getAllUserGroups() {
    return get('group/getUserGroups')
  },
  getGroupUserPages(data) {
    return post('groups/user-page', data)
  },
  getGroupUserInfo(params) {
    return get('groups/users', params)
  },
  addGroupUser(data) {
    return post('groups/users', data)
  },
  updateGroupUser(data) {
    return put('groups/users', data)
  },
  deleteGroupUser(data) {
    return del('groups/users/' + data)
  },
  approveGroupUser(data) {
    return get('groups/user-pass', data)
  },
  rejectGroupUser(data) {
    return get('groups/user-reject', data)
  },
  downloadTemplate() {
    return download('groups/user-template')
  },
  getAssignSitesPages(data) {
    return post('group/getGroupAssignSitePages', data)
  },
  getAssignStatusOptions() {
    return get('group/getAssignmentStatus')
  },
  assignSite2Group(data) {
    return post('group/assignGroupSites', data)
  },
  unassignSite2Group(data) {
    return post('group/unAssignGroupSites', data)
  }
}

export default group;