From 544dfcc2b43709f03ea5903116f3ef2fc3587a85 Mon Sep 17 00:00:00 2001 From: harold Date: Mon, 24 Feb 2025 21:28:30 +0500 Subject: [PATCH] add struct types for new db tables --- internal/model/models.go | 51 +++++++++++++++++++++++++++++++++++++ internal/model/sql/model.go | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/internal/model/models.go b/internal/model/models.go index 3f32dac..0d07aef 100644 --- a/internal/model/models.go +++ b/internal/model/models.go @@ -52,6 +52,57 @@ type Target struct { UpdatedAt time.Time `db:"updated_at"` } +type DonatePage struct { + id int `db:"id"` + streamerID int `db:"streamer_id"` + description string `db:"description"` + textAfterDonat string `db:"text_after_donat"` + pageBackground string `db:"page_background"` + avatar string `db:"avatar"` + backgroundImg string `db:"background_img"` +} + +type Moderation struct { + id int `db:"id"` + streamerID int `db:"streamer_id"` + enable bool `db:"enable"` + duration int `db:"duration"` +} + +type Filter struct { + id int `db:"id"` + streamerID int `db:"streamer_id"` + enableLinks bool `db:"enable_links"` +} + +type FilterWord struct { + id int `db:"id"` + donatFilterID int `db:"donat_filter_id"` + word string `db:"word"` +} + +type VoiceSettings struct { + id int `db:"id"` + streamerID int `db:"streamer_id"` + voiceSpeed int `db:"voice_speed"` + scenery string `db:"scenery"` + voiceSoundPercent int `db:"voice_sound_percent"` + minPrice int `db:"min_price"` +} + +type Language struct { + id int `db:"id"` + isoCode string `db:"iso_code"` + ruName string `db:"ru_name"` + enName string `db:"en_name"` +} + +type VoiceLanguage struct { + id int `db:"id"` + voiceSettingID int `db:"voice_setting_id"` + languageID int `db:"language_id"` +} + type UpdateDonatPage struct { ProfileAvatar bool `json:"profileAvatar"` Description string `json:"description"` diff --git a/internal/model/sql/model.go b/internal/model/sql/model.go index 0cf5771..47e9b0a 100644 --- a/internal/model/sql/model.go +++ b/internal/model/sql/model.go @@ -86,7 +86,7 @@ CREATE TABLE IF NOT EXISTS voice_settings ( min_price INTEGER NOT NULL, ) -CREATE TABLE IF NOT EXISTS voice_languages ( +CREATE TABLE IF NOT EXISTS languages ( id SERIAL PRIMARY KEY, iso_code TEXT DEFAULT '', ru_name TEXT DEFAULT '',