[chuni] Add all old version event and enable flag

This commit is contained in:
samnyan
2020-02-19 16:22:05 +08:00
parent 3f495ed18d
commit 58e3de5ab9
7 changed files with 1151 additions and 1 deletions

View File

@@ -4,9 +4,13 @@ import icu.samnyan.aqua.sega.chunithm.model.gamedata.GameEvent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author samnyan (privateamusement@protonmail.com)
*/
@Repository
public interface GameEventRepository extends JpaRepository<GameEvent, Integer> {
List<GameEvent> findByEnable(boolean enable);
}

View File

@@ -36,7 +36,7 @@ public class GetGameEventHandler implements BaseHandler {
public String handle(Map<String, Object> request) throws JsonProcessingException {
String type = (String) request.get("type");
List<GameEvent> gameEventList = gameEventRepository.findAll();
List<GameEvent> gameEventList = gameEventRepository.findByEnable(true);
Map<String, Object> resultMap = new LinkedHashMap<>();
resultMap.put("type", type);

View File

@@ -30,4 +30,6 @@ public class GameEvent implements Serializable {
private LocalDateTime startDate;
private LocalDateTime endDate;
private boolean enable;
}