@@ -122,43 +122,6 @@ async def get_articles_by_filters(
122122 favorited : str | None = None ,
123123 ) -> ArticlesFeedDTO :
124124 articles = await self ._article_repo .list_by_filters (
125- session = session ,
126- limit = limit ,
127- offset = offset ,
128- tag = tag ,
129- author = author ,
130- favorited = favorited ,
131- )
132- profiles_map = await self ._get_profiles_mapping (
133- session = session , articles = articles , current_user = current_user
134- )
135- articles_with_extra = [
136- await self ._get_article_info (
137- session = session ,
138- article = article ,
139- profile = profiles_map [article .author_id ],
140- user_id = current_user .id if current_user else None ,
141- )
142- for article in articles
143- ]
144- articles_count = await self ._article_repo .count_by_filters (
145- session = session , tag = tag , author = author , favorited = favorited
146- )
147- return ArticlesFeedDTO (
148- articles = articles_with_extra , articles_count = articles_count
149- )
150-
151- async def get_articles_by_filters_v2 (
152- self ,
153- session : AsyncSession ,
154- current_user : UserDTO | None ,
155- limit : int ,
156- offset : int ,
157- tag : str | None = None ,
158- author : str | None = None ,
159- favorited : str | None = None ,
160- ) -> ArticlesFeedDTO :
161- articles = await self ._article_repo .list_by_filters_v2 (
162125 session = session ,
163126 user_id = current_user .id if current_user else None ,
164127 limit = limit ,
@@ -178,31 +141,6 @@ async def get_articles_feed(
178141 articles = await self ._article_repo .list_by_followings (
179142 session = session , user_id = current_user .id , limit = limit , offset = offset
180143 )
181- profiles_map = await self ._get_profiles_mapping (
182- session = session , articles = articles , current_user = current_user
183- )
184- articles_with_extra = [
185- await self ._get_article_info (
186- session = session ,
187- article = article ,
188- profile = profiles_map [article .author_id ],
189- user_id = current_user .id ,
190- )
191- for article in articles
192- ]
193- articles_count = await self ._article_repo .count_by_followings (
194- session = session , user_id = current_user .id
195- )
196- return ArticlesFeedDTO (
197- articles = articles_with_extra , articles_count = articles_count
198- )
199-
200- async def get_articles_feed_v2 (
201- self , session : AsyncSession , current_user : UserDTO , limit : int , offset : int
202- ) -> ArticlesFeedDTO :
203- articles = await self ._article_repo .list_by_followings_v2 (
204- session = session , user_id = current_user .id , limit = limit , offset = offset
205- )
206144 articles_count = await self ._article_repo .count_by_followings (
207145 session = session , user_id = current_user .id
208146 )
0 commit comments