假设一个通用查询,如:
SELECT * FROM items
ORDER BY type ASC, created DESC
Sorter
关于设计查询字符串以构建结果排序类是否有任何约定?在排序键之后附加方向怎么样?
/items/list?sorts=typeASC,createdDESC // ORDER BY type ASC, created DESC
缺失等于ASC
:
/items/list?sorts=type,createdDESC // ORDER BY type ASC, created DESC