mirror of https://github.com/Soyandroid/aqua
[api] Add chuni character and skill to database
parent
91c0c3de2f
commit
ed2732acad
|
@ -1,10 +1,12 @@
|
|||
package icu.samnyan.aqua.api.controller.sega.game.chuni.amazon;
|
||||
|
||||
import icu.samnyan.aqua.sega.chunithm.dao.gamedata.GameCharacterRepository;
|
||||
import icu.samnyan.aqua.sega.chunithm.dao.gamedata.GameCharacterSkillRepository;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.gamedata.Character;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.gamedata.CharacterSkill;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.gamedata.Music;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.GameMusicService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,9 +18,13 @@ import java.util.List;
|
|||
public class ApiAmazonGameDataController {
|
||||
|
||||
private final GameMusicService gameMusicService;
|
||||
private final GameCharacterRepository gameCharacterRepository;
|
||||
private final GameCharacterSkillRepository gameCharacterSkillRepository;
|
||||
|
||||
public ApiAmazonGameDataController(GameMusicService gameMusicService) {
|
||||
public ApiAmazonGameDataController(GameMusicService gameMusicService, GameCharacterRepository gameCharacterRepository, GameCharacterSkillRepository gameCharacterSkillRepository) {
|
||||
this.gameMusicService = gameMusicService;
|
||||
this.gameCharacterRepository = gameCharacterRepository;
|
||||
this.gameCharacterSkillRepository = gameCharacterSkillRepository;
|
||||
}
|
||||
|
||||
@GetMapping("music")
|
||||
|
@ -26,4 +32,24 @@ public class ApiAmazonGameDataController {
|
|||
return gameMusicService.getAll();
|
||||
}
|
||||
|
||||
@GetMapping("character")
|
||||
public List<Character> getCharacter() {
|
||||
return gameCharacterRepository.findAll();
|
||||
}
|
||||
|
||||
@GetMapping("skill")
|
||||
public List<CharacterSkill> getSkill() {
|
||||
return gameCharacterSkillRepository.findAll();
|
||||
}
|
||||
|
||||
// @PostMapping("character")
|
||||
// public List<Character> importCharacter(@RequestBody List<Character> req) {
|
||||
// return gameCharacterRepository.saveAll(req);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("skill")
|
||||
// public List<CharacterSkill> importSkill(@RequestBody List<CharacterSkill> req) {
|
||||
// return gameCharacterSkillRepository.saveAll(req);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package icu.samnyan.aqua.sega.chunithm.dao.gamedata;
|
||||
|
||||
import icu.samnyan.aqua.sega.chunithm.model.gamedata.Character;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("ChuniGameCharacterRepository")
|
||||
public interface GameCharacterRepository extends JpaRepository<Character, Long> {
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package icu.samnyan.aqua.sega.chunithm.dao.gamedata;
|
||||
|
||||
import icu.samnyan.aqua.sega.chunithm.model.gamedata.CharacterSkill;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("ChuniGameCharacterSkillRepository")
|
||||
public interface GameCharacterSkillRepository extends JpaRepository<CharacterSkill, Long> {
|
||||
}
|
|
@ -7,6 +7,6 @@ import org.springframework.stereotype.Repository;
|
|||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository
|
||||
@Repository("ChuniGameChargeRepository")
|
||||
public interface GameChargeRepository extends JpaRepository<GameCharge, Long> {
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository
|
||||
@Repository("ChuniGameEventRepository")
|
||||
public interface GameEventRepository extends JpaRepository<GameEvent, Integer> {
|
||||
|
||||
List<GameEvent> findByEnable(boolean enable);
|
||||
|
|
|
@ -7,6 +7,6 @@ import org.springframework.stereotype.Repository;
|
|||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository
|
||||
@Repository("ChuniGameMessageRepository")
|
||||
public interface GameMessageRepository extends JpaRepository<GameMessage, Integer> {
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Optional;
|
|||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository
|
||||
@Repository("ChuniGameMusicRepository")
|
||||
public interface GameMusicRepository extends JpaRepository<Music, Long> {
|
||||
|
||||
Optional<Music> findByMusicId(int musicId);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue