23 lines
833 B
Go
23 lines
833 B
Go
package entity
|
||
|
||
import (
|
||
"code.30cm.net/digimon/app-cloudep-permission-server/pkg/domain/permission"
|
||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||
)
|
||
|
||
type Permission struct {
|
||
ID primitive.ObjectID `bson:"_id,omitempty"`
|
||
Parent string `bson:"parent"` // 父權限的 ID (用字串儲存 ObjectID 的 Hex)
|
||
Name string `bson:"name"`
|
||
HTTPMethod string `bson:"http_method"` // 視作操作(Action)
|
||
HTTPPath string `bson:"http_path"` // 視作資源(Object)
|
||
Status permission.Status `bson:"status"` // 例如 1: 啟用, 0: 停用
|
||
Type permission.Type `bson:"type"`
|
||
UpdateAt int64 `bson:"update_at"`
|
||
CreateAt int64 `bson:"create_at"`
|
||
}
|
||
|
||
func (c *Permission) Collection() string {
|
||
return "permission"
|
||
}
|