From 97a25308d872729d611f7e31cd9fa7b1071ac458 Mon Sep 17 00:00:00 2001 From: Akulij Date: Tue, 25 Mar 2025 11:58:02 +0800 Subject: [PATCH] fix: mode user table definition to db file --- cmd/app/db.go | 8 ++++++++ cmd/app/main.go | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/app/db.go b/cmd/app/db.go index 2d5ed60..b4d1c19 100644 --- a/cmd/app/db.go +++ b/cmd/app/db.go @@ -7,6 +7,14 @@ import ( "gorm.io/gorm" ) +type User struct { + gorm.Model + ID int64 + State string + MsgCounter uint + RoleBitmask uint +} + func (u User) IsAdmin() bool { return u.RoleBitmask&1 == 1 } diff --git a/cmd/app/main.go b/cmd/app/main.go index c61ea67..b2c11f8 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -16,14 +16,6 @@ import ( "gorm.io/gorm" ) -type User struct { - gorm.Model - ID int64 - State string - MsgCounter uint - RoleBitmask uint -} - type BotController struct { cfg config.Config bot *tgbotapi.BotAPI