Implement more endpoints & overhaul [2/n]

Drop LevelDB and move all the things to SQLite.

Implemented endpoints:
/api <unit, accessoryMaterialAll>
/api <unit, accessoryTab>
/live/continue
/live/partyList
/unit/favoriteAccessory (WIP)
/unit/sale

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-04-28 11:44:56 +08:00
parent 1500821f3e
commit 150ce674ad
218 changed files with 2993 additions and 2160 deletions
+13
View File
@@ -0,0 +1,13 @@
package liveschema
type ContinueData struct {
BeforeSnsCoin int `json:"before_sns_coin"`
AfterSnsCoin int `json:"after_sns_coin"`
ServerTimestamp int64 `json:"server_timestamp"`
}
type ContinueResp struct {
ResponseData ContinueData `json:"response_data"`
ReleaseInfo []any `json:"release_info"`
StatusCode int `json:"status_code"`
}
+1 -1
View File
@@ -1,4 +1,4 @@
package live
package liveschema
type GameOverResp struct {
ResponseData []any `json:"response_data"`
+55
View File
@@ -0,0 +1,55 @@
package liveschema
import userschema "honoka-chan/internal/schema/user"
type CenterUnitInfo struct {
UnitOwningUserID int `json:"unit_owning_user_id"`
UnitID int `json:"unit_id"`
Exp int `json:"exp"`
NextExp int `json:"next_exp"`
Level int `json:"level"`
LevelLimitID int `json:"level_limit_id"`
MaxLevel int `json:"max_level"`
Rank int `json:"rank"`
MaxRank int `json:"max_rank"`
Love int `json:"love"`
MaxLove int `json:"max_love"`
UnitSkillLevel int `json:"unit_skill_level"`
MaxHp int `json:"max_hp"`
FavoriteFlag bool `json:"favorite_flag"`
DisplayRank int `json:"display_rank"`
UnitSkillExp int `json:"unit_skill_exp"`
UnitRemovableSkillCapacity int `json:"unit_removable_skill_capacity"`
Attribute int `json:"attribute"`
Smile int `json:"smile"`
Cute int `json:"cute"`
Cool int `json:"cool"`
IsLoveMax bool `json:"is_love_max"`
IsLevelMax bool `json:"is_level_max"`
IsRankMax bool `json:"is_rank_max"`
IsSigned bool `json:"is_signed"`
IsSkillLevelMax bool `json:"is_skill_level_max"`
SettingAwardID int `json:"setting_award_id"`
RemovableSkillIds []int `json:"removable_skill_ids"`
}
type PartyList struct {
UserInfo userschema.UserInfo `json:"user_info"`
CenterUnitInfo CenterUnitInfo `json:"center_unit_info"`
SettingAwardID int `json:"setting_award_id"`
AvailableSocialPoint int `json:"available_social_point"`
FriendStatus int `json:"friend_statuses"`
}
type PartyListData struct {
PartyList []PartyList `json:"party_list"`
TrainingEnergy int `json:"training_energy"`
TrainingEnergyMax int `json:"training_energy_max"`
ServerTimestamp int64 `json:"server_timestamp"`
}
type PartyListResp struct {
ResponseData PartyListData `json:"response_data"`
ReleaseInfo []any `json:"release_info"`
StatusCode int `json:"status_code"`
}
+9 -1
View File
@@ -1,4 +1,4 @@
package live
package liveschema
type PlayReq struct {
Module string `json:"module"`
@@ -31,6 +31,14 @@ type NotesList struct {
type LiveInfo struct {
LiveDifficultyID int `json:"live_difficulty_id"`
IsRandom bool `json:"is_random"`
ARankScore int `json:"-"`
BRankScore int `json:"-"`
CRankScore int `json:"-"`
SRankScore int `json:"-"`
ARankCombo int `json:"-"`
BRankCombo int `json:"-"`
CRankCombo int `json:"-"`
SRankCombo int `json:"-"`
AcFlag int `json:"ac_flag"`
SwingFlag int `json:"swing_flag"`
NotesList []NotesList `json:"notes_list"`
+24 -6
View File
@@ -1,4 +1,4 @@
package live
package liveschema
type PlayScoreReq struct {
Module string `json:"module"`
@@ -18,7 +18,9 @@ type On struct {
PreciseList any `json:"precise_list"`
DeckInfo any `json:"deck_info"`
TapAdjust any `json:"tap_adjust"`
LiveSetting any `json:"live_setting,omitempty"`
CanReplay bool `json:"can_replay"`
TriggerLog any `json:"trigger_log,omitempty"`
}
type Off struct {
@@ -30,19 +32,35 @@ type Off struct {
PreciseList any `json:"precise_list"`
DeckInfo any `json:"deck_info"`
TapAdjust any `json:"tap_adjust"`
LiveSetting any `json:"live_setting,omitempty"`
CanReplay bool `json:"can_replay"`
TriggerLog any `json:"trigger_log,omitempty"`
}
type Skill struct {
HasRecord bool `json:"has_record"`
LiveInfo LiveInfo `json:"live_info"`
RandomSeed any `json:"random_seed"`
MaxCombo any `json:"max_combo"`
UpdateDate any `json:"update_date"`
PreciseList any `json:"precise_list"`
DeckInfo any `json:"deck_info"`
TapAdjust any `json:"tap_adjust"`
LiveSetting any `json:"live_setting,omitempty"`
CanReplay bool `json:"can_replay"`
TriggerLog any `json:"trigger_log,omitempty"`
}
type PreciseScoreData struct {
On On `json:"on"`
Off Off `json:"off"`
On Skill `json:"on"`
Off Skill `json:"off"`
RankInfo []RankInfo `json:"rank_info"`
CanActivateEffect bool `json:"can_activate_effect"`
ServerTimestamp int64 `json:"server_timestamp"`
}
type PreciseScoreResp struct {
ResponseData PreciseScoreData `json:"response_data"`
ReleaseInfo []any `json:"release_info"`
StatusCode int `json:"status_code"`
ResponseData any `json:"response_data"`
ReleaseInfo []any `json:"release_info"`
StatusCode int `json:"status_code"`
}
+27 -67
View File
@@ -1,4 +1,9 @@
package live
package liveschema
import (
"honoka-chan/internal/constant"
userschema "honoka-chan/internal/schema/user"
)
type RewardReq struct {
Module string `json:"module"`
@@ -31,26 +36,31 @@ type Icon struct {
}
type LiveSetting struct {
StringSize int `json:"string_size"`
PreciseScoreAutoUpdateFlag bool `json:"precise_score_auto_update_flag"`
SeID int `json:"se_id"`
CutinBrightness int `json:"cutin_brightness"`
RandomValue int `json:"random_value"`
PreciseScoreUpdateType int `json:"precise_score_update_type"`
EffectFlag bool `json:"effect_flag"`
NotesSpeed float64 `json:"notes_speed"`
Icon Icon `json:"icon"`
CutinType int `json:"cutin_type"`
StringSize int `json:"string_size"`
PreciseScoreAutoUpdateFlag bool `json:"precise_score_auto_update_flag"`
SeID int `json:"se_id"`
CutinBrightness int `json:"cutin_brightness"`
RandomValue int `json:"random_value"`
PreciseScoreUpdateType constant.PreciseScoreUpdateType `json:"precise_score_update_type"`
EffectFlag bool `json:"effect_flag"`
NotesSpeed float64 `json:"notes_speed"`
Icon Icon `json:"icon"`
CutinType int `json:"cutin_type"`
BackgroundID any `json:"background_id"`
}
type PreciseList struct {
Effect int `json:"effect"`
Count int `json:"count"`
Tap float64 `json:"tap"`
NoteNumber int `json:"note_number"`
Position int `json:"position"`
Effect int `json:"effect"`
Accuracy int `json:"accuracy"`
Tap float64 `json:"tap"`
IsSame bool `json:"is_same"`
Release any `json:"release"`
Position int `json:"position"`
NoteNumber int `json:"note_number"`
FirstTouch any `json:"first_touch"`
Tp any `json:"tp"`
Tpf any `json:"tpf"`
}
type BackgroundScore struct {
@@ -208,56 +218,6 @@ type PlayRewardUnitList struct {
InsertData int64 `xorm:"insert_date" json:"-"`
}
type BeforeUserInfo struct {
Level int `json:"level"`
Exp int `json:"exp"`
PreviousExp int `json:"previous_exp"`
NextExp int `json:"next_exp"`
GameCoin int `json:"game_coin"`
SnsCoin int `json:"sns_coin"`
FreeSnsCoin int `json:"free_sns_coin"`
PaidSnsCoin int `json:"paid_sns_coin"`
SocialPoint int `json:"social_point"`
UnitMax int `json:"unit_max"`
WaitingUnitMax int `json:"waiting_unit_max"`
CurrentEnergy int `json:"current_energy"`
EnergyMax int `json:"energy_max"`
TrainingEnergy int `json:"training_energy"`
TrainingEnergyMax int `json:"training_energy_max"`
EnergyFullTime string `json:"energy_full_time"`
LicenseLiveEnergyRecoverlyTime int `json:"license_live_energy_recoverly_time"`
FriendMax int `json:"friend_max"`
TutorialState int `json:"tutorial_state"`
OverMaxEnergy int `json:"over_max_energy"`
UnlockRandomLiveMuse int `json:"unlock_random_live_muse"`
UnlockRandomLiveAqours int `json:"unlock_random_live_aqours"`
}
type AfterUserInfo struct {
Level int `json:"level"`
Exp int `json:"exp"`
PreviousExp int `json:"previous_exp"`
NextExp int `json:"next_exp"`
GameCoin int `json:"game_coin"`
SnsCoin int `json:"sns_coin"`
FreeSnsCoin int `json:"free_sns_coin"`
PaidSnsCoin int `json:"paid_sns_coin"`
SocialPoint int `json:"social_point"`
UnitMax int `json:"unit_max"`
WaitingUnitMax int `json:"waiting_unit_max"`
CurrentEnergy int `json:"current_energy"`
EnergyMax int `json:"energy_max"`
TrainingEnergy int `json:"training_energy"`
TrainingEnergyMax int `json:"training_energy_max"`
EnergyFullTime string `json:"energy_full_time"`
LicenseLiveEnergyRecoverlyTime int `json:"license_live_energy_recoverly_time"`
FriendMax int `json:"friend_max"`
TutorialState int `json:"tutorial_state"`
OverMaxEnergy int `json:"over_max_energy"`
UnlockRandomLiveMuse int `json:"unlock_random_live_muse"`
UnlockRandomLiveAqours int `json:"unlock_random_live_aqours"`
}
type NextLevelInfo struct {
Level int `json:"level"`
FromExp int `json:"from_exp"`
@@ -335,8 +295,8 @@ type RewardData struct {
IsEffortPointVisible bool `json:"is_effort_point_visible"`
LimitedEffortBox []any `json:"limited_effort_box"`
UnitList []PlayRewardUnitList `json:"unit_list"`
BeforeUserInfo BeforeUserInfo `json:"before_user_info"`
AfterUserInfo AfterUserInfo `json:"after_user_info"`
BeforeUserInfo userschema.UserInfo `json:"before_user_info"`
AfterUserInfo userschema.UserInfo `json:"after_user_info"`
NextLevelInfo []NextLevelInfo `json:"next_level_info"`
GoalAccompInfo GoalAccompInfo `json:"goal_accomp_info"`
SpecialRewardInfo []any `json:"special_reward_info"`