adding search func
This commit is contained in:
@@ -47,6 +47,14 @@ func GetLogger() zerolog.Logger {
|
||||
return logs.GetLogger()
|
||||
}
|
||||
|
||||
func Search(word string, collection LibDataEnum) LibDataShallow {
|
||||
d, code, err := models.Model(collection.EnumIndex()).GetAccessor().Search(word)
|
||||
if err != nil {
|
||||
return LibDataShallow{Data: d, Code: code, Err: err.Error()}
|
||||
}
|
||||
return LibDataShallow{Data: d, Code: code}
|
||||
}
|
||||
|
||||
func LoadAll(collection LibDataEnum) LibDataShallow {
|
||||
d, code, err := models.Model(collection.EnumIndex()).GetAccessor().LoadAll()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user