model redesign

This commit is contained in:
naiba 2024-10-20 00:32:55 +08:00
parent 843ecdaa33
commit 4fc0aad7a0
7 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,6 @@
package model
type NotificationGroup struct {
Common
Name string `json:"name"`
}

View File

@ -0,0 +1,7 @@
package model
type NotificationGroupNotification struct {
Common
NotificationGroupID uint64 `json:"notification_group_id"`
NotificationID uint64 `json:"notification_id"`
}

View File

@ -7,9 +7,10 @@ import (
"sync" "sync"
"time" "time"
"gorm.io/gorm"
"github.com/naiba/nezha/pkg/utils" "github.com/naiba/nezha/pkg/utils"
pb "github.com/naiba/nezha/proto" pb "github.com/naiba/nezha/proto"
"gorm.io/gorm"
) )
type Server struct { type Server struct {

6
model/server_group.go Normal file
View File

@ -0,0 +1,6 @@
package model
type ServerGroup struct {
Common
Name string `json:"name"`
}

View File

@ -0,0 +1,7 @@
package model
type ServerGroupServer struct {
Common
ServerGroupId uint64 `json:"server_group_id"`
ServerId uint64 `json:"server_id"`
}

6
model/user_group.go Normal file
View File

@ -0,0 +1,6 @@
package model
type UserGroup struct {
Common
Name string `json:"name"`
}

7
model/user_group_user.go Normal file
View File

@ -0,0 +1,7 @@
package model
type UserGroupUser struct {
Common
UserGroupId uint64 `json:"user_group_id"`
UserId uint64 `json:"user_id"`
}