feat: label domain

This commit is contained in:
clz 2023-05-31 16:36:45 +08:00
parent d051669c6d
commit 71e25bfa9d
4 changed files with 30 additions and 0 deletions

27
internal/label/domain.go Normal file
View File

@ -0,0 +1,27 @@
package label
import "context"
type Label struct {
ID int `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
RelativeId int `json:"relativeId"`
Count int `json:"count"`
}
type LabelRepository interface {
GetLabels(ctx context.Context) (*[]Label, error)
GetLabelById(ctx context.Context, id int) (*Label, error)
CreateLabel(ctx context.Context, label *Label) error
UpdateLabel(ctx context.Context, label *Label) error
DeleteLabel(ctx context.Context, id int) error
}
type LabelService interface {
GetLabels(ctx context.Context) (*[]Label, error)
GetLabelById(ctx context.Context, id int) (*Label, error)
CreateLabel(ctx context.Context, label *Label) error
UpdateLabel(ctx context.Context, label *Label) error
DeleteLabel(ctx context.Context, id int) error
}

1
internal/label/handle.go Normal file
View File

@ -0,0 +1 @@
package label

View File

@ -0,0 +1 @@
package label

View File

@ -0,0 +1 @@
package label