diff --git a/DysonNetwork.Sphere/Sticker/StickerController.cs b/DysonNetwork.Sphere/Sticker/StickerController.cs index b3f7cc7..bcc5589 100644 --- a/DysonNetwork.Sphere/Sticker/StickerController.cs +++ b/DysonNetwork.Sphere/Sticker/StickerController.cs @@ -42,7 +42,8 @@ public class StickerController( [FromQuery] int offset = 0, [FromQuery] int take = 20, [FromQuery(Name = "pub")] string? pubName = null, - [FromQuery(Name = "order")] string? order = null + [FromQuery(Name = "order")] string? order = null, + [FromQuery(Name = "query")] string? query = null ) { Publisher.Publisher? publisher = null; @@ -61,6 +62,14 @@ public class StickerController( }; } + if (!string.IsNullOrWhiteSpace(query)) + { + queryable = queryable.Where(p => + EF.Functions.ILike(p.Name, $"%{query}%") || + EF.Functions.ILike(p.Description, $"%{query}%") + ); + } + var totalCount = await queryable .CountAsync(); var packs = await queryable