如何在cmdbuilding2.5中编写过滤器?

时间:2019-05-07 09:37:01

标签: restful-authentication cmdb

http://example.com/cmdbuild/services/rest/v1?_wadl

<resource path="/domains/{domainId}/relations/">
 <param name="domainId" style="template" type="xs:string"/>
 <method name="GET">
  <request>
    <param name="filter" style="query" type="xs:string"/>
    <param name="limit" style="query" type="xs:int"/>
    <param name="start" style="query" type="xs:int"/>
    <param name="detailed" style="query" type="xs:boolean"/>
  </request>
  <response>
   <representation mediaType="application/json"/>
  </response>
 </method>

在正式文档中,过滤器的描述如下:

“Filter” object
  It represents an atomic filter condition to select a card list.
  Activity name Type Mandatory Default Description
  name string Attribute which the filter condition is applied to.
  value string Value for the comparison with the attribute's
  content.
  operator string Comparison operator (values such as
  EQUALS, LIKE are admitted).

我定义一个对象如下:

@Data
@Builder
public class Filter {
    private String name;
    private String value;
    /**
     * 允许使用EQUALES,LIKE等值
     */
    private String operator;
}

然后我做一个测试:

@Test
public void doSearchByFilter(){
    Filter filter = Filter.builder()
            .name("_sourceId")
            .value("1111")
            .operator("EQUALS").build();
    Object object = iCmdbDomainDao.searchByFilter("app_in_appserver",filter);
    log.info("{}",object);
}

但是我得到所有数据,而不是满足过滤条件的数据。 如何在cmdbuilding2.5中编写过滤器?

0 个答案:

没有答案