Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateEditRequest ¶
func ValidateEditRequest(sl validator.StructLevel)
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []Response `bson:"data" json:"data"` TotalCount int64 `bson:"total_count" json:"total_count"` }
func (*AggregationResult) GetData ¶
func (r *AggregationResult) GetData() interface{}
func (*AggregationResult) GetTotal ¶
func (r *AggregationResult) GetTotal() int64
type EditRequest ¶
type EditRequest struct { ID string `json:"-"` Title string `json:"title" binding:"required,max=255"` Type string `` /* 144-byte string literal not displayed */ Columns []view.WidgetColumn `json:"columns" binding:"dive"` Content string `json:"content"` Author string `json:"author" swaggerignore:"true"` }
type ListRequest ¶
type ListRequest struct { pagination.FilteredQuery SortBy string `json:"sort_by" form:"sort_by" binding:"oneoforempty=_id title type author.name author.display_name created updated"` Type string `json:"type" form:"type"` }
type Response ¶
type Response struct { ID string `bson:"_id" json:"_id"` Title string `bson:"title" json:"title"` Type string `bson:"type" json:"type"` Columns []view.WidgetColumn `bson:"columns" json:"columns,omitempty"` Content string `bson:"content" json:"content,omitempty"` Author *author.Author `bson:"author" json:"author"` Created *datetime.CpsTime `bson:"created" json:"created" swaggertype:"integer"` Updated *datetime.CpsTime `bson:"updated" json:"updated" swaggertype:"integer"` }
type Store ¶
type Store interface { Find(ctx context.Context, r ListRequest) (*AggregationResult, error) GetOneById(ctx context.Context, id string) (*Response, error) Insert(ctx context.Context, r EditRequest) (*Response, error) Update(ctx context.Context, r EditRequest) (*Response, error) Delete(ctx context.Context, id, userID string) (bool, error) }
Click to show internal directories.
Click to hide internal directories.