|
|
@ -19,6 +19,7 @@ import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* контролллер для просмотра всякой хуйни, например банлиста (нахуя он отдельный, незнаю, захотел) |
|
|
@ -64,14 +65,18 @@ public class PublicController { |
|
|
|
public ResponseEntity<Page<Ban>> getBanListWithFilters(Pageable pageable, @RequestBody(required = false) BanSearchFilter banSearchFilter) { |
|
|
|
if (banSearchFilter == null) banSearchFilter = new BanSearchFilter(); |
|
|
|
|
|
|
|
List<Long> ban_ids = banSearchFilter.getBan_ids(); |
|
|
|
List<Long> account_ids = banSearchFilter.getAccounts(profileService); |
|
|
|
List<String> admin_ids = banSearchFilter.getAdminIds(profileService); |
|
|
|
|
|
|
|
return new ResponseEntity<>( |
|
|
|
banRepository.getBans(pageable, |
|
|
|
banSearchFilter.getBan_ids(), |
|
|
|
banSearchFilter.getAccounts(profileService), |
|
|
|
ban_ids.isEmpty(), ban_ids, |
|
|
|
account_ids.isEmpty(), account_ids, |
|
|
|
banSearchFilter.getBeginUnixTime(), |
|
|
|
banSearchFilter.getEndUnixTime(), |
|
|
|
banSearchFilter.getActive(), |
|
|
|
banSearchFilter.getAdminIds(profileService)) |
|
|
|
admin_ids.isEmpty(), admin_ids) |
|
|
|
, HttpStatus.OK); |
|
|
|
} |
|
|
|
} |
|
|
|