mirror of https://github.com/hykilpikonna/AquaDX
[+] Chusan artemis import
parent
38e94210e4
commit
4a7bf4b31e
|
@ -6,7 +6,7 @@ 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.ChuniDataExport;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external.Chu3DataExport;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external.ChuniDataImport;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external.ExternalUserData;
|
||||
import icu.samnyan.aqua.api.util.ApiMapper;
|
||||
|
@ -22,7 +22,6 @@ import lombok.AllArgsConstructor;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
@ -399,7 +398,7 @@ public class ApiChuniV2PlayerDataController {
|
|||
|
||||
@GetMapping("export")
|
||||
public ResponseEntity<Object> exportAllUserData(@RequestParam String aimeId) {
|
||||
ChuniDataExport data = new ChuniDataExport();
|
||||
Chu3DataExport data = new Chu3DataExport();
|
||||
try {
|
||||
data.setGameId("SDHD");
|
||||
data.setUserData(userDataService.getUserByExtId(aimeId).orElseThrow());
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external;
|
||||
|
||||
import icu.samnyan.aqua.sega.chusan.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class is use for exporting chusan profile
|
||||
* @author samnyan (publicamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Chu3DataExport {
|
||||
public String gameId = "SDHD";
|
||||
public UserData userData;
|
||||
public UserGameOption userGameOption;
|
||||
public List<UserActivity> userActivityList;
|
||||
public List<UserCharacter> userCharacterList;
|
||||
public List<UserCharge> userChargeList;
|
||||
public List<UserCourse> userCourseList;
|
||||
public List<UserDuel> userDuelList;
|
||||
public List<UserItem> userItemList;
|
||||
public List<UserMapArea> userMapList;
|
||||
public List<UserMusicDetail> userMusicDetailList;
|
||||
public List<UserPlaylog> userPlaylogList;
|
||||
public List<UserLoginBonus> userLoginBonusList;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external;
|
||||
|
||||
import icu.samnyan.aqua.sega.chusan.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class is use for exporting chusan profile
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ChuniDataExport {
|
||||
private String gameId = "SDHD";
|
||||
private UserData userData;
|
||||
private List<UserActivity> userActivityList;
|
||||
private List<UserCharacter> userCharacterList;
|
||||
private List<UserCharge> userChargeList;
|
||||
private List<UserCourse> userCourseList;
|
||||
private List<UserDuel> userDuelList;
|
||||
private UserGameOption userGameOption;
|
||||
private List<UserItem> userItemList;
|
||||
private List<UserMapArea> userMapList;
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
private List<UserPlaylog> userPlaylogList;
|
||||
}
|
|
@ -20,7 +20,7 @@ abstract class ImportController<T: Any>(
|
|||
|
||||
init {
|
||||
renameTable.values.forEach {
|
||||
if (it.name !in exportFields) error("Code error! Export fields incomplete")
|
||||
if (it.name !in exportFields) error("Code error! Export fields incomplete: missing ${it.name}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package icu.samnyan.aqua.net.games.chu3
|
||||
|
||||
import icu.samnyan.aqua.api.model.resp.sega.chuni.v2.external.Chu3DataExport
|
||||
import icu.samnyan.aqua.net.games.ImportClass
|
||||
import icu.samnyan.aqua.net.games.ImportController
|
||||
import icu.samnyan.aqua.sega.chusan.model.userdata.*
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.readText
|
||||
|
||||
|
||||
class Chu3Import : ImportController<Chu3DataExport>(
|
||||
exportFields = Chu3DataExport::class.java.declaredFields.associateBy {
|
||||
var name = it.name
|
||||
if (name == "userMapList") name = "userMapAreaList"
|
||||
name.replace("List", "").lowercase()
|
||||
},
|
||||
renameTable = mapOf(
|
||||
"chuni_item_character" to ImportClass(UserCharacter::class),
|
||||
"chuni_item_duel" to ImportClass(UserDuel::class),
|
||||
"chuni_item_item" to ImportClass(UserItem::class, mapOf("isValid" to "valid")),
|
||||
"chuni_item_login_bonus" to ImportClass(UserLoginBonus::class, mapOf("isWatched" to "watched")),
|
||||
"chuni_item_map_area" to ImportClass(UserMapArea::class),
|
||||
"chuni_profile_activity" to ImportClass(UserActivity::class, mapOf("activityId" to "id")),
|
||||
"chuni_profile_charge" to ImportClass(UserCharge::class),
|
||||
"chuni_profile_data" to ImportClass(UserData::class, mapOf("user" to null, "version" to null, "isNetMember" to null)),
|
||||
"chuni_profile_option" to ImportClass(UserGameOption::class, mapOf("version" to null)),
|
||||
"chuni_score_best" to ImportClass(UserMusicDetail::class),
|
||||
"chuni_score_playlog" to ImportClass(UserPlaylog::class),
|
||||
// "chuni_item_favorite" to ImportClass(UserFavorite::class),
|
||||
// "chuni_profile_emoney" to ImportClass(UserEmoney::class),
|
||||
// "chuni_profile_overpower" to ImportClass(UserOverpower::class),
|
||||
// "chuni_profile_recent_rating" to ImportClass(UserRecentRating::class),
|
||||
)
|
||||
) {
|
||||
override fun createEmpty() = Chu3DataExport("SDEZ", UserData(), UserGameOption(), ArrayList(), ArrayList(),
|
||||
ArrayList(), ArrayList(), ArrayList(), ArrayList(), ArrayList(), ArrayList(), ArrayList(), ArrayList())
|
||||
}
|
||||
|
||||
fun main() {
|
||||
Chu3Import().importArtemisSql(Path("C:\\Users\\Azalea\\Downloads\\all_inserts (2).sql").readText())
|
||||
}
|
Loading…
Reference in New Issue