Minor cleanup and fixes

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-06-01 21:48:41 +08:00
parent 5ccde3f34a
commit 4664847f10
16 changed files with 38 additions and 8 deletions
+1
View File
@@ -6,5 +6,6 @@ config.json
data data
temp temp
.codex
.idea .idea
.vscode .vscode
+1 -1
View File
@@ -7,7 +7,7 @@ LoveLive! 学园偶像祭 自用私服。
详见 `doc` 目录。 详见 `doc` 目录。
## 视频教程 ## 视频教程
- [合集·SIF、AS 私服(本地服)搭建教程](https://space.bilibili.com/671443/channel/collectiondetail?sid=2148053) - [合集·SIF、AS 私服(本地服)搭建教程](https://space.bilibili.com/671443/lists/2148053)
## 特别感谢 ## 特别感谢
+3
View File
@@ -1,2 +1,5 @@
data.db data.db
data.db-shm
data.db-wal
load.db load.db
+2 -2
View File
@@ -34,8 +34,8 @@ func upload(ctx *gin.Context) {
return return
} }
lines := strings.Split(content, "\n") lines := strings.SplitSeq(content, "\n")
for _, rawLine := range lines { for rawLine := range lines {
line := strings.TrimSpace(rawLine) line := strings.TrimSpace(rawLine)
if line == "" { if line == "" {
continue continue
+4
View File
@@ -5,3 +5,7 @@ type DeviceKey struct {
DeviceID string `xorm:"device_id"` DeviceID string `xorm:"device_id"`
RandKey string `xorm:"rand_key"` RandKey string `xorm:"rand_key"`
} }
func (DeviceKey) TableName() string {
return "device_key"
}
+4
View File
@@ -7,3 +7,7 @@ type AuthKey struct {
ServerToken string `xorm:"server_token"` ServerToken string `xorm:"server_token"`
InsertDate string `xorm:"insert_date"` InsertDate string `xorm:"insert_date"`
} }
func (AuthKey) TableName() string {
return "auth_key"
}
+1 -1
View File
@@ -7,6 +7,6 @@ type UserAccessoryWear struct {
UserID int `xorm:"user_id"` UserID int `xorm:"user_id"`
} }
func (u *UserAccessoryWear) TableName() string { func (UserAccessoryWear) TableName() string {
return "user_accessory_wear" return "user_accessory_wear"
} }
+1 -1
View File
@@ -9,6 +9,6 @@ type UserDeck struct {
InsertDate int64 `xorm:"insert_date"` InsertDate int64 `xorm:"insert_date"`
} }
func (u *UserDeck) TableName() string { func (UserDeck) TableName() string {
return "user_deck" return "user_deck"
} }
+1 -1
View File
@@ -21,6 +21,6 @@ type UserDeckUnit struct {
InsertDate int64 `xorm:"insert_date"` InsertDate int64 `xorm:"insert_date"`
} }
func (u *UserDeckUnit) TableName() string { func (UserDeckUnit) TableName() string {
return "user_deck_unit" return "user_deck_unit"
} }
+4
View File
@@ -9,3 +9,7 @@ type UserLiveGoal struct {
GoalType constant.LiveGoalType `xorm:"goal_type"` GoalType constant.LiveGoalType `xorm:"goal_type"`
CompletedAt int64 `xorm:"completed_at"` CompletedAt int64 `xorm:"completed_at"`
} }
func (UserLiveGoal) TableName() string {
return "user_live_goal"
}
@@ -5,3 +5,7 @@ type UserLiveInProgress struct {
DeckID int `xorm:"deck_id"` DeckID int `xorm:"deck_id"`
UserID int `xorm:"user_id"` UserID int `xorm:"user_id"`
} }
func (UserLiveInProgress) TableName() string {
return "user_live_in_progress"
}
+4
View File
@@ -23,6 +23,10 @@ type UserLiveRecord struct {
UpdateDate string `xorm:"insert_date"` UpdateDate string `xorm:"insert_date"`
} }
func (UserLiveRecord) TableName() string {
return "user_live_record"
}
// TODO: 转移到 schema 下 // TODO: 转移到 schema 下
type NotesList struct { type NotesList struct {
TimingSec float64 `json:"timing_sec"` TimingSec float64 `json:"timing_sec"`
+4
View File
@@ -8,3 +8,7 @@ type UserUnitData struct {
UserID int `xorm:"user_id"` UserID int `xorm:"user_id"`
InsertDate int64 `xorm:"insert_date"` InsertDate int64 `xorm:"insert_date"`
} }
func (UserUnitData) TableName() string {
return "user_unit_data"
}
+3 -1
View File
@@ -6,6 +6,7 @@ import (
"honoka-chan/internal/utils" "honoka-chan/internal/utils"
"honoka-chan/pkg/db" "honoka-chan/pkg/db"
"log" "log"
"net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"xorm.io/xorm" "xorm.io/xorm"
@@ -75,6 +76,7 @@ func (ss *Session) Respond(resp any) {
return return
} }
ss.Ctx.Header("Content-Type", "application/json")
ss.Ctx.Header("X-Message-Sign", utils.GenXMS(data)) ss.Ctx.Header("X-Message-Sign", utils.GenXMS(data))
ss.Ctx.String(200, string(data)) ss.Ctx.String(http.StatusOK, string(data))
} }
-1
View File
@@ -22,5 +22,4 @@ func CreateDefaultUser() {
log.Printf("默认用户创建成功, 账号: %s, 密码: %s\n", defaultPhone, defaultPassword) log.Printf("默认用户创建成功, 账号: %s, 密码: %s\n", defaultPhone, defaultPassword)
return return
} }
log.Printf("默认用户已存在, 账号: %s\n", defaultPhone)
} }
+1
View File
@@ -45,6 +45,7 @@ func main() {
"/agreement/all", "/agreement/all",
"/integration/appReport/initialize", "/integration/appReport/initialize",
"/report/ge/app", "/report/ge/app",
"/v1/account/reportRole",
}, },
})) }))