78 lines
1.9 KiB
V
78 lines
1.9 KiB
V
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']
|
||
}
|
||
|
||
[table: 'telegram_integration']
|
||
pub struct TelegramIntegration {
|
||
pub mut:
|
||
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']
|
||
name string [sql: 'name']
|
||
description string [sql: 'description']
|
||
deleted bool [sql: 'deleted']
|
||
}
|
||
|
||
[table: 'respondent_state']
|
||
pub struct RespondentState {
|
||
pub mut:
|
||
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']
|
||
} |