models

package
v0.0.0-...-7b45942 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryCommonModel

type CategoryCommonModel struct {
	UID  primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Slug string             `json:"slug"`
	Name string             `json:"name"`
}

type CategoryModel

type CategoryModel struct {
	UID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Slug      string             `json:"slug"`
	Name      string             `json:"name"`
	CreatedAt interface{}        `json:"createdAt"`
	UpdatedAt interface{}        `json:"updatedAt"`
	DeletedAt interface{}        `json:"deletedAt"`
}

func (*CategoryModel) ToCommonModel

func (category *CategoryModel) ToCommonModel() (commonModel CategoryCommonModel)

type CommentModel

type CommentModel struct {
	UID              primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	PostUid          primitive.ObjectID `json:"postUid,omitempty"`
	PostAuthorUid    primitive.ObjectID `json:"postAuthorUid,omitempty"`
	ParentCommentUid interface{}        `json:"parentCommentUid,omitempty"`
	Email            string             `json:"email"`
	Name             string             `json:"name"`
	Content          string             `json:"content"`
	ReplyCount       int16              `json:"replyCount"`
	CreatedAt        interface{}        `json:"createdAt"`
	DeletedAt        interface{}        `json:"deletedAt"`
}

type NotificationModel

type NotificationModel struct {
	UID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Title     string             `json:"title"`
	Content   string             `json:"content"`
	Owner     UserCommonModel    `json:"owner"`
	ReadAt    interface{}        `json:"readAt"`
	CreatedAt interface{}        `json:"createdAt"`
	DeletedAt interface{}        `json:"deletedAt"`
}

type PageContentModel

type PageContentModel struct {
	UID     primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Content string             `json:"content"`
}

type PageModel

type PageModel struct {
	UID         primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Slug        string             `json:"slug"`
	Title       string             `json:"title"`
	Author      UserCommonModel    `json:"author"`
	PublishedAt interface{}        `json:"publishedAt"`
	CreatedAt   interface{}        `json:"createdAt"`
	UpdatedAt   interface{}        `json:"updatedAt"`
	DeletedAt   interface{}        `json:"deletedAt"`
}

type PostContentModel

type PostContentModel struct {
	UID     primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Content string             `json:"content"`
}

type PostModel

type PostModel struct {
	UID                primitive.ObjectID    `bson:"_id" json:"id,omitempty"`
	Slug               string                `json:"slug"`
	Title              string                `json:"title"`
	FeaturingImagePath string                `json:"featuringImagePath"`
	Description        string                `json:"description"`
	Categories         []CategoryCommonModel `json:"categories"`
	Tags               []string              `json:"tags"`
	Author             UserCommonModel       `json:"author"`
	CommentCount       int16                 `json:"commentCount"`
	PublishedAt        interface{}           `json:"publishedAt"`
	CreatedAt          interface{}           `json:"createdAt"`
	UpdatedAt          interface{}           `json:"updatedAt"`
	DeletedAt          interface{}           `json:"deletedAt"`
}

type RevokedTokenModel

type RevokedTokenModel struct {
	UID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	ExpiresAt primitive.DateTime `json:"expiresAt"`
	Owner     UserCommonModel    `json:"owner"`
	CreatedAt interface{}        `json:"createdAt"`
	UpdatedAt interface{}        `json:"updatedAt"`
	DeletedAt interface{}        `json:"deletedAt"`
}

type UserCommonModel

type UserCommonModel struct {
	UID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Username  string             `json:"username"`
	Email     string             `json:"email"`
	FirstName string             `json:"firstName"`
	LastName  string             `json:"lastName"`
}

type UserModel

type UserModel struct {
	UID       primitive.ObjectID `bson:"_id" json:"id,omitempty"`
	Username  string             `json:"username"`
	Email     string             `json:"email"`
	FirstName string             `json:"firstName"`
	LastName  string             `json:"lastName"`
	Password  string             `json:"password"`
	Roles     []UserRole         `json:"roles"`
	CreatedAt interface{}        `json:"createdAt"`
	UpdatedAt interface{}        `json:"updatedAt"`
	DeletedAt interface{}        `json:"deletedAt"`
}

func (*UserModel) ToCommonModel

func (user *UserModel) ToCommonModel() (commonModel UserCommonModel)

type UserRole

type UserRole struct {
	Level int                `json:"level"`
	Name  string             `json:"name"`
	Since primitive.DateTime `json:"since"`
}

0 => SuperAdmin

1 => Admin

2 => Editor

3 => Writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL