From d6cc11dc03f036c85730077eb9d66447bdd210a7 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Fri, 23 Sep 2022 18:17:11 +0100 Subject: [PATCH] create archive package, archive-entry model and add to .asd file. This is a rough sketching out of what the model/data needs to look like. This model is what will be connecting the site's archive (Nic's artwork entries) with the Meilisearch service -- running alongside each other. I don't know how much this model is going to change but expect it to in future commits. --- ritherdon-archive.asd | 1 + src/models/archive.lisp | 93 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/models/archive.lisp diff --git a/ritherdon-archive.asd b/ritherdon-archive.asd index 0cb7f21..0e5bad4 100644 --- a/ritherdon-archive.asd +++ b/ritherdon-archive.asd @@ -56,6 +56,7 @@ (:file "models/site-settings") (:file "models/pages") (:file "models/files") + (:file "models/archive") (:file "auth") (:file "validation") (:file "nera") ; (Name of Database) diff --git a/src/models/archive.lisp b/src/models/archive.lisp new file mode 100644 index 0000000..4804ce6 --- /dev/null +++ b/src/models/archive.lisp @@ -0,0 +1,93 @@ +(in-package #:cl-user) +(defpackage #:archive + (:nicknames #:arc) + (:use #:cl + #:ritherdon-archive.db + #:app-constants + #:mito) + (:export #:archive-entry)) +(in-package #:archive) + +(defclass archive-entry () + ((title + :documentation "The title of the archive entry." + :col-type (or :text :null) + :initarg :title + :initform :null + :accessor title-of) + + (search-id + :documentation "The Id. used in the Meilisearch database." + :col-type (or :integer :null) + :initarg :search-id + :initform :null + :accessor search-id-of) + + (slug + :documentation "The slug, used as part of the URL, to access the entry." + :col-type (or :text :null) + :initarg :slug + :initform :null + :accessor slug-of) + + (thumbnail + :documentation "The name of the thumbnail, for particular entry." + :col-type (or :text :null) + :initarg :thumbnail + :initform :null + :accessor thumbnail-of) + + (thumbnail-url + :documentation "The URL for the thumbnail -- for Meilisearch." + :col-type (or :text :null) + :initarg :thumbnail-url + :initform :null + :accessor thumbnail-url-of) + + (entry-type + :documentation "Specifies the type of entry (image, audio, video, text Etc.)" + :col-type (or :text :null) + :initarg :entry-type + :initform :null + :accessor entry-type-of) + + (keywords + :documentation "Text for Meilisearch's filter options. An example + of how the keywords shold look is: 'art,welding,blue and + green,metal'. The 'blue and green' section is classed as one + keyword." + :col-type (or :text :null) + :initarg :keywords + :initform :null + :accessor keywords-of) + + (year + :documentation "The year the entry was published. Used for + Meilisearch's filtering options." + :col-type (or :integer :null) + :initarg :year + :initform :null + :accessor year-of) + + (month + :documentation "The month the entry was published. Used for + Meilisearch's filtering options." + :col-type (or :integer :null) + :initarg :month + :initform :null + :accessor month-of) + + (day + :documentation "The day the entry was published. Used for + Meilisearch's filtering options." + :col-type (or :integer :null) + :initarg :day + :initform :null + :accessor day-of)) + + (:documentation "`ARCHIVE-ENTRY' represents the model used by Mito + to map database between the system and the 'archive_entry' table in + the database. This model contains data which is used more by the + Meilisearch instance attached to this website -- as a seperate + service.") + (:metaclass mito:dao-table-class))