数据源:Mongo

  • 打开后台,新增一个接口

image.png

  • 编辑模型

image.png

  • 模型代码:

    1. {
    2. "steps": [
    3. {
    4. "name": "mongoAdd",
    5. "db": "testLowCode",
    6. "input": "people",
    7. "table": "item"
    8. }
    9. ]
    10. }
  • 调试接口

image.png

实战案例

  • 列表展示

WechatIMG124.png

  1. {
  2. "steps" : [
  3. {
  4. "name" : "mongoQuery",
  5. "input" : {
  6. "page" : "page",
  7. "valid" : false,
  8. "limit" : "10"
  9. },
  10. "table" : "room",
  11. "db" : "warehouse",
  12. "output" : {
  13. "picsList" : "strSplit(pics,',')"
  14. }
  15. }
  16. ]
  17. }
  • 列表展示(两表关联查询)

    image.png

    1. {
    2. "steps":[
    3. {
    4. "name":"mongoQuery",
    5. "db":"warehouse",
    6. "join":[
    7. {
    8. "table":"room",
    9. "output":{
    10. "price":"priceRange",
    11. "roomArea":"area",
    12. "roomAddress":"address",
    13. "roomPicsList":"strSplit(pics,'\|')"//转成list
    14. },
    15. "joinKey":"roomId",
    16. "beJoinedKey":"id"
    17. }
    18. ],
    19. "input":{
    20. "page":"page",
    21. "limit":"10",
    22. "userId":"userId"
    23. },
    24. "table":"booking"
    25. }
    26. ]
    27. }
  • 详情展示

WechatIMG125.png

  1. {
  2. "steps" : [
  3. {
  4. "input" : {
  5. "id" : "id"
  6. },
  7. "name" : "mongoQuery",
  8. "table" : "room",
  9. "db" : "warehouse"
  10. },
  11. {
  12. "name" : "authority",
  13. "config" : [
  14. {
  15. "steps" : [
  16. {
  17. "name" : "batchMappingValue",
  18. "outputBatch" : {
  19. "price" : "rentalPrice"
  20. },
  21. "mergeInput" : true
  22. }
  23. ],
  24. "expression" : "roomAgent",
  25. "isElseLogic" : true
  26. },
  27. {
  28. "steps" : [
  29. {
  30. "name" : "batchMappingValue",
  31. "outputBatch" : {
  32. "price" : "priceRange"
  33. },
  34. "mergeInput" : true
  35. }
  36. ],
  37. "expression" : "default"
  38. }
  39. ]
  40. }
  • 表单提交

image.png

  1. {
  2. "steps":[
  3. {
  4. "name":"mongoAdd",
  5. "table":"proxy_rent",
  6. "db":"warehouse",
  7. "input":{
  8. "expectType":"expectType",
  9. "phone":"phone",
  10. "expectDistrict":"expectDistrict",
  11. "name":"name",
  12. "expectArea":"expectArea",
  13. "valid":false
  14. }
  15. }
  16. ]
  17. }
  • 状态更新

image.png

  1. {
  2. "steps":[
  3. {
  4. "name":"mongoUpdate",
  5. "table":"booking",
  6. "db":"warehouse",
  7. "input":{
  8. "id":"id",
  9. "wantRent":"wantRent",
  10. "valid":"valid",
  11. "feedback":"feedback"
  12. }
  13. }
  14. ]
  15. }
  • 文件上传

    1. {
    2. "steps" : [
    3. {
    4. "name" : "fileUpload",
    5. "input" : {
    6. "file" : "file"
    7. }
    8. }
    9. ]
    10. }
  • 短信发送

    1. {
    2. "steps" : [
    3. {
    4. "name" : "aliyunSendSms",
    5. "input" : {
    6. "phoneNumbers" : "phoneNumbers",
    7. "templateCode" : "xxxxxxx"
    8. }
    9. }
    10. ]
    11. }
  • mock数据

    1. {
    2. "steps" : [
    3. {
    4. "name" : "defaultProcess",
    5. "response":{
    6. "name" : "xx",
    7. "age" : "xx",
    8. "school" : "xx",
    9. "major" : "xx"
    10. }
    11. }
    12. ]
    13. }