mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-10 06:27:26 +08:00
[O] Java > kt
This commit is contained in:
@@ -8,7 +8,7 @@ import icu.samnyan.aqua.sega.chusan.model.request.UserCMissionResp
|
|||||||
import icu.samnyan.aqua.sega.chusan.model.userdata.Chu3UserItem
|
import icu.samnyan.aqua.sega.chusan.model.userdata.Chu3UserItem
|
||||||
import icu.samnyan.aqua.sega.chusan.model.userdata.UserMusicDetail
|
import icu.samnyan.aqua.sega.chusan.model.userdata.UserMusicDetail
|
||||||
import icu.samnyan.aqua.sega.general.model.CardStatus
|
import icu.samnyan.aqua.sega.general.model.CardStatus
|
||||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating
|
import icu.samnyan.aqua.sega.general.model.UserRecentRating
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ext.*
|
|||||||
import icu.samnyan.aqua.sega.chusan.ChusanController
|
import icu.samnyan.aqua.sega.chusan.ChusanController
|
||||||
import icu.samnyan.aqua.sega.chusan.model.request.Chu3UserAll
|
import icu.samnyan.aqua.sega.chusan.model.request.Chu3UserAll
|
||||||
import icu.samnyan.aqua.sega.chusan.model.userdata.*
|
import icu.samnyan.aqua.sega.chusan.model.userdata.*
|
||||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating
|
import icu.samnyan.aqua.sega.general.model.UserRecentRating
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
fun ChusanController.upsertApiInit() {
|
fun ChusanController.upsertApiInit() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package icu.samnyan.aqua.sega.chusan.model.request
|
|||||||
|
|
||||||
import ext.JDict
|
import ext.JDict
|
||||||
import icu.samnyan.aqua.sega.chusan.model.userdata.*
|
import icu.samnyan.aqua.sega.chusan.model.userdata.*
|
||||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating
|
import icu.samnyan.aqua.sega.general.model.UserRecentRating
|
||||||
|
|
||||||
class UserCMissionResp {
|
class UserCMissionResp {
|
||||||
var missionId = 0
|
var missionId = 0
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.dao;
|
|
||||||
|
|
||||||
import icu.samnyan.aqua.sega.general.model.Card;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Repository("SegaCardRepository")
|
|
||||||
public interface CardRepository extends JpaRepository<Card, Long> {
|
|
||||||
|
|
||||||
Optional<Card> findByExtId(Long extId);
|
|
||||||
|
|
||||||
Optional<Card> findByLuid(String luid);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package icu.samnyan.aqua.sega.general.dao
|
||||||
|
|
||||||
|
import icu.samnyan.aqua.sega.general.model.Card
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
|
import org.springframework.stereotype.Repository
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
|
*/
|
||||||
|
@Repository("SegaCardRepository")
|
||||||
|
interface CardRepository : JpaRepository<Card, Long> {
|
||||||
|
fun findByExtId(extId: Long): Optional<Card>
|
||||||
|
fun findByLuid(luid: String): Optional<Card>
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.dao;
|
|
||||||
|
|
||||||
import icu.samnyan.aqua.sega.general.model.GameVersion;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Repository("GameVersionRepository")
|
|
||||||
public interface GameVersionRepository extends JpaRepository<GameVersion, String> {
|
|
||||||
Optional<GameVersion> findByUuid(String uuid);
|
|
||||||
List<GameVersion> findByLastTimeBefore(LocalDateTime time);
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.dao;
|
|
||||||
|
|
||||||
import icu.samnyan.aqua.sega.general.model.PropertyEntry;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
public interface PropertyEntryRepository extends JpaRepository<PropertyEntry, Long> {
|
|
||||||
Optional<PropertyEntry> findByPropertyKey(String key);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package icu.samnyan.aqua.sega.general.dao
|
||||||
|
|
||||||
|
import icu.samnyan.aqua.sega.general.model.PropertyEntry
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
|
import org.springframework.stereotype.Repository
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
interface PropertyEntryRepository : JpaRepository<PropertyEntry, Long> {
|
||||||
|
fun findByPropertyKey(key: String): Optional<PropertyEntry>
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.filter;
|
|
||||||
|
|
||||||
import jakarta.servlet.ReadListener;
|
|
||||||
import jakarta.servlet.ServletInputStream;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
public class CompressRequestWrapper extends HttpServletRequestWrapper {
|
|
||||||
|
|
||||||
private final ByteArrayInputStream input;
|
|
||||||
private ServletInputStream filterInput;
|
|
||||||
|
|
||||||
public CompressRequestWrapper(HttpServletRequest request, byte[] input) {
|
|
||||||
super(request);
|
|
||||||
this.input = new ByteArrayInputStream(input);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ServletInputStream getInputStream() {
|
|
||||||
if (filterInput == null) {
|
|
||||||
filterInput = new ServletInputStream() {
|
|
||||||
@Override
|
|
||||||
public boolean isFinished() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isReady() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setReadListener(ReadListener readListener) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read() {
|
|
||||||
return input.read();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
return filterInput;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package icu.samnyan.aqua.sega.general.filter
|
||||||
|
|
||||||
|
import jakarta.servlet.ReadListener
|
||||||
|
import jakarta.servlet.ServletInputStream
|
||||||
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
|
import jakarta.servlet.http.HttpServletRequestWrapper
|
||||||
|
import java.io.ByteArrayInputStream
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
|
*/
|
||||||
|
class CompressRequestWrapper(request: HttpServletRequest, input: ByteArray) : HttpServletRequestWrapper(request) {
|
||||||
|
val input: ByteArrayInputStream = ByteArrayInputStream(input)
|
||||||
|
var filterInput: ServletInputStream? = null
|
||||||
|
|
||||||
|
override fun getInputStream(): ServletInputStream {
|
||||||
|
return filterInput ?: object : ServletInputStream() {
|
||||||
|
override fun isFinished() = false
|
||||||
|
override fun isReady() = false
|
||||||
|
override fun setReadListener(readListener: ReadListener) {}
|
||||||
|
override fun read() = input.read()
|
||||||
|
}.also { filterInput = it }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Entity(name = "SegaGameVersion")
|
|
||||||
@Table(name = "sega_game_version")
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class GameVersion {
|
|
||||||
@Id
|
|
||||||
private String uuid;
|
|
||||||
private String romVersion;
|
|
||||||
private String dataVersion;
|
|
||||||
private LocalDateTime lastTime;
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Entity(name = "ServerPropertyEntry")
|
|
||||||
@Table(name = "property")
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class PropertyEntry implements Serializable {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private long id;
|
|
||||||
|
|
||||||
@Column(unique = true)
|
|
||||||
private String propertyKey;
|
|
||||||
|
|
||||||
@Column(columnDefinition = "TEXT")
|
|
||||||
private String propertyValue;
|
|
||||||
|
|
||||||
public PropertyEntry(String propertyKey, String propertyValue) {
|
|
||||||
this.propertyKey = propertyKey;
|
|
||||||
this.propertyValue = propertyValue;
|
|
||||||
}
|
|
||||||
public PropertyEntry(String propertyKey) {
|
|
||||||
this.propertyKey = propertyKey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package icu.samnyan.aqua.sega.general.model
|
||||||
|
|
||||||
|
import jakarta.persistence.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
|
*/
|
||||||
|
@Entity(name = "ServerPropertyEntry")
|
||||||
|
@Table(name = "property")
|
||||||
|
class PropertyEntry {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
var id: Long = 0
|
||||||
|
|
||||||
|
@Column(unique = true)
|
||||||
|
var propertyKey: String = ""
|
||||||
|
|
||||||
|
@Column(columnDefinition = "TEXT")
|
||||||
|
var propertyValue: String? = null
|
||||||
|
|
||||||
|
constructor(propertyKey: String, propertyValue: String?) {
|
||||||
|
this.propertyKey = propertyKey
|
||||||
|
this.propertyValue = propertyValue
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package icu.samnyan.aqua.sega.general.model
|
||||||
|
|
||||||
|
class UserRecentRating(
|
||||||
|
val musicId: Int = 0,
|
||||||
|
val difficultId: Int = 0,
|
||||||
|
val romVersionCode: String = "",
|
||||||
|
val score: Int = 0
|
||||||
|
) {
|
||||||
|
override fun toString() = "$musicId:$difficultId:$score"
|
||||||
|
}
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.general.model.response;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class UserRecentRating {
|
|
||||||
private int musicId;
|
|
||||||
private int difficultId;
|
|
||||||
private String romVersionCode;
|
|
||||||
private int score;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return musicId + ":" + difficultId + ":" + score;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ package icu.samnyan.aqua.sega.ongeki
|
|||||||
|
|
||||||
import ext.*
|
import ext.*
|
||||||
import icu.samnyan.aqua.sega.general.model.CardStatus
|
import icu.samnyan.aqua.sega.general.model.CardStatus
|
||||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating
|
import icu.samnyan.aqua.sega.general.model.UserRecentRating
|
||||||
import icu.samnyan.aqua.sega.ongeki.model.OgkItemType
|
import icu.samnyan.aqua.sega.ongeki.model.OgkItemType
|
||||||
import icu.samnyan.aqua.sega.ongeki.model.UserItem
|
import icu.samnyan.aqua.sega.ongeki.model.UserItem
|
||||||
import org.springframework.data.domain.PageRequest
|
import org.springframework.data.domain.PageRequest
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package icu.samnyan.aqua.sega.ongeki.model
|
package icu.samnyan.aqua.sega.ongeki.model
|
||||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating
|
import icu.samnyan.aqua.sega.general.model.UserRecentRating
|
||||||
|
|
||||||
class OngekiUpsertUserAll {
|
class OngekiUpsertUserAll {
|
||||||
var userData: List<UserData>? = null
|
var userData: List<UserData>? = null
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ drop table maimai_user_activity;
|
|||||||
|
|
||||||
drop table maimai_user_data;
|
drop table maimai_user_data;
|
||||||
|
|
||||||
|
drop table sega_game_version;
|
||||||
Reference in New Issue
Block a user