import service from '@/utils/request'

// @Tags Activity
// @Summary 创建活动
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Activity true "创建活动"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /cms/activity/create [post]
export const createActivity = (data) => {
  return service({
    url: '/cms/activity/create',
    method: 'post',
    data
  })
}

// @Tags Activity
// @Summary 删除活动
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Activity true "删除活动"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /cms/activity/delete [delete]
export const deleteActivity = (params) => {
  return service({
    url: '/cms/activity/delete',
    method: 'delete',
    params
  })
}

// @Tags Activity
// @Summary 批量删除活动
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除活动"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /cms/activity/deleteByIds [delete]
export const deleteActivityByIds = (params) => {
  return service({
    url: '/cms/activity/deleteByIds',
    method: 'delete',
    params
  })
}

// @Tags Activity
// @Summary 更新活动
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Activity true "更新活动"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /cms/activity/update [put]
export const updateActivity = (data) => {
  return service({
    url: '/cms/activity/update',
    method: 'put',
    data
  })
}

// @Tags Activity
// @Summary 用id查询活动
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Activity true "用id查询活动"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /cms/activity/find [get]
export const findActivity = (params) => {
  return service({
    url: '/cms/activity/find',
    method: 'get',
    params
  })
}

// @Tags Activity
// @Summary 分页获取活动列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取活动列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /cms/activity/getList [get]
export const getActivityList = (params) => {
  return service({
    url: '/cms/activity/getList',
    method: 'get',
    params
  })
}
