本地调用spring中类和方法

参数为简单案例

  1. {
  2. "name" : "runMethodProcess",
  3. "service" : "processDataSource",
  4. "method" : "getDataSource",
  5. "input" : {
  6. "projectId" : 3,
  7. "code" : "testLoop2"
  8. },
  9. "inputType" : {
  10. "projectId" : "Long"
  11. }
  12. }

对应类和方法public List getData(String code,Long projectId)//参数为对象案例

  1. {
  2. "name" : "runMethodProcess",
  3. "service" : "redisDtSource",
  4. "method" : "query",
  5. "input" : {
  6. "dtQuery" : {
  7. "dbIndex" : 6,
  8. "key" : "data:seo:ip:valid:bak1",
  9. "hashKeys" : [
  10. "218.2.226.42",
  11. "27.191.234.69",
  12. "222.223.182.66"
  13. ]
  14. }
  15. },
  16. "inputType" : {
  17. "dtQuery" : "com.manatee.lowcode.domain.DtQuery"
  18. }
  19. }

对应类和方法public Map query(DtQuery dtQuery)
返回结果

  1. {
  2. "data" : {
  3. "list_data" : {
  4. "218.2.226.42" : "80",
  5. "222.223.182.66" : "8000",
  6. "27.191.234.69" : "9999"
  7. }
  8. },
  9. "errorCode" : 0
  10. }

说明:
1)inputType不指定时,以json格式,如字符串格式,Integer格式等
2)在参数为对方案例中需要指定inputType为完整的类名