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 BaseEditRequest ¶
type BaseEditRequest struct { Title string `json:"title" binding:"required,max=255"` common.AlarmPatternFieldsRequest common.EntityPatternFieldsRequest common.PbehaviorPatternFieldsRequest common.WeatherServicePatternFieldsRequest }
type CreateRequest ¶
type CreateRequest struct { EditRequest Widget string `json:"widget" binding:"required"` }
type EditPositionRequest ¶
type EditPositionRequest struct {
Items []string `json:"items" binding:"required,notblank,unique"`
}
func (EditPositionRequest) MarshalJSON ¶
func (r EditPositionRequest) MarshalJSON() ([]byte, error)
func (*EditPositionRequest) UnmarshalJSON ¶
func (r *EditPositionRequest) UnmarshalJSON(b []byte) error
type EditRequest ¶
type EditRequest struct { BaseEditRequest IsUserPreference *bool `json:"is_user_preference" binding:"required"` Author string `json:"author" swaggerignore:"true"` IsPrivate bool `json:"-"` }
type ListRequest ¶
type ListRequest struct { pagination.Query Widget string `form:"widget" json:"widget" binding:"required"` Private *bool `form:"private" json:"private"` }
type PatternFieldsTransformer ¶
type PatternFieldsTransformer interface { TransformAlarmPatternFieldsRequest(ctx context.Context, r common.AlarmPatternFieldsRequest, isPrivate bool, user string) (common.AlarmPatternFieldsRequest, error) TransformEntityPatternFieldsRequest(ctx context.Context, r common.EntityPatternFieldsRequest, isPrivate bool, user string) (common.EntityPatternFieldsRequest, error) TransformPbehaviorPatternFieldsRequest(ctx context.Context, r common.PbehaviorPatternFieldsRequest, isPrivate bool, user string) (common.PbehaviorPatternFieldsRequest, error) TransformWeatherServicePatternFieldsRequest(ctx context.Context, r common.WeatherServicePatternFieldsRequest, isPrivate bool, user string) (common.WeatherServicePatternFieldsRequest, error) }
func NewPatternFieldsTransformer ¶
func NewPatternFieldsTransformer(client mongo.DbClient) PatternFieldsTransformer
type Response ¶
type Response struct { ID string `bson:"_id" json:"_id"` Widget string `bson:"widget" json:"-"` Title string `bson:"title" json:"title"` IsUserPreference bool `bson:"is_user_preference" json:"is_user_preference"` Author *author.Author `bson:"author" json:"author,omitempty"` Created *datetime.CpsTime `bson:"created" json:"created,omitempty" swaggertype:"integer"` Updated *datetime.CpsTime `bson:"updated" json:"updated,omitempty" swaggertype:"integer"` savedpattern.AlarmPatternFields `bson:",inline"` savedpattern.EntityPatternFields `bson:",inline"` savedpattern.PbehaviorPatternFields `bson:",inline"` savedpattern.WeatherServicePatternFields `bson:",inline"` IsPrivate bool `bson:"is_private" json:"is_private"` }
type Store ¶
type Store interface { Find(ctx context.Context, r ListRequest, userID string) (*AggregationResult, error) FindViewId(ctx context.Context, id string) (string, string, bool, error) FindViewIdByWidget(ctx context.Context, widgetId string) (string, string, bool, error) GetOneBy(ctx context.Context, id, userID string) (*Response, error) Insert(ctx context.Context, r CreateRequest) (*Response, error) Update(ctx context.Context, r UpdateRequest) (*Response, error) Delete(ctx context.Context, id, userID string) (bool, error) UpdatePositions(ctx context.Context, filters []string, widgetId, userID string, isPrivate bool) (bool, error) }
type UpdateRequest ¶
type UpdateRequest struct { EditRequest ID string `json:"-"` }
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.