
import request from "../utils/request";
import { baseURL } from "../utils/request";


/**
 * 登录
 * @param {*} person 
 * @returns 
 */
export function login(openid) {
  const url = `${baseURL}/login`
  return request(url, { method: 'POST', body: JSON.stringify({ openid }) })
}

/**
 * 更新人员信息
 * @param {*} person 
 * @returns 
 */
export function updatePerson(person) {
  const url = `${baseURL}/taPerson/${person.personId}`
  return request(url, { body: JSON.stringify(person) })
}

/**
 * 抽奖
 * @param {*} person 
 * @returns 
 */
export function drawLottery(person) {
  const url = `${baseURL}/taPerson/${person.personId}/prize`
  return request(url)
}


/**
 * 获取奖品列表
 * @param {*} person 
 * @returns 
 */
export function getPrizeList() {
  const url = `${baseURL}/taPrize`
  return request(url)
}