index.ts 3.06 KB
import request from '../request'
import { deleteEmptyParam } from '@/utils/tool'

/**
 * @description 活动分类
 * @function eventCategory
 */
export const eventCategory = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/craft/craftList',
    params: deleteEmptyParam(params)
  })
  return res
}

/**
 * @description 活动编辑
 * @function eventCategoryEdit
 */
 export const eventCategoryEdit = async ( data: any ) => {
  let res: any = await request({
    method: 'post',
    url: '/craft/insertOrUpdate',
    data: data
  })
  return res
}

/**
 * @description 活动删除
 * @function eventCategoryOmit
 */
 export const eventCategoryOmit = async ( params: any ) => {
  let res: any = await request({
    method: 'delete',
    url: '/craft/deleteCraftById',
    params: params
  })
  return res
}

/**
 * @description 活动详情
 * @function eventCategoryDetail
 */
 export const eventCategoryDetail = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/craft/getCraftById',
    params: params
  })
  return res
}


/**
 * @description 手工活动列表
 * @function handworkList
 */
 export const handworkList = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/handwork/listHandwork',
    params: deleteEmptyParam(params)
  })
  return res
}

/**
 * @description 手工活动编辑
 * @function handworkEdit
 */
 export const handworkEdit = async ( data: any ) => {
  let res: any = await request({
    method: 'post',
    url: '/handwork/insertOrUpdate',
    data: data
  })
  return res
}

/**
 * @description 活动评价列表
 * @function feedbackList
 */
 export const feedbackList = async ( params: any ) => {
  let res: any = await request({
    method: 'get',
    url: '/feedback/list',
    params: deleteEmptyParam(params)
  })
  return res
}

/**
 * @description 活动评价上下线
 * @function feedbackStatus
 */
 export const feedbackStatus = async ( params: any ) => {
  let res: any = await request({
    method: 'post',
    url: '/feedback/status',
    params: params
  })
  return res
}

/**
 * @description 报名信息
 * @function signupList
 */
export const signupList = async (params: any) => {
  let res: any = await request({
    method: 'get',
    url: '/signup/signupListByHandworkId',
    params: params
  })
  return res
}

/**
 * @description 移除报名信息
 * @function cancelSignup
 */
 export const cancelSignup = async (params: any) => {
  let res: any = await request({
    method: 'post',
    url: '/signup/cancelSignup',
    params: params
  })
  return res
}

/**
 * @description 删除活动
 * @function handworkDelete
 */
 export const handworkDelete = async (params: any) => {
  let res: any = await request({
    method: 'delete',
    url: '/handwork/delete',
    params: params
  })
  return res
}

/**
 * @description 取消发布活动
 * @function handworkCancel
 */
 export const handworkCancel = async (params: any) => {
  let res: any = await request({
    method: 'put',
    url: '/handwork/canelPublish',
    params: params
  })
  return res
}