import { activityList, addActivity, updateActivity, activityById, invalidActivity, getSignUp, deleteSignUp, getActivitySignIn } from '@/api/activity'

const activityInfo = {
  state: {
  },
  mutations: {
  },
  actions: {
    ActivityList({ commit, state }, data) { // 查询数据列表
      return new Promise((resolve, reject) => {
        activityList(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    AddActivity({ commit, state }, data) { // 添加活动
      return new Promise((resolve, reject) => {
        addActivity(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    UpdateActivity({ commit, state }, data) { // 修改活动
      return new Promise((resolve, reject) => {
        updateActivity(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ActivityById({ commit, state }, data) { // 查询活动详情
      return new Promise((resolve, reject) => {
        activityById(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    InvalidActivity({ commit, state }, data) { // 批量活动作废
      return new Promise((resolve, reject) => {
        invalidActivity(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    GetSignUp({ commit, state }, data) { // 查询 活动报名人员
      return new Promise((resolve, reject) => {
        getSignUp(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    DeleteSignUp({ commit, state }, data) { // 删除 活动报名人员
      return new Promise((resolve, reject) => {
        deleteSignUp(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    GetActivitySignIn({ commit }, data) { // 获取签到列表
      return new Promise((resolve, reject) => {
        getActivitySignIn(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default activityInfo
