diff --git a/schemes.drawio b/schemes.drawio index 5519a98..95bf52c 100644 --- a/schemes.drawio +++ b/schemes.drawio @@ -1,6 +1,6 @@ - + @@ -16,48 +16,44 @@ - + - + - + - + - + - + - - + + - + - + - + - - - - - - - - - + + + + + diff --git a/src/main.go b/src/main.go index e69de29..06ab7d0 100644 --- a/src/main.go +++ b/src/main.go @@ -0,0 +1 @@ +package main diff --git a/src/models/base_model.go b/src/models/base_model.go new file mode 100644 index 0000000..d3f867d --- /dev/null +++ b/src/models/base_model.go @@ -0,0 +1,9 @@ +package models + +import "time" + +type BaseModel struct { + Id int64 `gorm:"column:id;autoIncrement;primaryKey;unique"` + CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"` + UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"` +} diff --git a/src/models/system/users.go b/src/models/system/users.go new file mode 100644 index 0000000..a8d938a --- /dev/null +++ b/src/models/system/users.go @@ -0,0 +1,15 @@ +package models + +import "lirqetes.ru/thelanc3/laura-server/models" + +type User struct { + models.BaseModel + TelegramId int64 `gorm:"column:telegram_id"` + IsBanned bool `gorm:"column:is_banned;default:false"` + IsReceive bool `gorm:"column:is_receive;default:false"` + IsApprovedStatistics bool `gorm:"column:is_approved_statistics;default:false"` +} + +func (User) TableName() string { + return "system.users" +} diff --git a/src/routes/init.go b/src/routes/init.go new file mode 100644 index 0000000..0db51ae --- /dev/null +++ b/src/routes/init.go @@ -0,0 +1 @@ +package routes