index.js 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. const getOpenId = require('./getOpenId/index');
  2. const getMiniProgramCode = require('./getMiniProgramCode/index');
  3. const createCollection = require('./createCollection/index');
  4. const selectRecord = require('./selectRecord/index');
  5. const updateRecord = require('./updateRecord/index');
  6. const sumRecord = require('./sumRecord/index');
  7. const fetchGoodsList = require('./fetchGoodsList/index');
  8. const genMpQrcode = require('./genMpQrcode/index');
  9. // 云函数入口函数
  10. exports.main = async (event, context) => {
  11. switch (event.type) {
  12. case 'getOpenId':
  13. return await getOpenId.main(event, context);
  14. case 'getMiniProgramCode':
  15. return await getMiniProgramCode.main(event, context);
  16. case 'createCollection':
  17. return await createCollection.main(event, context);
  18. case 'selectRecord':
  19. return await selectRecord.main(event, context);
  20. case 'updateRecord':
  21. return await updateRecord.main(event, context);
  22. case 'sumRecord':
  23. return await sumRecord.main(event, context);
  24. case 'fetchGoodsList':
  25. return await fetchGoodsList.main(event, context);
  26. case 'genMpQrcode':
  27. return await genMpQrcode.main(event, context);
  28. }
  29. };