refactor: separate backend domains and storage adapters
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package biz
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Dictionary struct {
|
||||
ID uint
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
Name string
|
||||
Type string
|
||||
Status bool
|
||||
Desc string
|
||||
ParentID *uint
|
||||
Children []*Dictionary
|
||||
Details []*DictionaryDetail
|
||||
}
|
||||
|
||||
type DictionaryDetail struct {
|
||||
ID uint
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
Label string
|
||||
Value string
|
||||
Extend string
|
||||
Status bool
|
||||
Sort int
|
||||
DictionaryID uint
|
||||
ParentID *uint
|
||||
Level int
|
||||
Path string
|
||||
Children []*DictionaryDetail
|
||||
}
|
||||
|
||||
type DictionaryRepo interface {
|
||||
CreateDictionary(context.Context, *Dictionary) error
|
||||
UpdateDictionary(context.Context, *Dictionary) error
|
||||
DeleteDictionary(context.Context, uint) error
|
||||
FindDictionary(context.Context, uint, string, bool) (*Dictionary, error)
|
||||
ListDictionaries(context.Context, int, int, string, string, bool) ([]*Dictionary, int64, error)
|
||||
CreateDictionaryDetail(context.Context, *DictionaryDetail) error
|
||||
UpdateDictionaryDetail(context.Context, *DictionaryDetail) error
|
||||
DeleteDictionaryDetail(context.Context, uint) error
|
||||
FindDictionaryDetail(context.Context, uint) (*DictionaryDetail, error)
|
||||
ListDictionaryDetails(context.Context, int, int, uint, string, string) ([]*DictionaryDetail, int64, error)
|
||||
DictionaryDetailTree(context.Context, uint, string) ([]*DictionaryDetail, error)
|
||||
}
|
||||
Reference in New Issue
Block a user