Browse Source

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

master
gsd 1 month ago
parent
commit
b79226f06a
  1. 3
      src/main/java/app/entities/SearchFilter.java
  2. 6
      src/main/java/app/repositories/BanRepository.java
  3. 6
      src/main/java/app/repositories/KillfeedRepository.java
  4. 4
      src/main/java/app/repositories/MessageRepository.java

3
src/main/java/app/entities/SearchFilter.java

@ -21,11 +21,12 @@ public abstract class SearchFilter {
public List<Long> getAccounts(ProfileService profileService) {
if (accounts == null || accounts.isEmpty()) return null;
return accounts.stream()
List<Long> filtered = accounts.stream()
.map(profileService::GetSteamIDFromAnyData)
.filter(Objects::nonNull)
.map(sId -> sId.account_id)
.toList();
return filtered.isEmpty()?null:filtered;
}
public Long getBeginUnixTime() {

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

@ -20,10 +20,10 @@ public interface BanRepository extends PagingAndSortingRepository<Ban, Long> {
"(:active is null or b.active = :active) and " +
"(:admin_ids is null or b.unbanned_by_id in :admin_ids) order by b.id desc")
Page<Ban> getBans(Pageable pageable,
@Param(value = "ban_ids")List<Long> ban_ids,
@Param(value = "account_ids") List<Long> account_ids,
@Param(value = "ban_ids") Iterable<Long> ban_ids,
@Param(value = "account_ids") Iterable<Long> account_ids,
@Param(value = "begin_date") Long begin_date,
@Param(value = "end_date") Long end_date,
@Param(value = "active") Boolean active,
@Param(value = "admin_ids") List<String> admin_ids);
@Param(value = "admin_ids") Iterable<String> admin_ids);
}

6
src/main/java/app/repositories/KillfeedRepository.java

@ -26,7 +26,7 @@ public interface KillfeedRepository extends PagingAndSortingRepository<KillsInFe
"(:server_id is null or k.server_id like :server_id) and" +
"(:account_id is null or (k.attacker_id in :accounts_id and k.attacker_id != k.victim_id)) order by k.id desc")
Page<KillsInFeed> getKills(Pageable pageable,
@Param("accounts_id") List<Long> accounts_id,
@Param("accounts_id") Iterable<Long> accounts_id,
@Param("server_id") String server_id,
@Param("utime") Long utime);
@ -45,7 +45,7 @@ public interface KillfeedRepository extends PagingAndSortingRepository<KillsInFe
"(:server_id is null or k.server_id like :server_id) and" +
"(:account_id is null or (k.victim_id in :accounts_id and k.attacker_id != k.victim_id)) order by k.id desc")
Page<KillsInFeed> getDeads(Pageable pageable,
@Param("accounts_id") List<Long> accounts_id,
@Param("accounts_id") Iterable<Long> accounts_id,
@Param("server_id") String server_id,
@Param("utime") Long utime);
@ -75,7 +75,7 @@ public interface KillfeedRepository extends PagingAndSortingRepository<KillsInFe
"(:server_id is null or k.server_id like :server_id) and" +
"(:account_id is null or k.assister_id in :accounts_id) order by k.id desc")
Page<KillsInFeed> getAssists(Pageable pageable,
@Param("accounts_id") List<Long> accounts_id,
@Param("accounts_id") Iterable<Long> accounts_id,
@Param("server_id") String server_id,
@Param("utime") Long utime);
}

4
src/main/java/app/repositories/MessageRepository.java

@ -7,8 +7,6 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface MessageRepository extends PagingAndSortingRepository<Message, Long> {
@Query(value = "select m from Message m where " +
@ -18,7 +16,7 @@ public interface MessageRepository extends PagingAndSortingRepository<Message, L
"(:message_contain is null or m.message like :message_contain) and " +
"(:server_id is null or m.server_id like :server_id) order by m.id desc ")
Page<Message> getMessages(Pageable pageable,
@Param(value = "account_ids") List<Long> account_ids,
@Param(value = "account_ids") Iterable<Long> account_ids,
@Param(value = "begin_date") Long begin_date,
@Param(value = "end_date") Long end_date,
@Param(value = "message_contain") String message_contain,

Loading…
Cancel
Save