diff --git a/internal/app/api/service/bilbil_video.go b/internal/app/api/service/bilbil_video.go index 4a69c42..f6d81ea 100644 --- a/internal/app/api/service/bilbil_video.go +++ b/internal/app/api/service/bilbil_video.go @@ -105,6 +105,7 @@ func queryCheck() map[string]func(item query_parser.QueryItem) (bool, string) { return map[string]func(item query_parser.QueryItem) (bool, string){ "tag": _stringCheck, "name": _stringCheck, + "title": _stringCheck, "mid": _numericCheck, "view": _numericCheck, "pubdate": _numericCheck, diff --git a/internal/repository/bilbil_video_pg.go b/internal/repository/bilbil_video_pg.go index 81dddf2..a135c6c 100644 --- a/internal/repository/bilbil_video_pg.go +++ b/internal/repository/bilbil_video_pg.go @@ -102,7 +102,7 @@ func (impl *BilibiliVideoPostgresImpl) builderQueryItems(tx *gorm.DB, queryItems switch item.Type { case query_parser.TypeAND: for _, value := range item.Values { - tx = tx.Where(fmt.Sprintf("%s = ?", item.Key), value) + tx = tx.Where(fmt.Sprintf("%s LIKE ?", item.Key), "%"+value+"%") } case query_parser.TypeOR: tx = tx.Where(fmt.Sprintf("%s IN (?)", item.Key), item.Values)