LjApiHelper.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var request = require('request');
  2. var cryptoJS = require("crypto-js");
  3. /**
  4. * The helper of api
  5. */
  6. class LjApiHelper
  7. {
  8. /**
  9. * Gets the API for query course
  10. * @param lessonId the lesson id
  11. * @param courseId the course id
  12. * @param eid the eid
  13. * @returns {string} the API url
  14. */
  15. static getApiForQueryCourse(lessonId, courseId, eid)
  16. {
  17. var http = "http://tt-web.api.ai160.com/lesson/" + lessonId;
  18. http += "?courseId=" + courseId
  19. http += "&eid=" + eid
  20. http += "&cache=true";
  21. return http;
  22. }
  23. /**
  24. * Gets the API for add download
  25. * @param lessonId the lesson id
  26. * @param data the data
  27. * @returns {string}
  28. */
  29. static getApiForAddDownload(lessonId,courseId,data)
  30. {
  31. return "http://tt-web.api.ai160.com/callback/download/add?lessonId=" + lessonId+"&courseId="+courseId+"&data="+data;
  32. }
  33. /**
  34. * Gets the API for delete download
  35. * @param lessonId the lesson id
  36. * @param data the data
  37. * @returns {string}
  38. */
  39. static getApiForDelDownload(lessonId,data)
  40. {
  41. return "http://tt-web.api.ai160.com/callback/download/delete?lessonId=" + lessonId+"&data="+data;
  42. }
  43. }
  44. module.exports = LjApiHelper;