<commit_before>(ns shl.controllers.game
  (:use [compojure.core])
  (:use [ring.util.response])
  (:require [clojure.string :as str]
            [ring.util.response :as ring]
            [clojure.data.json :as json]
            [clj-time.format :as time]
            [shl.utils.time :as time-utils]
            [shl.dao.game :as dao]))

(defn update [gameid home-goals away-goals overtime shootout playdate]
  (when-not (and (str/blank? gameid)
                 (str/blank? home-goals)
                 (str/blank? away-goals)
                 (str/blank? overtime)
                 (str/blank? shootout)
                 (str/blank? playdate))
    (dao/update-game (Integer/parseInt gameid)
                     (Integer/parseInt home-goals)
                     (Integer/parseInt away-goals)
                     (Boolean/valueOf overtime)
                     (Boolean/valueOf shootout)
                     (time/parse time-utils/formatter playdate)))
  (response (dao/get-game (Integer/parseInt gameid))))

(defn get-conference-games [conferenceid]
  (response (dao/get-conference-games (Integer/parseInt conferenceid))))

(defroutes app-routes
  (context "/games" [] (defroutes game-routes
    (GET ["/conference/:id/" :id #"[0-9]+"] [id] (get-conference-games id))
    (POST "/" [gameid homegoals awaygoals 
              overtime shootout playdate] 
      (update gameid homegoals awaygoals overtime shootout playdate)))))
<commit_msg>game update working<commit_after>(ns shl.controllers.game
  (:use [compojure.core])
  (:use [ring.util.response])
  (:require [clojure.string :as str]
            [ring.util.response :as ring]
            [clojure.data.json :as json]
            [clj-time.format :as time]
            [shl.utils.time :as time-utils]
            [shl.dao.game :as dao]))

(defn update [gameid home-goals away-goals overtime shootout playdate]
  (when-not (nil? playdate)
    (dao/update-game gameid home-goals away-goals overtime shootout
                    (time/parse time-utils/formatter playdate)))
  (response (dao/get-game gameid)))

(defn get-conference-games [conferenceid]
  (response (dao/get-conference-games (Integer/parseInt conferenceid))))

(defroutes app-routes
  (context "/games" [] (defroutes game-routes
    (GET ["/conference/:id/" :id #"[0-9]+"] [id] (get-conference-games id))
    (POST "/" [id homegoals awaygoals 
              overtime shootout playdate] 
      (update id homegoals awaygoals overtime shootout playdate)))))

{'fraction_non_alphanumeric': 0.13357546408393867, 'fraction_numerical': 0.0016142050040355124, 'mean_word_length': 2.4240331491712706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7530590', 'n_tokens_mistral': 810, 'n_tokens_neox': 796, 'n_words': 183}