2024-08-01 14:23:54 +00:00
|
|
|
|
module models
|
|
|
|
|
// структуры объявляются в принципе как в гошке, заисключением того что видимо взято из С происходит деление на публичные и приватные
|
|
|
|
|
// поэтому для того чтобы реализовать инкапсуляцию, если указать ключевое слово pub - будет все доступно
|
|
|
|
|
|
|
|
|
|
pub struct Button {
|
|
|
|
|
pub mut:
|
2024-08-08 19:57:58 +00:00
|
|
|
|
text string @[json: 'Text']
|
|
|
|
|
state string @[json: 'State']
|
2024-08-01 14:23:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub struct Question {
|
|
|
|
|
pub mut:
|
2024-08-08 19:57:58 +00:00
|
|
|
|
title string @[json: 'Title']
|
|
|
|
|
description string @[json: 'Description']
|
|
|
|
|
buttons []Button @[json: 'Buttons']
|
2024-08-15 14:24:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:17:45 +00:00
|
|
|
|
@[table: 'question']
|
2024-08-15 15:54:02 +00:00
|
|
|
|
pub struct QuizQuestion {
|
|
|
|
|
pub mut:
|
2024-08-16 15:17:45 +00:00
|
|
|
|
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']
|
2024-08-15 15:54:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:17:45 +00:00
|
|
|
|
@[table: 'telegram_integration']
|
2024-08-16 09:43:07 +00:00
|
|
|
|
pub struct TelegramIntegration {
|
|
|
|
|
pub mut:
|
2024-08-16 15:17:45 +00:00
|
|
|
|
id i64 @[primary; sql: serial]
|
|
|
|
|
account_id string @[sql: 'accountid']
|
|
|
|
|
quiz_id i64 @[sql: 'quizid']
|
|
|
|
|
bot_token string @[sql: 'bot_token']
|
|
|
|
|
repeatable bool @[sql: 'repeatable']
|
2024-08-18 08:37:44 +00:00
|
|
|
|
bot_name string @[sql: 'bot_name']
|
2024-08-16 15:17:45 +00:00
|
|
|
|
deleted bool @[sql: 'deleted']
|
2024-08-16 09:43:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:17:45 +00:00
|
|
|
|
@[table: 'respondent_state']
|
2024-08-16 09:43:07 +00:00
|
|
|
|
pub struct RespondentState {
|
|
|
|
|
pub mut:
|
2024-08-16 15:17:45 +00:00
|
|
|
|
id i64 @[primary; sql: serial]
|
|
|
|
|
telegram_id i64 @[sql: 'telegram_id']
|
|
|
|
|
quiz_id i64 @[sql: 'quizid']
|
|
|
|
|
state string @[sql: 'state']
|
|
|
|
|
lang string @[sql: 'lang']
|
|
|
|
|
contact string @[sql: 'contact']
|
|
|
|
|
finish bool @[sql: 'finish']
|
2024-08-16 09:43:07 +00:00
|
|
|
|
}
|