import service from '@/utils/request'

// @Tags RedPackage
// @Summary 创建RedPackage
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.RedPackage true "创建RedPackage"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /redPackage/createRedPackage [post]
export const createRedPackage = (data) => {
  return service({
    url: '/redPackage/createRedPackage',
    method: 'post',
    data
  })
}

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

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

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

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

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

// @Tags RedPackage
// @Summary 获取RedPackage白名单列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取RedPackage列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /redPackage/getRedPackageWhiteList [get]
export const getRedPackageWhiteList = (params) => {
  return service({
    url: '/redPackage/getWhiteList',
    method: 'get',
    params
  })
}

export const queryBalance = (params) => {
  return service({
    url: '/redPackage/queryBalance',
    method: 'get',
    params
  })
}
