Versions in this module Expand all Collapse all v0 v0.0.2 Oct 29, 2024 Changes in this version + const BizId + type AttributeDto struct + KV []*AttributeKV + type AttributeKV struct + Key string + Value interface{} + type BatchAttribute struct + BatchKv []*AttributeDto + type MgoAttribute struct + func NewMongoAttribute(m *mongo.Database, c string) *MgoAttribute + func (s *MgoAttribute) DeleteAllByBizId(ctx context.Context, id string) (int64, error) + func (s *MgoAttribute) DeleteAttributeByBizId(ctx context.Context, id string, delKeys []string) (int64, error) + func (s *MgoAttribute) GetAssetAttribute(ctx context.Context, id string) (map[string]interface{}, error) + func (s *MgoAttribute) GetAttributeByBizId(ctx context.Context, id string, path []string) (interface{}, error) + func (s *MgoAttribute) ListByBizIds(ctx context.Context, ids []string) ([]map[string]interface{}, error) + func (s *MgoAttribute) Page(ctx context.Context, filter bson.D, p *Page) (PageResult, error) + func (s *MgoAttribute) Save(ctx context.Context, kv []*AttributeKV) (string, error) + func (s *MgoAttribute) SaveBatch(ctx context.Context, batchKv *BatchAttribute) ([]string, error) + func (s *MgoAttribute) UpdateBatch(ctx context.Context, id string, dto *AttributeDto) (int64, error) + func (s *MgoAttribute) UpdateOneByBizId(ctx context.Context, id string, m *AttributeDto) (int64, error) + func (s *MgoAttribute) UseCollection(c string) *MgoAttribute + type MgoAttributeBackup struct + func NewMongoBackAttribute(m *mongo.Database, c string) *MgoAttributeBackup + func (s *MgoAttributeBackup) DeleteAllById(ctx context.Context, id string) (int64, error) + func (s *MgoAttributeBackup) DeleteAttributeById(ctx context.Context, id string, delKeys []string) (int64, error) + func (s *MgoAttributeBackup) GetAttributeById(ctx context.Context, id string, path []string) (interface{}, error) + func (s *MgoAttributeBackup) Page(ctx context.Context, filter bson.D, p *Page) (PageResult, error) + func (s *MgoAttributeBackup) Save(ctx context.Context, kv []*AttributeKV) (*Result, error) + func (s *MgoAttributeBackup) SaveBatch(ctx context.Context, batchKv *BatchAttribute) ([]string, error) + func (s *MgoAttributeBackup) UpdateBatch(ctx context.Context, id string, dto *AttributeDto) (int64, error) + func (s *MgoAttributeBackup) UseCollection(c string) + type Page struct + Field []string + PageNo int64 + PageSize int64 + S []Sort + type PageResult struct + Data []map[string]interface{} + Total int64 + type Result struct + Id string + RowAffect int64 + type Service interface + DeleteAllByBizId func(ctx context.Context, id string) (int64, error) + DeleteAttributeByBizId func(ctx context.Context, id string, delKeys []string) (int64, error) + GetAttributeByBizId func(ctx context.Context, id string, path []string) (interface{}, error) + Save func(ctx context.Context, kv []*AttributeKV) (string, error) + SaveBatch func(ctx context.Context, batchKv *BatchAttribute) ([]string, error) + UpdateBatch func(ctx context.Context, id string, dto *AttributeDto) (int64, error) + UpdateOneByBizId func(ctx context.Context, id string, m *AttributeDto) (int64, error) + type Sort struct + Desc bool + Key string + type UpdateResult struct + Id []string + RowAffect int64