summaryrefslogtreecommitdiff
path: root/lisp/service/home-service.lisp
blob: 30e5a036ead65690d7d466cf4ebce99ff48cc247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(declaim (optimize (speed 0) (safety 3) (debug 3)))

(in-package :bogenherr)

(defclass home-service (rest-service)
  ((content :initarg :content
            :initform nil
            :accessor content))
  (:documentation ""))

(defmethod initialize-instance :after ((home-service home-service) &key)
  t)

(defun home-json (&optional message errormsg)
  (with-noauth (instance home-service)
    (when (not (org-ckons-core::null-or-empty-p message)) (setf (message instance) message))
    (when (not (org-ckons-core::null-or-empty-p errormsg)) (setf (errormsg instance) errormsg))))

(define-endpoint ("/home" :method :get) () home-json)
(define-endpoint ("/home" :method :post) (&post (message :parameter-type 'string) (errormsg :parameter-type 'string)) home-json message errormsg)