2016-04-22 34 views
2

我已經使用Moqui框架實現了一個應用程序。 我有10個參數的實體。 通過RestService,使用實體的短別名,我可以在JSON格式上獲得其10個參數。 但是我只需要顯示4個參數。 這是我的實際結果是:僅從MOQUI FrameWork中的restServices返回實體的一些字段?

"exampleId": "100000", 
    "exampleTypeEnumId": "EXT_MADE_UP", 
    "description": "Yet another test description", 
    "exampleEmail": "[email protected]", 
    "statusId": "EXST_IN_DESIGN", 
    "exampleName": "Test Example from JSON File", 
    "exampleSize": 123, 
    "testTime": "1970-01-01T06:30:00+0000", 
    "amount": 200.0, 
    "exampleItemSeqId": "02", 

,這是我想要的結果:

"description": "Yet another test description", 
    "exampleName": "Test Example from JSON File", 
    "amount": 200.0, 
    "exampleItemSeqId": "02", 

回答

0

有三種方法通過Moqui REST API的功能越來越有限的實體領域:

  1. 使用具有視圖實體的自動實體REST API(/ rest/e1),該視圖實體僅將您想要的字段進行別名
  2. 使用視圖 - 在服務REST API XML文件(通過/ rest/s1訪問)中的method.entity元素中,使用有限字段的實體別名
  3. 定義一個只包含所需字段的服務,並將其用於Service中的method.service元素REST API XML文件(通過/ rest/s1訪問)
+0

謝謝寶貴的建議。我實現了第二個選項,它工作正常。 – Rolla

相關問題