From 073febe24a388d98e722a6191b80bf5fd5171e7a Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:09:26 -0500 Subject: [PATCH] [+] Remove classes, migration guide --- docs/api-v2.md | 10 +++ .../v2/ApiChuniV2GameDataController.java | 72 --------------- .../v2/ApiChuniV2PlayerDataController.java | 19 ---- .../model/resp/sega/chuni/v2/ProfileResp.java | 88 ------------------- 4 files changed, 10 insertions(+), 179 deletions(-) delete mode 100644 src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2GameDataController.java delete mode 100644 src/main/java/icu/samnyan/aqua/api/model/resp/sega/chuni/v2/ProfileResp.java diff --git a/docs/api-v2.md b/docs/api-v2.md index c265081c..8589b3a3 100644 --- a/docs/api-v2.md +++ b/docs/api-v2.md @@ -91,3 +91,13 @@ Located at: [icu.samnyan.aqua.net.UserRegistrar](icu/samnyan/aqua/net/UserRegist * token: String * file: MultipartFile * **Returns**: Success message + +# Migration + +### Chuni / Chusan + +GET /api/game/chuni/v2/profile > /api/v2/chu3/user-box +GET /api/game/chuni/v2/data > /api/v2/chu3/user-box-all-items + + + diff --git a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2GameDataController.java b/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2GameDataController.java deleted file mode 100644 index 03c890d2..00000000 --- a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2GameDataController.java +++ /dev/null @@ -1,72 +0,0 @@ -package icu.samnyan.aqua.api.controller.sega.game.chuni.v2; - -import icu.samnyan.aqua.sega.chusan.model.*; -import icu.samnyan.aqua.sega.chusan.model.gamedata.Character; -import icu.samnyan.aqua.sega.chusan.model.gamedata.*; -import lombok.AllArgsConstructor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @author samnyan (privateamusement@protonmail.com) - */ -@RestController -@RequestMapping("api/game/chuni/v2/data") -@ConditionalOnProperty(prefix = "aquaviewer.api", name = "enabled", havingValue = "true") -@AllArgsConstructor -public class ApiChuniV2GameDataController { - - private final Chu3GameMusicRepo gameMusicRepository; - private final Chu3GameCharacterRepo gameCharacterRepository; - private final Chu3GameTrophyRepo gameTrophyRepository; - private final Chu3GameNamePlateRepo gameNamePlateRepository; - private final Chu3GameSystemVoiceRepo gameSystemVoiceRepository; - private final Chu3GameMapIconRepo gameMapIconRepository; - private final Chu3GameFrameRepo gameFrameRepository; - private final Chu3GameAvatarAccRepo gameAvatarAccRepository; - - @GetMapping("music") - public List getMusic() { - return gameMusicRepository.findAll(); - } - - @GetMapping("character") - public List getCharacter() { - return gameCharacterRepository.findAll(); - } - - @GetMapping("trophy") - public List getTrophy() { - return gameTrophyRepository.findAll(); - } - - @GetMapping("nameplate") - public List getNamePlate() { - return gameNamePlateRepository.findAll(); - } - - @GetMapping("sysvoice") - public List getSystemVoice() { - return gameSystemVoiceRepository.findAll(); - } - - @GetMapping("mapicon") - public List getMapIcon() { - return gameMapIconRepository.findAll(); - } - - @GetMapping("frame") - public List getFrame() { - return gameFrameRepository.findAll(); - } - - @GetMapping("avatar") - public List getAvatarAcc() { - return gameAvatarAccRepository.findAll(); - } - -} diff --git a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2PlayerDataController.java b/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2PlayerDataController.java index b7f79d56..cd1d1de0 100644 --- a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2PlayerDataController.java +++ b/src/main/java/icu/samnyan/aqua/api/controller/sega/game/chuni/v2/ApiChuniV2PlayerDataController.java @@ -3,7 +3,6 @@ package icu.samnyan.aqua.api.controller.sega.game.chuni.v2; import com.fasterxml.jackson.core.type.TypeReference; import icu.samnyan.aqua.api.model.MessageResponse; import icu.samnyan.aqua.api.model.ReducedPageResponse; -import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.ProfileResp; import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.RatingItem; import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.RecentResp; import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external.Chu3DataExport; @@ -64,24 +63,6 @@ public class ApiChuniV2PlayerDataController { private final UserGeneralDataService userGeneralDataService; private final GameMusicService gameMusicService; - /** - * Get Basic info - * - * @return - */ - @GetMapping("profile") - public ProfileResp getProfile(@RequestParam String aimeId) { - ProfileResp resp = mapper.convert(userDataService.getUserByExtId(aimeId).orElseThrow(), new TypeReference<>() { - }); - UserCourse course = userCourseService.getByUserId(aimeId) - .stream() - .filter(UserCourse::isClear) - .max(Comparator.comparingInt(UserCourse::getClassId)) - .orElseGet(() -> new UserCourse(0)); - resp.setCourseClass(course.getClassId()); - return resp; - } - @PutMapping("profile/username") public Chu3UserData updateName(@RequestBody Map request) { Chu3UserData profile = userDataService.getUserByExtId((String) request.get("aimeId")).orElseThrow(); diff --git a/src/main/java/icu/samnyan/aqua/api/model/resp/sega/chuni/v2/ProfileResp.java b/src/main/java/icu/samnyan/aqua/api/model/resp/sega/chuni/v2/ProfileResp.java deleted file mode 100644 index 2814ca9c..00000000 --- a/src/main/java/icu/samnyan/aqua/api/model/resp/sega/chuni/v2/ProfileResp.java +++ /dev/null @@ -1,88 +0,0 @@ -package icu.samnyan.aqua.api.model.resp.sega.chuni.v2; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; - -/** - * @author samnyan (privateamusement@protonmail.com) - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ProfileResp { - - private String userName; - - private int level; - - private String exp; - - private long point; - - private long totalPoint; - - private int playCount; - - private int playerRating; - - private int highestRating; - - private int nameplateId; - - private int frameId; - - private int characterId; - - private int trophyId; - - private int totalMapNum; - - private long totalHiScore; - - private long totalBasicHighScore; - - private long totalAdvancedHighScore; - - private long totalExpertHighScore; - - private long totalMasterHighScore; - - private long totalUltimaHighScore; - - private int friendCount; - - private LocalDateTime firstPlayDate; - - private LocalDateTime lastPlayDate; - - private String lastRomVersion; - - private String lastDataVersion; - - private int courseClass; - - private int overPowerPoint; - - private int overPowerRate; - - private int mapIconId; - - private int voiceId; - - private int avatarWear; - - private int avatarHead; - - private int avatarFace; - - private int avatarSkin; - - private int avatarItem; - - private int avatarFront; - - private int avatarBack; -}