vote.js 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import request from '@/utils/request'
  2. // 查询直播投票列表
  3. export function listVote(query) {
  4. return request({
  5. url: '/live/vote/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询直播投票详细
  11. export function getVote(id) {
  12. return request({
  13. url: '/live/vote/' + id,
  14. method: 'get'
  15. })
  16. }
  17. // 新增直播投票
  18. export function addVote(data) {
  19. return request({
  20. url: '/live/vote',
  21. method: 'post',
  22. data: data
  23. })
  24. }
  25. // 修改直播投票
  26. export function updateVote(data) {
  27. return request({
  28. url: '/live/vote',
  29. method: 'put',
  30. data: data
  31. })
  32. }
  33. // 删除直播投票
  34. export function delVote(ids) {
  35. return request({
  36. url: '/live/vote/' + ids,
  37. method: 'delete'
  38. })
  39. }
  40. // 开始投票
  41. export function startVote(id) {
  42. return request({
  43. url: '/live/vote/start/' + id,
  44. method: 'put'
  45. })
  46. }
  47. // 结束投票
  48. export function endVote(id) {
  49. return request({
  50. url: '/live/vote/end/' + id,
  51. method: 'put'
  52. })
  53. }