Browse Source

пельмень апдейт 3.5.7

master
gsd 1 month ago
parent
commit
86f66107fd
  1. 1
      src/main/java/app/controllers/user/PublicController.java
  2. 6
      src/main/java/app/entities/db/ban/BanSearchFilter.java
  3. 5
      src/main/java/app/repositories/BanRepository.java

1
src/main/java/app/controllers/user/PublicController.java

@ -68,6 +68,7 @@ public class PublicController {
banSearchFilter.getAccounts(profileService),
banSearchFilter.getBeginTimestamp(),
banSearchFilter.getEndTimestamp(),
banSearchFilter.getActiveObj(),
banSearchFilter.getActive(),
banSearchFilter.getAdminIds(profileService))
, HttpStatus.OK);

6
src/main/java/app/entities/db/ban/BanSearchFilter.java

@ -18,10 +18,14 @@ public class BanSearchFilter extends SearchFilter {
return ban_ids == null || ban_ids.isEmpty() ? null : ban_ids;
}
public Boolean getActive() {
public boolean getActive() {
return active;
}
public Integer getActiveObj() {
return active == null?null:1;
}
public List<String> getAdminIds(ProfileService profileService) {
if (admin_ids == null || admin_ids.isEmpty()) return null;

5
src/main/java/app/repositories/BanRepository.java

@ -17,13 +17,14 @@ public interface BanRepository extends PagingAndSortingRepository<Ban, Long> {
"(:account_ids is null or b.account_id in :account_ids) and " +
"(:begin_date is null or b.timestamp >= :begin_date) and " +
"(:end_date is null or :end_date <= b.timestamp) and " +
"(:active is null or b.active = :active) and " +
"(:active_null is null or b.active = :active) and " +
"(:admin_ids is null or b.unbanned_by_id in :admin_ids)")
Page<Ban> getBans(Pageable pageable,
@Param(value = "ban_ids")List<Long> ban_ids,
@Param(value = "account_ids") List<Long> account_ids,
@Param(value = "begin_date") Timestamp begin_date,
@Param(value = "end_date") Timestamp end_date,
@Param(value = "active") Boolean active,
@Param(value = "active_null") Integer active_null,
@Param(value = "active") boolean active,
@Param(value = "admin_ids") List<String> admin_ids);
}

Loading…
Cancel
Save