[api] Add chuni character and skill to database

This commit is contained in:
samnyan
2020-03-31 00:59:11 +09:00
parent 91c0c3de2f
commit ed2732acad
9 changed files with 2560 additions and 8 deletions

View File

@@ -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);
// }
}