feat: search
This commit is contained in:
@@ -64,3 +64,6 @@ func (service *AuthorService) Count() (int64, error) {
|
||||
func (service *AuthorService) SortedByOrder(fieldsSortingOrder []utils.SortField) ([]*Author, error) {
|
||||
return utils.SortByOrder(fieldsSortingOrder, Author{})
|
||||
}
|
||||
func (service *AuthorService) SearchByAllTextFields(phrase string) ([]*Author, error) {
|
||||
return utils.FindPhraseByStringFields[Author](phrase, Author{})
|
||||
}
|
||||
|
||||
@@ -61,6 +61,9 @@ func (service *CommentService) Count() (int64, error) {
|
||||
amount, err := dal.Comment.Count()
|
||||
return amount, err
|
||||
}
|
||||
func (service *CommentService) SortedByOrder(fieldsSortOrder []utils.SortField) ([]*Comment, error) {
|
||||
return utils.SortByOrder(fieldsSortOrder, Comment{})
|
||||
func (service *CommentService) SortedByOrder(fieldsSortingOrder []utils.SortField) ([]*Comment, error) {
|
||||
return utils.SortByOrder(fieldsSortingOrder, Comment{})
|
||||
}
|
||||
func (service *CommentService) SearchByAllTextFields(phrase string) ([]*Comment, error) {
|
||||
return utils.FindPhraseByStringFields[Comment](phrase, Comment{})
|
||||
}
|
||||
|
||||
@@ -64,3 +64,6 @@ func (service *PostService) Count() (int64, error) {
|
||||
func (service *PostService) SortedByOrder(fieldsSortOrder []utils.SortField) ([]*Post, error) {
|
||||
return utils.SortByOrder(fieldsSortOrder, Post{})
|
||||
}
|
||||
func (service *PostService) SearchByAllTextFields(phrase string) ([]*Post, error) {
|
||||
return utils.FindPhraseByStringFields[Post](phrase, Post{})
|
||||
}
|
||||
|
||||
@@ -63,3 +63,6 @@ func (service *PostTypeService) Count() (int64, error) {
|
||||
func (service *PostTypeService) SortedByOrder(fieldsSortOrder []utils.SortField) ([]*PostType, error) {
|
||||
return utils.SortByOrder(fieldsSortOrder, PostType{})
|
||||
}
|
||||
func (service *PostTypeService) SearchByAllTextFields(phrase string) ([]*PostType, error) {
|
||||
return utils.FindPhraseByStringFields[PostType](phrase, PostType{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user