app-cloudep-permission-server/pkg/domain/entity/permission.go

23 lines
833 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"
}