Drop SifCap

No longer used, keep sifcap.go for reference.

Signed-off-by: Yuan Si <do4suki@gmail.com>
This commit is contained in:
2023-04-10 01:25:08 +08:00
parent fb4c5009e2
commit 8a69a9391b
4 changed files with 72 additions and 85 deletions
+2
View File
@@ -9,3 +9,5 @@ logs
assets/api1.json
assets/api2.json
assets/api3.json
.vscode
-2
View File
@@ -10,5 +10,3 @@ log:
log_save: true
leveldb:
data_path: ./data/honoka-chan.db
sifcap:
enabled: false
-8
View File
@@ -18,7 +18,6 @@ type AppConfigs struct {
Server ServerConfigs `yaml:"server"`
Log LogConfigs `yaml:"log"`
LevelDb LevelDbConfigs `yaml:"leveldb"`
SifCap SifCapConfigs `yaml:"sifcap"`
}
type ServerConfigs struct {
@@ -38,10 +37,6 @@ type LevelDbConfigs struct {
DataPath string `yaml:"data_path"`
}
type SifCapConfigs struct {
Enabled bool `yaml:"enabled"`
}
func DefaultConfigs() *AppConfigs {
return &AppConfigs{
AppName: "LL! SIF Private Server",
@@ -59,9 +54,6 @@ func DefaultConfigs() *AppConfigs {
LevelDb: LevelDbConfigs{
DataPath: "./data/honoka-chan.db",
},
SifCap: SifCapConfigs{
Enabled: false,
},
}
}
+70 -75
View File
@@ -4,7 +4,6 @@ import (
"honoka-chan/config"
"honoka-chan/handler"
"honoka-chan/middleware"
"honoka-chan/sifcap"
_ "honoka-chan/tools"
"honoka-chan/xclog"
"net/http"
@@ -17,81 +16,77 @@ func init() {
}
func main() {
if config.Conf.SifCap.Enabled {
sifcap.Start()
} else {
// Router
r := gin.Default()
r.Static("/static", "static")
r.LoadHTMLGlob("static/*.tmpl")
// Router
r := gin.Default()
r.Static("/static", "static")
r.LoadHTMLGlob("static/*.tmpl")
// /
r.Any("/", func(ctx *gin.Context) {
ctx.String(http.StatusOK, "Hello, world!")
})
// /
r.Any("/", func(ctx *gin.Context) {
ctx.String(http.StatusOK, "Hello, world!")
})
// Private APIs
v1 := r.Group("v1")
{
v1.GET("/basic/getcode", handler.GetCodeHandler)
v1.POST("/account/active", handler.ActiveHandler)
v1.POST("/basic/publickey", handler.PublicKeyHandler)
v1.POST("/basic/handshake", handler.HandshakeHandler)
v1.POST("/account/initialize", handler.InitializeHandler)
v1.POST("/account/login", handler.AccountLoginHandler)
v1.POST("/account/loginauto", handler.LoginAutoHandler)
v1.POST("/basic/loginarea", handler.LoginAreaHandler)
v1.POST("/account/reportRole", handler.ReportRoleHandler)
v1.POST("/basic/getProductList", handler.GetProductListHandler)
}
r.GET("/agreement/all", handler.AgreementHandler)
r.GET("/integration/appReport/initialize", handler.ReportApp)
r.POST("/report/ge/app", handler.ReportLog)
// Private APIs
// Server APIs
m := r.Group("main.php").Use(middleware.KlabHeader)
{
m.POST("/login/authkey", handler.AuthKeyHandler)
m.POST("/login/login", handler.LoginHandler)
m.POST("/user/userInfo", handler.UserInfoHandler)
m.POST("/gdpr/get", handler.GdprHandler)
m.POST("/personalnotice/get", handler.PersonalNoticeHandler)
m.POST("/tos/tosCheck", handler.TosCheckHandler)
m.POST("/download/batch", handler.DownloadBatchHandler)
m.POST("/download/event", handler.DownloadEventHandler)
m.POST("/lbonus/execute", handler.LBonusExecuteHandler)
m.POST("/api", handler.ApiHandler)
m.POST("/announce/checkState", handler.AnnounceCheckStateHandler)
m.POST("/scenario/startup", handler.ScenarioStartupHandler)
m.POST("/scenario/reward", handler.ScenarioRewardHandler)
m.POST("/user/setNotificationToken", handler.SetNotificationTokenHandler)
m.POST("/user/changeNavi", handler.SetNotificationTokenHandler)
m.POST("/event/eventList", handler.EventListHandler)
m.POST("/payment/productList", handler.ProductListHandler)
m.POST("/live/partyList", handler.PartyListHandler)
m.POST("/live/play", handler.PlayLiveHandler)
m.POST("/live/preciseScore", handler.PlayScoreHandler)
m.POST("/live/reward", handler.PlayRewardHandler)
m.POST("/live/gameover", handler.GameOverHandler)
m.POST("/unit/setDisplayRank", handler.SetDisplayRankHandler)
m.POST("/unit/favorite", handler.SetDisplayRankHandler)
m.POST("/subscenario/startup", handler.SubScenarioStartupHandler)
m.POST("/subscenario/reward", handler.SubScenarioStartupHandler)
m.POST("/album/seriesAll", handler.AlbumSeriesAllHandler)
m.POST("/notice/noticeFriendVariety", handler.NoticeFriendVarietyHandler)
m.POST("/notice/noticeFriendGreeting", handler.NoticeFriendGreetingHandler)
m.POST("/notice/noticeUserGreetingHistory", handler.NoticeUserGreetingHandler)
}
r.GET("/webview.php/announce/index", handler.AnnounceIndexHandler)
// Server APIs
// Web
// Manga
r.GET("/manga", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "manga.tmpl", gin.H{})
})
r.Run(":8080") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
// Private APIs
v1 := r.Group("v1")
{
v1.GET("/basic/getcode", handler.GetCodeHandler)
v1.POST("/account/active", handler.ActiveHandler)
v1.POST("/basic/publickey", handler.PublicKeyHandler)
v1.POST("/basic/handshake", handler.HandshakeHandler)
v1.POST("/account/initialize", handler.InitializeHandler)
v1.POST("/account/login", handler.AccountLoginHandler)
v1.POST("/account/loginauto", handler.LoginAutoHandler)
v1.POST("/basic/loginarea", handler.LoginAreaHandler)
v1.POST("/account/reportRole", handler.ReportRoleHandler)
v1.POST("/basic/getProductList", handler.GetProductListHandler)
}
r.GET("/agreement/all", handler.AgreementHandler)
r.GET("/integration/appReport/initialize", handler.ReportApp)
r.POST("/report/ge/app", handler.ReportLog)
// Private APIs
// Server APIs
m := r.Group("main.php").Use(middleware.KlabHeader)
{
m.POST("/login/authkey", handler.AuthKeyHandler)
m.POST("/login/login", handler.LoginHandler)
m.POST("/user/userInfo", handler.UserInfoHandler)
m.POST("/gdpr/get", handler.GdprHandler)
m.POST("/personalnotice/get", handler.PersonalNoticeHandler)
m.POST("/tos/tosCheck", handler.TosCheckHandler)
m.POST("/download/batch", handler.DownloadBatchHandler)
m.POST("/download/event", handler.DownloadEventHandler)
m.POST("/lbonus/execute", handler.LBonusExecuteHandler)
m.POST("/api", handler.ApiHandler)
m.POST("/announce/checkState", handler.AnnounceCheckStateHandler)
m.POST("/scenario/startup", handler.ScenarioStartupHandler)
m.POST("/scenario/reward", handler.ScenarioRewardHandler)
m.POST("/user/setNotificationToken", handler.SetNotificationTokenHandler)
m.POST("/user/changeNavi", handler.SetNotificationTokenHandler)
m.POST("/event/eventList", handler.EventListHandler)
m.POST("/payment/productList", handler.ProductListHandler)
m.POST("/live/partyList", handler.PartyListHandler)
m.POST("/live/play", handler.PlayLiveHandler)
m.POST("/live/preciseScore", handler.PlayScoreHandler)
m.POST("/live/reward", handler.PlayRewardHandler)
m.POST("/live/gameover", handler.GameOverHandler)
m.POST("/unit/setDisplayRank", handler.SetDisplayRankHandler)
m.POST("/unit/favorite", handler.SetDisplayRankHandler)
m.POST("/subscenario/startup", handler.SubScenarioStartupHandler)
m.POST("/subscenario/reward", handler.SubScenarioStartupHandler)
m.POST("/album/seriesAll", handler.AlbumSeriesAllHandler)
m.POST("/notice/noticeFriendVariety", handler.NoticeFriendVarietyHandler)
m.POST("/notice/noticeFriendGreeting", handler.NoticeFriendGreetingHandler)
m.POST("/notice/noticeUserGreetingHistory", handler.NoticeUserGreetingHandler)
}
r.GET("/webview.php/announce/index", handler.AnnounceIndexHandler)
// Server APIs
// Web
// Manga
r.GET("/manga", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "manga.tmpl", gin.H{})
})
r.Run(":8080") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}