1919import org .eclipse .openvsx .json .*;
2020import org .eclipse .openvsx .ratelimit .cache .RateLimitCacheService ;
2121import org .eclipse .openvsx .repositories .RepositoryService ;
22+ import org .eclipse .openvsx .util .LogService ;
2223import org .eclipse .openvsx .util .TimeUtil ;
2324import org .slf4j .Logger ;
2425import org .slf4j .LoggerFactory ;
@@ -37,15 +38,18 @@ public class RateLimitAPI {
3738
3839 private final RepositoryService repositories ;
3940 private final AdminService admins ;
41+ private final LogService logs ;
4042 private RateLimitCacheService rateLimitCacheService ;
4143
4244 public RateLimitAPI (
4345 RepositoryService repositories ,
4446 AdminService admins ,
47+ LogService logs ,
4548 Optional <RateLimitCacheService > rateLimitCacheService
4649 ) {
4750 this .repositories = repositories ;
4851 this .admins = admins ;
52+ this .logs = logs ;
4953 rateLimitCacheService .ifPresent (service -> this .rateLimitCacheService = service );
5054 }
5155
@@ -92,7 +96,7 @@ public ResponseEntity<TierJson> createTier(@RequestBody TierJson tier) {
9296
9397 var result = savedTier .toJson ();
9498 result .setSuccess ("Created tier '" + savedTier .getName () + "'" );
95- admins . logAdminAction (adminUser , result );
99+ logs . logAction (adminUser , result );
96100
97101 if (rateLimitCacheService != null ) {
98102 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_TIER );
@@ -132,7 +136,7 @@ public ResponseEntity<TierJson> updateTier(@PathVariable String name, @RequestBo
132136
133137 var result = savedTier .toJson ();
134138 result .setSuccess ("Updated tier '" + savedTier .getName () + "'" );
135- admins . logAdminAction (adminUser , result );
139+ logs . logAction (adminUser , result );
136140
137141 if (rateLimitCacheService != null ) {
138142 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_TIER );
@@ -166,7 +170,7 @@ public ResponseEntity<ResultJson> deleteTier(@PathVariable String name) {
166170 repositories .deleteTier (tier );
167171
168172 var result = ResultJson .success ("Deleted tier '" + name + "'" );
169- admins . logAdminAction (adminUser , result );
173+ logs . logAction (adminUser , result );
170174
171175 if (rateLimitCacheService != null ) {
172176 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_TIER );
@@ -248,7 +252,7 @@ public ResponseEntity<CustomerJson> createCustomer(@RequestBody CustomerJson cus
248252
249253 var result = savedCustomer .toJson ();
250254 result .setSuccess ("Created customer '" + savedCustomer .getName () + "'" );
251- admins . logAdminAction (adminUser , result );
255+ logs . logAction (adminUser , result );
252256
253257 if (rateLimitCacheService != null ) {
254258 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_CUSTOMER );
@@ -289,7 +293,7 @@ public ResponseEntity<CustomerJson> updateCustomer(@PathVariable String name, @R
289293
290294 var result = savedCustomer .toJson ();
291295 result .setSuccess ("Updated customer '" + savedCustomer .getName () + "'" );
292- admins . logAdminAction (adminUser , result );
296+ logs . logAction (adminUser , result );
293297
294298 if (rateLimitCacheService != null ) {
295299 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_CUSTOMER );
@@ -318,7 +322,7 @@ public ResponseEntity<ResultJson> deleteCustomer(@PathVariable String name) {
318322 repositories .deleteCustomer (customer );
319323
320324 var result = ResultJson .success ("Deleted customer '" + name + "'" );
321- admins . logAdminAction (adminUser , result );
325+ logs . logAction (adminUser , result );
322326
323327 if (rateLimitCacheService != null ) {
324328 rateLimitCacheService .publishConfigUpdate (RateLimitCacheService .CACHE_CUSTOMER );
0 commit comments