wxpay_scf_example_nbpwf1f.json 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {
  2. "configuration":{},
  3. "desc":"",
  4. "id":"data-4ZyCZypKm",
  5. "isNewDataSource":1,
  6. "methods":[
  7. {
  8. "inParams":{
  9. "additionalProperties":true,
  10. "type":"object",
  11. "properties":{},
  12. "required":[]
  13. },
  14. "renderVersion":1,
  15. "name":"method_371ff13766e6c12",
  16. "title":"新方法 1",
  17. "type":"scf",
  18. "outParams":{
  19. "additionalProperties":true,
  20. "type":"object",
  21. "properties":{
  22. "requestID":{
  23. "x-required":false,
  24. "x-keyPath":"",
  25. "x-id":"c285c4b3",
  26. "format":"",
  27. "description":"",
  28. "type":"string",
  29. "x-index":2,
  30. "title":"requestID",
  31. "x-unique":false,
  32. "maxLength":4000
  33. }
  34. },
  35. "required":[]
  36. },
  37. "intent":"create",
  38. "calleeBody":{
  39. "fnName":"wxpayFunctions",
  40. "callee":"/**\n* 使用 npm 包 node-fetch 发送http请求, 详细使用文档可以参考\n* https://github.com/node-fetch/node-fetch\n*/\nconst fetch = require('node-fetch');\n\nmodule.exports = async function (params, context) {\n // 这里是方法入参\n console.log(params);\n\n/**\n * 可以在这里编写业务逻辑,例如:\n * 1. 使用 node-fetch 通过 HTTP 方式请求外部数据,并对获取的数据进行加工;\n * 2. 使用 context.database API 来直接操作云开发云数据库;\n * 3. 使用 context.callModel 来操作其他数据模型数据;\n * 4. 使用 context.callConnector 来使用API;\n * 5. 使用 context.app.callFunction 来调用同环境的云开发云函数;\n */\n const response = await fetch(`https://reqres.in/api/users?page=${params.page}&per_page=${params.per_page}`);\n const result = await response.json();\n\n // 这里返回数据,和出参结构映射\n return result;\n};"
  41. },
  42. "isCollapse":true,
  43. "uuid":"0fee2c94-a5ff-4403-b411-d6c568e99e9e",
  44. "isShow":true
  45. }
  46. ],
  47. "name":"wxpay_scf_example_nbpwf1f",
  48. "pkgId":"honghgaier-5guiffgcf17a2eea",
  49. "templateCode":"empty",
  50. "title":"wxpay-微信支付云模板云函数",
  51. "type":"cloud-integration"
  52. }