mirror of https://github.com/hykilpikonna/AquaDX
[api] Add maimai2 API
parent
8cb5211ed0
commit
8ab972c5b3
|
@ -0,0 +1,339 @@
|
|||
package icu.samnyan.aqua.api.controller.sega.game.maimai2;
|
||||
|
||||
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.maimai2.ProfileResp;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.maimai2.external.ExternalUserData;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.maimai2.external.Maimai2DataExport;
|
||||
import icu.samnyan.aqua.api.model.resp.sega.maimai2.external.Maimai2DataImport;
|
||||
import icu.samnyan.aqua.api.util.ApiMapper;
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.general.service.CardService;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.*;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/game/maimai2")
|
||||
public class ApiMaimai2PlayerDataController {
|
||||
|
||||
private final ApiMapper mapper;
|
||||
|
||||
private static DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.0");
|
||||
|
||||
private final CardService cardService;
|
||||
|
||||
private final UserActRepository userActRepository;
|
||||
private final UserCharacterRepository userCharacterRepository;
|
||||
private final UserDataRepository userDataRepository;
|
||||
private final UserItemRepository userItemRepository;
|
||||
private final UserLoginBonusRepository userLoginBonusRepository;
|
||||
private final UserMusicDetailRepository userMusicDetailRepository;
|
||||
private final UserOptionRepository userOptionRepository;
|
||||
private final UserPlaylogRepository userPlaylogRepository;
|
||||
private final UserGeneralDataRepository userGeneralDataRepository;
|
||||
private final MapEncountNpcRepository mapEncountNpcRepository;
|
||||
private final UserChargeRepository userChargeRepository;
|
||||
private final UserCourseRepository userCourseRepository;
|
||||
private final UserExtendRepository userExtendRepository;
|
||||
private final UserFavoriteRepository userFavoriteRepository;
|
||||
private final UserFriendSeasonRankingRepository userFriendSeasonRankingRepository;
|
||||
private final UserMapRepository userMapRepository;
|
||||
private final UserUdemaeRepository userUdemaeRepository;
|
||||
|
||||
public ApiMaimai2PlayerDataController(ApiMapper mapper, CardService cardService, UserActRepository userActRepository,
|
||||
UserCharacterRepository userCharacterRepository, UserDataRepository userDataRepository, UserItemRepository userItemRepository,
|
||||
UserLoginBonusRepository userLoginBonusRepository, UserMusicDetailRepository userMusicDetailRepository, UserOptionRepository userOptionRepository,
|
||||
UserPlaylogRepository userPlaylogRepository, UserGeneralDataRepository userGeneralDataRepository, MapEncountNpcRepository mapEncountNpcRepository,
|
||||
UserChargeRepository userChargeRepository, UserCourseRepository userCourseRepository, UserExtendRepository userExtendRepository,
|
||||
UserFavoriteRepository userFavoriteRepository, UserFriendSeasonRankingRepository userFriendSeasonRankingRepository, UserMapRepository userMapRepository,
|
||||
UserUdemaeRepository userUdemaeRepository) {
|
||||
this.mapper = mapper;
|
||||
this.cardService = cardService;
|
||||
this.userActRepository = userActRepository;
|
||||
this.userCharacterRepository = userCharacterRepository;
|
||||
this.userDataRepository = userDataRepository;
|
||||
this.userItemRepository = userItemRepository;
|
||||
this.userLoginBonusRepository = userLoginBonusRepository;
|
||||
this.userMusicDetailRepository = userMusicDetailRepository;
|
||||
this.userOptionRepository = userOptionRepository;
|
||||
this.userPlaylogRepository = userPlaylogRepository;
|
||||
this.userGeneralDataRepository = userGeneralDataRepository;
|
||||
this.mapEncountNpcRepository = mapEncountNpcRepository;
|
||||
this.userChargeRepository = userChargeRepository;
|
||||
this.userCourseRepository = userCourseRepository;
|
||||
this.userExtendRepository = userExtendRepository;
|
||||
this.userFavoriteRepository = userFavoriteRepository;
|
||||
this.userFriendSeasonRankingRepository = userFriendSeasonRankingRepository;
|
||||
this.userMapRepository = userMapRepository;
|
||||
this.userUdemaeRepository = userUdemaeRepository;
|
||||
}
|
||||
|
||||
@GetMapping("profile")
|
||||
public ProfileResp getProfile(@RequestParam long aimeId) {
|
||||
return mapper.convert(userDataRepository.findByCard_ExtId(aimeId).orElseThrow(), new TypeReference<>() {
|
||||
});
|
||||
}
|
||||
|
||||
@PostMapping("profile/username")
|
||||
public UserDetail updateName(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setUserName((String) request.get("userName"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/icon")
|
||||
public UserDetail updateIcon(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setIconId((Integer) request.get("iconId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/plate")
|
||||
public UserDetail updatePlate(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setPlateId((Integer) request.get("plateId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/frame")
|
||||
public UserDetail updateFrame(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setFrameId((Integer) request.get("frameId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/title")
|
||||
public UserDetail updateTrophy(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setTitleId((Integer) request.get("titleId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/partner")
|
||||
public UserDetail updatePartner(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setPartnerId((Integer) request.get("partnerId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@GetMapping("character")
|
||||
public ReducedPageResponse<UserCharacter> getCharacter(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserCharacter> characters = userCharacterRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size));
|
||||
return new ReducedPageResponse<>(characters.getContent(), characters.getPageable().getPageNumber(), characters.getTotalPages(), characters.getTotalElements());
|
||||
}
|
||||
|
||||
@GetMapping("activity")
|
||||
public List<UserAct> getActivities(@RequestParam long aimeId) {
|
||||
return userActRepository.findByUser_Card_ExtId(aimeId);
|
||||
}
|
||||
|
||||
@GetMapping("item")
|
||||
public ReducedPageResponse<UserItem> getItem(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserItem> items = userItemRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size));
|
||||
return new ReducedPageResponse<>(items.getContent(), items.getPageable().getPageNumber(), items.getTotalPages(), items.getTotalElements());
|
||||
}
|
||||
|
||||
@PostMapping("item")
|
||||
public ResponseEntity<Object> updateItem(@RequestBody Map<String, Object> request) {
|
||||
UserDetail profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
Integer itemKind = (Integer) request.get("itemKind");
|
||||
Integer itemId = (Integer) request.get("itemId");
|
||||
int stock = 1;
|
||||
if (request.containsKey("stock")) {
|
||||
stock = (Integer) request.get("stock");
|
||||
}
|
||||
|
||||
Optional<UserItem> userItemOptional = userItemRepository.findByUserAndItemKindAndItemId(profile, itemKind, itemId);
|
||||
|
||||
UserItem userItem;
|
||||
if (userItemOptional.isPresent()) {
|
||||
userItem = userItemOptional.get();
|
||||
} else {
|
||||
userItem = new UserItem(profile);
|
||||
userItem.setItemId(itemId);
|
||||
userItem.setItemKind(itemKind);
|
||||
}
|
||||
userItem.setStock(stock);
|
||||
userItem.setValid(true);
|
||||
return ResponseEntity.ok(userItemRepository.save(userItem));
|
||||
}
|
||||
|
||||
@GetMapping("recent")
|
||||
public ReducedPageResponse<UserPlaylog> getRecent(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserPlaylog> playlogs = userPlaylogRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size, Sort.Direction.DESC, "id"));
|
||||
return new ReducedPageResponse<>(playlogs.getContent(), playlogs.getPageable().getPageNumber(), playlogs.getTotalPages(), playlogs.getTotalElements());
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("song/{id}")
|
||||
public List<UserMusicDetail> getSongDetail(@RequestParam long aimeId, @PathVariable int id) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(aimeId, id);
|
||||
}
|
||||
|
||||
@GetMapping("song/{id}/{level}")
|
||||
public List<UserPlaylog> getLevelPlaylog(@RequestParam long aimeId, @PathVariable int id, @PathVariable int level) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(aimeId, id, level);
|
||||
}
|
||||
|
||||
@GetMapping("options")
|
||||
public UserOption getOptions(@RequestParam long aimeId) {
|
||||
return userOptionRepository.findByUser_Card_ExtId(aimeId).orElseThrow();
|
||||
}
|
||||
|
||||
@GetMapping("general")
|
||||
public ResponseEntity<Object> getGeneralData(@RequestParam long aimeId, @RequestParam String key) {
|
||||
Optional<UserGeneralData> userGeneralDataOptional = userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(aimeId, key);
|
||||
return userGeneralDataOptional.<ResponseEntity<Object>>map(ResponseEntity::ok)
|
||||
.orElseGet(() -> ResponseEntity.status(HttpStatus.NOT_FOUND).body(new MessageResponse("User or value not found.")));
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
public ResponseEntity<Object> exportAllUserData(@RequestParam long aimeId) {
|
||||
Maimai2DataExport data = new Maimai2DataExport();
|
||||
try {
|
||||
data.setGameId("SDEZ");
|
||||
data.setUserData(userDataRepository.findByCard_ExtId(aimeId).orElseThrow());
|
||||
data.setUserExtend(userExtendRepository.findByUser_Card_ExtId(aimeId).orElseThrow());
|
||||
data.setUserOption(userOptionRepository.findByUser_Card_ExtId(aimeId).orElseThrow());
|
||||
data.setUserUdemae(userUdemaeRepository.findByUser_Card_ExtId(aimeId).orElseThrow());
|
||||
data.setUserCharacterList(userCharacterRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserGeneralDataList(userGeneralDataRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserItemList(userItemRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserLoginBonusList(userLoginBonusRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserMusicDetailList(userMusicDetailRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserPlaylogList(userPlaylogRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setMapEncountNpcList(mapEncountNpcRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserActList(userActRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserChargeList(userChargeRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserCourseList(userCourseRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserFavoriteList(userFavoriteRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserFriendSeasonRankingList(userFriendSeasonRankingRepository.findByUser_Card_ExtId(aimeId));
|
||||
data.setUserMapList(userMapRepository.findByUser_Card_ExtId(aimeId));
|
||||
} catch (NoSuchElementException e) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
.body(new MessageResponse("User not found"));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
.body(new MessageResponse("Error during data export. Reason: " + e.getMessage()));
|
||||
}
|
||||
// Set filename
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("content-disposition", "attachment; filename=maimai2_" + aimeId + "_exported.json");
|
||||
return new ResponseEntity<>(data, headers, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("import")
|
||||
public ResponseEntity<Object> importAllUserData(@RequestBody Maimai2DataImport data) {
|
||||
if (!data.getGameId().equals("SDEZ")) {
|
||||
return ResponseEntity.unprocessableEntity().body(new MessageResponse("Wrong Game Profile, Expected 'SDEZ', Get " + data.getGameId()));
|
||||
}
|
||||
|
||||
ExternalUserData exUser = data.getUserData();
|
||||
|
||||
Optional<Card> cardOptional = cardService.getCardByAccessCode(exUser.getAccessCode());
|
||||
Card card;
|
||||
if (cardOptional.isPresent()) {
|
||||
card = cardOptional.get();
|
||||
Optional<UserDetail> existUserData = userDataRepository.findByCard(cardOptional.get());
|
||||
if (existUserData.isPresent()) {
|
||||
// return ResponseEntity.status(HttpStatus.BAD_REQUEST)
|
||||
// .body(new MessageResponse("This card already has a maimai2 profile."));
|
||||
// delete all same card data
|
||||
userFavoriteRepository.deleteByUser(existUserData.get());
|
||||
userFavoriteRepository.flush();
|
||||
userFriendSeasonRankingRepository.deleteByUser(existUserData.get());
|
||||
userFriendSeasonRankingRepository.flush();
|
||||
userMapRepository.deleteByUser(existUserData.get());
|
||||
userMapRepository.flush();
|
||||
userUdemaeRepository.deleteByUser(existUserData.get());
|
||||
userUdemaeRepository.flush();
|
||||
userGeneralDataRepository.deleteByUser(existUserData.get());
|
||||
userGeneralDataRepository.flush();
|
||||
userItemRepository.deleteByUser(existUserData.get());
|
||||
userItemRepository.flush();
|
||||
userLoginBonusRepository.deleteByUser(existUserData.get());
|
||||
userLoginBonusRepository.flush();
|
||||
userMusicDetailRepository.deleteByUser(existUserData.get());
|
||||
userMusicDetailRepository.flush();
|
||||
userOptionRepository.deleteByUser(existUserData.get());
|
||||
userOptionRepository.flush();
|
||||
userPlaylogRepository.deleteByUser(existUserData.get());
|
||||
userPlaylogRepository.flush();
|
||||
userCharacterRepository.deleteByUser(existUserData.get());
|
||||
userCharacterRepository.flush();
|
||||
mapEncountNpcRepository.deleteByUser(existUserData.get());
|
||||
mapEncountNpcRepository.flush();
|
||||
userActRepository.deleteByUser(existUserData.get());
|
||||
userActRepository.flush();
|
||||
userChargeRepository.deleteByUser(existUserData.get());
|
||||
userChargeRepository.flush();
|
||||
userCourseRepository.deleteByUser(existUserData.get());
|
||||
userCourseRepository.flush();
|
||||
userExtendRepository.deleteByUser(existUserData.get());
|
||||
userExtendRepository.flush();
|
||||
userOptionRepository.deleteByUser(existUserData.get());
|
||||
userOptionRepository.flush();
|
||||
|
||||
userDataRepository.deleteByCard(card);
|
||||
userDataRepository.flush();
|
||||
}
|
||||
} else {
|
||||
card = cardService.registerByAccessCode(exUser.getAccessCode());
|
||||
}
|
||||
|
||||
UserDetail userData = mapper.convert(exUser, new TypeReference<>() {
|
||||
});
|
||||
userData.setCard(card);
|
||||
userDataRepository.saveAndFlush(userData);
|
||||
|
||||
userFavoriteRepository.saveAll(data.getUserFavoriteList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userFriendSeasonRankingRepository.saveAll(data.getUserFriendSeasonRankingList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userMapRepository.saveAll(data.getUserMapList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userGeneralDataRepository.saveAll(data.getUserGeneralDataList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userItemRepository.saveAll(data.getUserItemList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userLoginBonusRepository.saveAll(data.getUserLoginBonusList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userMusicDetailRepository.saveAll(data.getUserMusicDetailList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userPlaylogRepository.saveAll(data.getUserPlaylogList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userCharacterRepository.saveAll(data.getUserCharacterList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
mapEncountNpcRepository.saveAll(data.getMapEncountNpcList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userActRepository.saveAll(data.getUserActList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userChargeRepository.saveAll(data.getUserChargeList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
userCourseRepository.saveAll(data.getUserCourseList().stream().peek(x -> x.setUser(userData)).collect(Collectors.toList()));
|
||||
|
||||
UserExtend userExtend = data.getUserExtend();
|
||||
userExtend.setUser(userData);
|
||||
userExtendRepository.save(userExtend);
|
||||
|
||||
UserOption userOption = data.getUserOption();
|
||||
userOption.setUser(userData);
|
||||
userOptionRepository.save(userOption);
|
||||
|
||||
UserUdemae userUdemae = data.getUserUdemae();
|
||||
userUdemae.setUser(userData);
|
||||
userUdemaeRepository.save(userUdemae);
|
||||
|
||||
return ResponseEntity.ok(new MessageResponse("Import successfully, aimeId: " + card.getExtId()));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.maimai2;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProfileResp {
|
||||
|
||||
private String userName;
|
||||
private int iconId;
|
||||
private int plateId;
|
||||
private int titleId;
|
||||
private int partnerId;
|
||||
private int frameId;
|
||||
private int selectMapId;
|
||||
private int totalAwake;
|
||||
private int gradeRating;
|
||||
private int musicRating;
|
||||
private int playerRating;
|
||||
private int highestRating;
|
||||
private int gradeRank;
|
||||
private int classRank;
|
||||
private int courseRank;
|
||||
private List<Integer> charaSlot;
|
||||
private List<Integer> charaLockSlot;
|
||||
private int playCount;
|
||||
private String eventWatchedDate;
|
||||
private String lastRomVersion;
|
||||
private String lastDataVersion;
|
||||
private String lastPlayDate;
|
||||
private int playVsCount;
|
||||
private int playSyncCount;
|
||||
private int winCount;
|
||||
private int helpCount;
|
||||
private int comboCount;
|
||||
private long totalDeluxscore;
|
||||
private long totalBasicDeluxscore;
|
||||
private long totalAdvancedDeluxscore;
|
||||
private long totalExpertDeluxscore;
|
||||
private long totalMasterDeluxscore;
|
||||
private long totalReMasterDeluxscore;
|
||||
private int totalSync;
|
||||
private int totalBasicSync;
|
||||
private int totalAdvancedSync;
|
||||
private int totalExpertSync;
|
||||
private int totalMasterSync;
|
||||
private int totalReMasterSync;
|
||||
private long totalAchievement;
|
||||
private long totalBasicAchievement;
|
||||
private long totalAdvancedAchievement;
|
||||
private long totalExpertAchievement;
|
||||
private long totalMasterAchievement;
|
||||
private long totalReMasterAchievement;
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.maimai2.external;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExternalUserData implements Serializable {
|
||||
|
||||
private String accessCode;
|
||||
private String userName;
|
||||
private int isNetMember;
|
||||
private int iconId;
|
||||
private int plateId;
|
||||
private int titleId;
|
||||
private int partnerId;
|
||||
private int frameId;
|
||||
private int selectMapId;
|
||||
private int totalAwake;
|
||||
private int gradeRating;
|
||||
private int musicRating;
|
||||
private int playerRating;
|
||||
private int highestRating;
|
||||
private int gradeRank;
|
||||
private int classRank;
|
||||
private int courseRank;
|
||||
private List<Integer> charaSlot;
|
||||
private List<Integer> charaLockSlot;
|
||||
private long contentBit;
|
||||
private int playCount;
|
||||
private String eventWatchedDate;
|
||||
private String lastGameId;
|
||||
private String lastRomVersion;
|
||||
private String lastDataVersion;
|
||||
private String lastLoginDate;
|
||||
private String lastPlayDate;
|
||||
private int lastPlayCredit;
|
||||
private int lastPlayMode;
|
||||
private int lastPlaceId;
|
||||
private String lastPlaceName;
|
||||
private int lastAllNetId;
|
||||
private int lastRegionId;
|
||||
private String lastRegionName;
|
||||
private String lastClientId;
|
||||
private String lastCountryCode;
|
||||
private int lastSelectEMoney;
|
||||
private int lastSelectTicket;
|
||||
private int lastSelectCourse;
|
||||
private int lastCountCourse;
|
||||
private String firstGameId;
|
||||
private String firstRomVersion;
|
||||
private String firstDataVersion;
|
||||
private String firstPlayDate;
|
||||
private String compatibleCmVersion;
|
||||
private String dailyBonusDate;
|
||||
private String dailyCourseBonusDate;
|
||||
private String lastPairLoginDate;
|
||||
private String lastTrialPlayDate;
|
||||
private int playVsCount;
|
||||
private int playSyncCount;
|
||||
private int winCount;
|
||||
private int helpCount;
|
||||
private int comboCount;
|
||||
private long totalDeluxscore;
|
||||
private long totalBasicDeluxscore;
|
||||
private long totalAdvancedDeluxscore;
|
||||
private long totalExpertDeluxscore;
|
||||
private long totalMasterDeluxscore;
|
||||
private long totalReMasterDeluxscore;
|
||||
private int totalSync;
|
||||
private int totalBasicSync;
|
||||
private int totalAdvancedSync;
|
||||
private int totalExpertSync;
|
||||
private int totalMasterSync;
|
||||
private int totalReMasterSync;
|
||||
private long totalAchievement;
|
||||
private long totalBasicAchievement;
|
||||
private long totalAdvancedAchievement;
|
||||
private long totalExpertAchievement;
|
||||
private long totalMasterAchievement;
|
||||
private long totalReMasterAchievement;
|
||||
private long playerOldRating;
|
||||
private long playerNewRating;
|
||||
private int banState;
|
||||
private long dateTime;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.maimai2.external;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Maimai2DataExport {
|
||||
private String gameId = "SDEZ";
|
||||
private UserDetail userData;
|
||||
private UserExtend userExtend;
|
||||
private UserOption userOption;
|
||||
private List<MapEncountNpc> mapEncountNpcList;
|
||||
private List<UserAct> userActList;
|
||||
private List<UserCharacter> userCharacterList;
|
||||
private List<UserCharge> userChargeList;
|
||||
private List<UserCourse> userCourseList;
|
||||
private List<UserFavorite> userFavoriteList;
|
||||
private List<UserFriendSeasonRanking> userFriendSeasonRankingList;
|
||||
private List<UserGeneralData> userGeneralDataList;
|
||||
private List<UserGhost> userGhostList;
|
||||
private List<UserItem> userItemList;
|
||||
private List<UserLoginBonus> userLoginBonusList;
|
||||
private List<UserMap> userMapList;
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
private List<UserPlaylog> userPlaylogList;
|
||||
private List<UserRate> userRateList;
|
||||
private UserUdemae userUdemae;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package icu.samnyan.aqua.api.model.resp.sega.maimai2.external;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Maimai2DataImport {
|
||||
private String gameId;
|
||||
private ExternalUserData userData;
|
||||
private UserExtend userExtend;
|
||||
private UserOption userOption;
|
||||
private List<MapEncountNpc> mapEncountNpcList;
|
||||
private List<UserAct> userActList;
|
||||
private List<UserCharacter> userCharacterList;
|
||||
private List<UserCharge> userChargeList;
|
||||
private List<UserCourse> userCourseList;
|
||||
private List<UserFavorite> userFavoriteList;
|
||||
private List<UserFriendSeasonRanking> userFriendSeasonRankingList;
|
||||
private List<UserGeneralData> userGeneralDataList;
|
||||
private List<UserGhost> userGhostList;
|
||||
private List<UserItem> userItemList;
|
||||
private List<UserLoginBonus> userLoginBonusList;
|
||||
private List<UserMap> userMapList;
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
private List<UserPlaylog> userPlaylogList;
|
||||
private List<UserRate> userRateList;
|
||||
private UserUdemae userUdemae;
|
||||
}
|
|
@ -3,21 +3,28 @@ package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.MapEncountNpc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2MapEncountNpcRepository")
|
||||
public interface MapEncountNpcRepository extends JpaRepository<MapEncountNpc, Long> {
|
||||
|
||||
List<MapEncountNpc> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<MapEncountNpc> findByUserAndMusicId(UserDetail user, int musicId);
|
||||
|
||||
Page<MapEncountNpc> findByUser_Card_ExtIdAndMusicId(long userId, int musicId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserAct;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -14,7 +15,13 @@ import java.util.Optional;
|
|||
@Repository("Maimai2UserActRepository")
|
||||
public interface UserActRepository extends JpaRepository<UserAct, Long> {
|
||||
|
||||
List<UserAct> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserAct> findByUserAndKindAndActivityId(UserDetail user, int kind, int id);
|
||||
|
||||
List<UserAct> findByUser_Card_ExtIdAndKind(long userId, int kind);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,8 +2,12 @@ package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
|||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -16,6 +20,11 @@ public interface UserCharacterRepository extends JpaRepository<UserCharacter, Lo
|
|||
|
||||
List<UserCharacter> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserCharacter> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
Optional<UserCharacter> findByUserAndCharacterId(UserDetail user, int characterId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserCharge;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -16,4 +17,7 @@ public interface UserChargeRepository extends JpaRepository<UserCharge, Long> {
|
|||
List<UserCharge> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserCharge> findByUserAndChargeId(UserDetail extId, int chargeId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ import org.springframework.data.domain.Page;
|
|||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -16,7 +18,12 @@ import java.util.Optional;
|
|||
@Repository("Maimai2UserCourseRepository")
|
||||
public interface UserCourseRepository extends JpaRepository<UserCourse, Long> {
|
||||
|
||||
List<UserCourse> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserCourse> findByUserAndCourseId(UserDetail user, int courseId);
|
||||
|
||||
Page<UserCourse> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -11,5 +13,11 @@ import java.util.Optional;
|
|||
*/
|
||||
@Repository("Maimai2UserDataRepository")
|
||||
public interface UserDataRepository extends JpaRepository<UserDetail, Long> {
|
||||
|
||||
Optional<UserDetail> findByCard(Card card);
|
||||
|
||||
Optional<UserDetail> findByCard_ExtId(long userId);
|
||||
|
||||
@Transactional
|
||||
void deleteByCard(Card card);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserExtend;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -16,4 +17,7 @@ public interface UserExtendRepository extends JpaRepository<UserExtend, Long> {
|
|||
Optional<UserExtend> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserExtend> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserFavorite;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -14,8 +15,13 @@ import java.util.Optional;
|
|||
@Repository("Maimai2UserFavoriteRepository")
|
||||
public interface UserFavoriteRepository extends JpaRepository<UserFavorite, Long> {
|
||||
|
||||
List<UserFavorite> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserFavorite> findByUserAndItemKind(UserDetail user, int kind);
|
||||
//Optional<UserFavorite> findByUserIdAndItemKind(long userId, int kind);
|
||||
|
||||
List<UserFavorite> findByUserIdAndItemKind(long userId, int kind);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ import org.springframework.data.domain.Page;
|
|||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -16,7 +18,12 @@ import java.util.Optional;
|
|||
@Repository("Maimai2UserFriendSeasonRankingRepository")
|
||||
public interface UserFriendSeasonRankingRepository extends JpaRepository<UserFriendSeasonRanking, Long> {
|
||||
|
||||
List<UserFriendSeasonRanking> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserFriendSeasonRanking> findByUserAndSeasonId(UserDetail user, int seasonId);
|
||||
|
||||
Page<UserFriendSeasonRanking> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,14 @@ package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserItem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
|
@ -16,8 +18,15 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository("Maimai2UserItemRepository")
|
||||
public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
List<UserItem> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
Optional<UserItem> findByUserAndItemKindAndItemId(UserDetail user, int itemKind, int itemId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtIdAndItemKind(long userId, int kind, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,14 @@ package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserLoginBonus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
|
@ -16,8 +18,13 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository("Maimai2UserLoginBonusRepository")
|
||||
public interface UserLoginBonusRepository extends JpaRepository<UserLoginBonus, Long> {
|
||||
|
||||
List<UserLoginBonus> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserLoginBonus> findByUserAndBonusId(UserDetail user, int bonusId);
|
||||
|
||||
Page<UserLoginBonus> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,14 @@ package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
|
@ -16,8 +18,13 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository("Maimai2UserMapRepository")
|
||||
public interface UserMapRepository extends JpaRepository<UserMap, Long> {
|
||||
|
||||
List<UserMap> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserMap> findByUserAndMapId(UserDetail user, int mapId);
|
||||
|
||||
Page<UserMap> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ import org.springframework.data.domain.Page;
|
|||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -16,7 +18,15 @@ import java.util.Optional;
|
|||
@Repository("Maimai2UserMusicDetailRepository")
|
||||
public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail, Long> {
|
||||
|
||||
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserDetail user, int musicId, int level);
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(long userId, int id);
|
||||
|
||||
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserDetail user, int musicId, int level);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserOption;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -16,4 +17,7 @@ public interface UserOptionRepository extends JpaRepository<UserOption, Long> {
|
|||
Optional<UserOption> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserOption> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserPlaylog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
|
@ -10,4 +17,13 @@ import org.springframework.stereotype.Repository;
|
|||
@Repository("Maimai2UserPlaylogRepository")
|
||||
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(long userId, int musicId, int level);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
|||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserUdemae;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -16,4 +17,7 @@ public interface UserUdemaeRepository extends JpaRepository<UserUdemae, Long> {
|
|||
Optional<UserUdemae> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserUdemae> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserDetail user);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue