Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 1.28 KB

File metadata and controls

52 lines (43 loc) · 1.28 KB

Sreaching on database with Specification

This project contains:

How to use

  • you create your restController and extends SearchController
  • you create your repository and extends SearchRepository
  • you create your service and extends SearchService
  • you create your mapper and extends CommonMapper

Json input structure

{
  "condition": "AND",
  "rules": [
    {
      "value": "اکبری",
      "field": "lastName",
      "operator": "LIKE"
    },
    {
      "condition": "AND",
      "rules": [
        {
          "value": "رضا",
          "field": "firstName",
          "operator": "LIKE"
        },
        {
          "value": "مدی",
          "field": "job.name",
          "operator": "LIKE"
        }
      ]
    }
  ]
}

your resultData is like your DTO

You can use Angular Query-builder
Demo