usermngmt/internal/model/db_model.go

33 lines
1.1 KiB
Go
Raw Normal View History

2021-11-10 02:54:49 +00:00
package model
2021-11-09 07:16:34 +00:00
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
2021-11-10 01:44:22 +00:00
// DBRole ...
type DBRole struct {
ID primitive.ObjectID `bson:"_id" json:"_id"`
Name string `bson:"name" json:"name"`
Code string `bson:"code" json:"code"`
IsAdmin bool `bson:"isAdmin" json:"isAdmin"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}
// DBUser ...
type DBUser struct {
2021-11-09 07:16:34 +00:00
ID primitive.ObjectID `bson:"_id"`
Name string `bson:"name"`
SearchString string `bson:"searchString"`
Phone string `bson:"phone"` // unique
Email string `bson:"email"` // unique
HashedPassword string `bson:"hashedPassword"`
Status string `bson:"status"`
RoleID primitive.ObjectID `bson:"roleId"`
Other string `bson:"other"`
CreatedAt time.Time `bson:"createdAt"`
UpdatedAt time.Time `bson:"updatedAt"`
}