Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
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 CreateRequest ¶
type CreateRequest struct {
EditRequest
ID string `json:"_id" binding:"id"`
}
type EditRequest ¶
type EditRequest struct {
Name string `json:"name" binding:"required,max=255"`
Description string `json:"description" binding:"required,max=255"`
Author string `json:"author" swaggerignore:"true"`
Exdates []ExdateRequest `json:"exdates" binding:"required,notblank,dive"`
}
type Exdate ¶
type ExdateRequest ¶
type ListRequest ¶
type ListRequest struct {
pagination.FilteredQuery
SortBy string `form:"sort_by" json:"sort_by" binding:"oneoforempty=name created"`
}
type Response ¶
type Response struct {
ID string `bson:"_id" json:"_id"`
Name string `bson:"name" json:"name"`
Description string `bson:"description" json:"description"`
Exdates []Exdate `bson:"exdates" json:"exdates"`
Author *author.Author `bson:"author,omitempty" json:"author,omitempty"`
Created *datetime.CpsTime `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"`
Updated *datetime.CpsTime `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"`
Deletable *bool `bson:"deletable,omitempty" json:"deletable,omitempty"`
}
type Store ¶
type Store interface {
Insert(ctx context.Context, r CreateRequest) (*Response, error)
Find(ctx context.Context, r ListRequest) (*AggregationResult, error)
GetByID(ctx context.Context, id string) (*Response, error)
Update(ctx context.Context, r UpdateRequest) (*Response, error)
Delete(ctx context.Context, id, userID string) (bool, error)
IsLinked(ctx context.Context, id string) (bool, error)
Import(ctx context.Context, name, pbhType, userID string, f multipart.File, fh *multipart.FileHeader) (*Response, error)
}
type UpdateRequest ¶
type UpdateRequest struct {
EditRequest
ID string `json:"-"`
}
Source Files
¶
- api.go
- models.go
- store.go
Click to show internal directories.
Click to hide internal directories.