<commit_before>;;**************************************************************************************************
;;* BEGIN Web layer for areal
;;* tag: <ref book web layer areal>
;;*
;;* description: Вебслой для Области, районы...
;;*
;;**************************************************************************************************

(ns r6p3.complex.areal-web
  (:require [clojure.java.io :as io]
            [r6p3.core :as rc]
            [r6p3.transit :as transit]
            [r6p3.core :as c]))


(defn rest-areal-list [{{:keys [page page-size fts-query all]
                         :or {page 1 page-size 10 fts-query ""}} :params}
                       _]
  (-> c/areal-select*

      (as-> query
          (if all
            query
            (rc/com-pred-page* (dec page) page-size)))

      (as-> query
          (let [fts-query (clojure.string/trim fts-query)]
            (if (empty? fts-query)
              query
              (c/areal-pred-search? query fts-query))))

      (korma.core/order :path_keynames)
      rc/com-exec))

(defn rest-areal-find [{{id :id} :params} _]
  (-> (if id<commit_msg>Срочные исправления...<commit_after>;;**************************************************************************************************
;;* BEGIN Web layer for areal
;;* tag: <ref book web layer areal>
;;*
;;* description: Вебслой для Области, районы...
;;*
;;**************************************************************************************************

(ns r6p3.complex.areal-web
  (:require [clojure.java.io :as io]
            [r6p3.core :as rc]
            [r6p3.transit :as transit]
            [r6p3.core :as c]))


(defn rest-areal-list [{{:keys [page page-size fts-query all]
                         :or {page 1 page-size 10 fts-query ""}} :params}
                       _]
  (-> c/areal-select*

      (as-> query
          (if all
            query
            (rc/com-pred-page* query (dec page) page-size)))

      (as-> query
          (let [fts-query (clojure.string/trim fts-query)]
            (if (empty? fts-query)
              query
              (c/areal-pred-search? query fts-query))))

      (korma.core/order :path_keynames)
      rc/com-exec))

(defn rest-areal-find [{{id :id} :params} _]
  (-> (if id
{'fraction_non_alphanumeric': 0.30677290836653387, 'fraction_numerical': 0.009738822487826471, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5098027', 'n_tokens_mistral': 731, 'n_tokens_neox': 704, 'n_words': 159}