public function __construct($app)
 {
     $this->app = $app;
     $app->group('/fitting-rule', function () use($app) {
         $restService = new \Core\Service\RestService($app);
         $fittingRuleService = new \Core\Service\FittingRuleService();
         $restService->get('/calculate', function () use($fittingRuleService) {
             return $fittingRuleService->calculateNewItemFilterTypes();
         });
         $restService->get('/check', function () use($fittingRuleService) {
             return $fittingRuleService->check($_GET['name'], isset($_GET['cid']) ? intval($_GET['cid']) : null);
         });
         $restService->get('/autocomplete', function () use($fittingRuleService) {
             return $fittingRuleService->getAutocomplete($_GET['s']);
         });
         $restService->get('/list', function () use($fittingRuleService) {
             return $fittingRuleService->getList($_GET['type'], intval($_GET['page']));
         });
         $restService->get('/:id', function ($id) use($fittingRuleService) {
             return $fittingRuleService->get($id);
         });
         $restService->post('/', function () use($fittingRuleService) {
             $data = getPost();
             return $fittingRuleService->save($data);
         });
         $restService->delete('/:id', function ($id) use($fittingRuleService) {
             return $fittingRuleService->delete($id);
         });
         $restService->post('/fork', function () use($fittingRuleService) {
             $data = getPost();
             return $fittingRuleService->fork($data);
         });
     });
 }