2022-12-21 19:22:32 +08:00
|
|
|
package store
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
2023-07-02 18:56:25 +08:00
|
|
|
type Tag struct {
|
2022-12-21 19:22:32 +08:00
|
|
|
Name string
|
2023-08-04 21:55:07 +08:00
|
|
|
CreatorID int32
|
2022-12-21 19:22:32 +08:00
|
|
|
}
|
|
|
|
|
2023-07-02 18:56:25 +08:00
|
|
|
type FindTag struct {
|
2023-08-04 21:55:07 +08:00
|
|
|
CreatorID int32
|
2022-12-21 19:22:32 +08:00
|
|
|
}
|
|
|
|
|
2023-07-02 18:56:25 +08:00
|
|
|
type DeleteTag struct {
|
|
|
|
Name string
|
2023-08-04 21:55:07 +08:00
|
|
|
CreatorID int32
|
2023-07-02 18:56:25 +08:00
|
|
|
}
|
|
|
|
|
2023-07-04 10:05:57 +08:00
|
|
|
func (s *Store) UpsertTag(ctx context.Context, upsert *Tag) (*Tag, error) {
|
2023-09-26 19:37:22 +08:00
|
|
|
return s.driver.UpsertTag(ctx, upsert)
|
2022-12-21 19:22:32 +08:00
|
|
|
}
|
|
|
|
|
2023-07-02 18:56:25 +08:00
|
|
|
func (s *Store) ListTags(ctx context.Context, find *FindTag) ([]*Tag, error) {
|
2023-09-26 19:37:22 +08:00
|
|
|
return s.driver.ListTags(ctx, find)
|
2022-12-21 19:22:32 +08:00
|
|
|
}
|
|
|
|
|
2023-07-02 18:56:25 +08:00
|
|
|
func (s *Store) DeleteTag(ctx context.Context, delete *DeleteTag) error {
|
2023-09-26 19:37:22 +08:00
|
|
|
return s.driver.DeleteTag(ctx, delete)
|
2022-12-21 19:22:32 +08:00
|
|
|
}
|