
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/dad700ebe71beb397c82a4ca4671876.png#pic_centerOData 协议OData一个开放的协议以一种简单规范的方式来创建和消费可查询和可协作的RESTful APIS。查询分页排序在GET的Request请求中以键值对的方式传递。1、offset,$limit 完成分页查询 example.com?$offset0 偏移量为0。 example.com?$limit15 每页个数为15。 example.com?$offset0$limit15 偏移量为0每页个数为15。1操作符 2、$filter 完成条件查询 eq 表示『相等』 example.com?$filterage eq 10 查询age等于10的记录 like 表示『模糊查询』 example.com?$filtername like xxx 查询对name进行模糊匹配的记录 gt 表示『大于』 example.com?$filterage gt 10 查询age大于10的记录 lt 表示『小于』example.com?$filterage lt 10 查询age小雨10的记录 2逻辑组合 and 表示『且』example.com?$filtername like xxx and age eq 10 查询age等于10且对name进行模糊匹配的记录 or 表示『或』example.com?$filtername like xxx or age eq 10 查询age等于10或对name进行模糊匹配的记录 总结格式是 单个条件属性名 操作符 值 $fitler 单个条件 [逻辑 单个条件...]3、$orderby 完成排序查询 desc 降序example.com?$orderbycreatedAt desc createdAt 字段倒序 asc 升序example.com?$orderbyupdatedAt asc updatedAt 字段增序 总结格式是$orderby属性名 asc|desc4、返回结构返回JSON对象结构体如下默认情况无count总数{ items:[ ...... ] }需要count则代码查询条件$counttrueexample.com?$counttrue { items:[ ...... ], count:10 }![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/292244a3dbe5e1eb1273c67694296782.png#pic_center