From 86540e00b1f22c217416aac9a430cb5ab967f4f2 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Fri, 24 Oct 2025 21:51:48 -0600 Subject: [PATCH] added more database data structures to show the next directions --- database/conference.go | 10 +++++++++- database/hotlist.go | 17 +++++++++++++++++ database/topic.go | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 database/hotlist.go create mode 100644 database/topic.go diff --git a/database/conference.go b/database/conference.go index baff68f..fc4481b 100644 --- a/database/conference.go +++ b/database/conference.go @@ -37,6 +37,14 @@ type Conference struct { Color *string `db:"color"` } +type ConferenceSettings struct { + ConfId int32 `db:"confid"` + Uid int32 `db:"uid"` + DefaultPseud *string `db:"default_pseud"` + LastRead *time.Time `db:"last_read"` + LastPost *time.Time `db:"last_post"` +} + // conferenceCache is the cache for Conference objects. var conferenceCache *lru.TwoQueueCache = nil @@ -198,7 +206,7 @@ func AmGetConferenceByAlias(alias string) (*Conference, error) { /* AmGetCommunityConferences returns all conferences for a given community. * Parameters: - * cid - COmmunity ID to get conferences for. + * cid - Community ID to get conferences for. * showHidden - true to show hidden conferences. * Returns: * Array containing the COnference pointers, or nil. diff --git a/database/hotlist.go b/database/hotlist.go new file mode 100644 index 0000000..0da95db --- /dev/null +++ b/database/hotlist.go @@ -0,0 +1,17 @@ +/* + * Amsterdam Web Communities System + * Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +// The database package contains database management and storage logic. +package database + +type ConferenceHotlist struct { + Uid int32 `db:"uid"` + Sequence int16 `db:"sequence"` + CommId int32 `db:"commid"` + ConfId int32 `db:"confid"` +} diff --git a/database/topic.go b/database/topic.go new file mode 100644 index 0000000..f848675 --- /dev/null +++ b/database/topic.go @@ -0,0 +1,36 @@ +/* + * Amsterdam Web Communities System + * Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +// The database package contains database management and storage logic. +package database + +import "time" + +type Topic struct { + TopicId int32 `db:"topicid"` + ConfId int32 `db:"confid"` + Number int16 `db:"num"` + CreatorUid int32 `db:"creator_uid"` + TopMessage int32 `db:"top_message"` + Frozen bool `db:"frozen"` + Archived bool `db:"archived"` + Sticky bool `db:"sticky"` + CreateDate time.Time `db:"createdate"` + LastUpdate time.Time `db:"lastupdate"` + Name string `db:"name"` +} + +type TopicSettings struct { + TopicId int32 `db:"topicid"` + Uid int32 `db:"uid"` + Hidden bool `db:"hidden"` + LastMessage int32 `db:"last_message"` + LastRead *time.Time `db:"last_read"` + LastPost *time.Time `db:"last_post"` + Subscribe bool `db:"subscribe"` +}