|
@@ -77,12 +77,13 @@
|
|
|
`(200 (:content-type "application/json") ,(dumps data)))
|
|
`(200 (:content-type "application/json") ,(dumps data)))
|
|
|
|
|
|
|
|
(defun get-entity (params)
|
|
(defun get-entity (params)
|
|
|
|
|
+ (declare (optimize (speed 3) (safety 0)))
|
|
|
(let ((id (parse-integer (getf params :id) :junk-allowed t))
|
|
(let ((id (parse-integer (getf params :id) :junk-allowed t))
|
|
|
- (entity (getkey params :entity)))
|
|
|
|
|
|
|
+ (entity (the symbol (getkey params :entity))))
|
|
|
(if id
|
|
(if id
|
|
|
(case entity
|
|
(case entity
|
|
|
((:|users| :|visits| :|locations|)
|
|
((:|users| :|visits| :|locations|)
|
|
|
- (let ((entity (gethash id (gethash entity *storage*))))
|
|
|
|
|
|
|
+ (let ((entity (gethash (the fixnum id) (gethash (the symbol entity) *storage*))))
|
|
|
(if entity
|
|
(if entity
|
|
|
`(200 (:content-type "application/json") ,entity)
|
|
`(200 (:content-type "application/json") ,entity)
|
|
|
+404+)))
|
|
+404+)))
|
|
@@ -283,7 +284,7 @@
|
|
|
(setf *storage-users* (gethash :|users| *storage*)
|
|
(setf *storage-users* (gethash :|users| *storage*)
|
|
|
*storage-locations* (gethash :|locations| *storage*)
|
|
*storage-locations* (gethash :|locations| *storage*)
|
|
|
*storage-visits* (gethash :|visits| *storage*))
|
|
*storage-visits* (gethash :|visits| *storage*))
|
|
|
- #+sbcl (sb-ext:gc)
|
|
|
|
|
|
|
+ #+sbcl (sb-ext:gc :full t)
|
|
|
(room)
|
|
(room)
|
|
|
(format t "Loaded ~A~%" data)
|
|
(format t "Loaded ~A~%" data)
|
|
|
(apply #'clack:clackup
|
|
(apply #'clack:clackup
|