public function __construct($app)
 {
     $this->app = $app;
     $app->group('/rule-def', function () use($app) {
         $app->get('/comparison', function () {
             $cacheService = new \Core\Service\CacheService();
             if ($cacheService->has('rule-def-comparsion')) {
                 echo $cacheService->get('rule-def-comparsion');
                 return;
             }
             $typeService = new \Core\Service\TypeService();
             $content = json_encode($typeService->getTypeComparisons());
             $cacheService->set('rule-def-comparsion', $content);
             echo $content;
         });
         $app->get('/item-filter', function () {
             $cacheService = new \Core\Service\CacheService();
             if ($cacheService->has('rule-item-filter')) {
                 echo $cacheService->get('rule-item-filter');
                 return;
             }
             $itemFilterDefService = new \Core\Service\ItemFilterDefService();
             $content = json_encode($itemFilterDefService->getItemFilterDefs());
             $cacheService->set('rule-item-filter', $content);
             echo $content;
         });
     });
 }
 public function __construct($app)
 {
     $this->app = $app;
     $app->get('/item', function () {
         $cacheService = new \Core\Service\CacheService();
         if ($cacheService->has('item')) {
             echo $cacheService->get('item');
             return;
         }
         $invTypeService = new \Core\Service\InvTypeService();
         $content = json_encode($invTypeService->getItems());
         $cacheService->set('item', $content);
         echo $content;
     });
 }
예제 #3
0
 public function __construct($app)
 {
     $this->app = $app;
     $app->group('/def', function () use($app) {
         $app->get('/group-person-type', function () {
             $cacheService = new \Core\Service\CacheService();
             if ($cacheService->has('group-person-type')) {
                 echo $cacheService->get('group-person-type');
                 return;
             }
             $groupPersonTypeService = new \Core\Service\GroupPersonTypeService();
             $content = json_encode($groupPersonTypeService->get());
             $cacheService->set('group-person-type', $content);
             echo $content;
         });
     });
 }