summaryrefslogtreecommitdiff
path: root/lisp/sql/contact-pkg.lisp
diff options
context:
space:
mode:
authorckonstanski <kostcarl@isu.edu>2026-07-18 21:18:18 -0600
committerckonstanski <kostcarl@isu.edu>2026-07-18 21:18:18 -0600
commit08e435104c42751689553537b1f20ffb14b8dfcc (patch)
treef83d8db1a02d4be448ab044d28fda7411470bd7c /lisp/sql/contact-pkg.lisp
initial commit
Diffstat (limited to 'lisp/sql/contact-pkg.lisp')
-rw-r--r--lisp/sql/contact-pkg.lisp32
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/sql/contact-pkg.lisp b/lisp/sql/contact-pkg.lisp
new file mode 100644
index 0000000..dce6384
--- /dev/null
+++ b/lisp/sql/contact-pkg.lisp
@@ -0,0 +1,32 @@
+;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+(declaim (optimize (speed 0) (safety 3) (debug 3)))
+
+(in-package :resume)
+
+(defclass contact-pkg (record-pkg)
+ ()
+ (:documentation ""))
+
+(defmethod get-contact-us-posts ((contact-pkg contact-pkg) user-id read-p)
+ (let ((contact-us-post (make-instance 'contact-us-post)))
+ (setf (*table contact-us-post) (format nil (*table contact-us-post) user-id (if read-p "t" "f")))
+ (get-records contact-pkg contact-us-post nil)))
+
+(defmethod insert-contact-us-post ((contact-pkg contact-pkg) (contact-us-post contact-us-post))
+ (setf (*table contact-us-post) (format nil
+ "contact.insert_contact_us_post('~a', '~a', '~a', '~a', '~a')"
+ (first_name contact-us-post)
+ (last_name contact-us-post)
+ (email contact-us-post)
+ (phone contact-us-post)
+ (comments contact-us-post)))
+ (caar (call-pg-function contact-pkg contact-us-post)))
+
+(defmethod mark-contact-us-post ((contact-pkg contact-pkg) contact-us-post-id user-id read-p)
+ (let ((contact-us-post (make-instance 'contact-us-post
+ :*table (format nil
+ "contact.mark_contact_us_post(~a, ~a, '~a')"
+ contact-us-post-id
+ user-id
+ (if read-p "t" "f")))))
+ (call-pg-function contact-pkg contact-us-post)))