live.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. var common_request = require("../common/request.js");
  3. let request = new common_request.Request().http;
  4. const api = {
  5. liveDataLike: (liveId) => `/app/live/liveData/like/${liveId}`,
  6. collectStore: "/app/live/liveData/collectStore",
  7. follow: (liveId) => `/app/live/liveData/follow/${liveId}`,
  8. getRecentLiveViewers: (liveId) => `/app/live/liveData/getRecentLiveViewers/${liveId}`,
  9. getLiveInfo: (liveId) => `/app/live/${liveId}`,
  10. getLiveViewData: (liveId) => `/app/live/liveData/getLiveViewData/${liveId}`,
  11. liveStore: (liveId) => `/app/live/liveGoods/liveStore/${liveId}`,
  12. liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`,
  13. liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`
  14. };
  15. function liveDataLike(liveId, data = {}) {
  16. return request(api.liveDataLike(liveId), data, "GET", "application/json;charset=UTF-8");
  17. }
  18. function collectStore(data) {
  19. return request(api.collectStore, data, "GET", "application/json;charset=UTF-8");
  20. }
  21. function follow(liveId, data = {}) {
  22. return request(api.follow(liveId), data, "GET", "application/json;charset=UTF-8");
  23. }
  24. function getRecentLiveViewers(liveId, data = {}) {
  25. return request(api.getRecentLiveViewers(liveId), data, "GET", "application/json;charset=UTF-8");
  26. }
  27. function liveStore(liveId, data) {
  28. return request(api.liveStore(liveId), data, "GET", "application/json;charset=UTF-8");
  29. }
  30. function liveGoodsDetail(productId, data) {
  31. return request(api.liveGoodsDetail(productId), data, "GET", "application/json;charset=UTF-8");
  32. }
  33. function liveOrderUser(liveId, data = {}) {
  34. return request(api.liveOrderUser(liveId), data, "GET", "application/json;charset=UTF-8");
  35. }
  36. function getLiveInfo(liveId, data = {}) {
  37. return request(api.getLiveInfo(liveId), data, "GET", "application/json;charset=UTF-8");
  38. }
  39. function getLiveViewData(liveId, data = {}) {
  40. return request(api.getLiveViewData(liveId), data, "GET", "application/json;charset=UTF-8");
  41. }
  42. exports.collectStore = collectStore;
  43. exports.follow = follow;
  44. exports.getLiveInfo = getLiveInfo;
  45. exports.getLiveViewData = getLiveViewData;
  46. exports.getRecentLiveViewers = getRecentLiveViewers;
  47. exports.liveDataLike = liveDataLike;
  48. exports.liveGoodsDetail = liveGoodsDetail;
  49. exports.liveOrderUser = liveOrderUser;
  50. exports.liveStore = liveStore;