telegram/models/models.v
2024-08-16 12:16:42 +03:00

55 lines
1.3 KiB
V
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module models
// структуры объявляются в принципе как в гошке, заисключением того что видимо взято из С происходит деление на публичные и приватные
// поэтому для того чтобы реализовать инкапсуляцию, если указать ключевое слово pub - будет все доступно
pub struct Button {
pub mut:
text string @[json: 'Text']
state string @[json: 'State']
}
pub struct Question {
pub mut:
title string @[json: 'Title']
description string @[json: 'Description']
buttons []Button @[json: 'Buttons']
}
pub struct TelegramIntegration {
pub mut:
id i64
account_id string
quiz_id string
bot_token string
repeatable bool
name string
description string
deleted bool
}
pub struct RespondentState {
pub mut:
id i64
telegram_id i64
quiz_id i64
state string
lang string
contact string
finish bool
}
[table: 'question']
pub struct QuizQuestion {
pub mut:
id i64 [primary; sql: serial]
quiz_id i64 [sql: 'quiz_id']
title string [sql: 'title']
description string [sql: 'description']
question_type string [sql: 'questiontype']
content string [sql: 'content']
required bool [sql: 'required']
deleted bool [sql: 'deleted']
}