基本功能已初步完善
Some checks failed
build / build (api, amd64, linux) (push) Has been cancelled
build / build (api, arm64, linux) (push) Has been cancelled
build / build (api.exe, amd64, windows) (push) Has been cancelled

This commit is contained in:
CN-JS-HuiBai
2026-04-17 20:41:47 +08:00
parent 25fd919477
commit b3435e5ef8
34 changed files with 3495 additions and 429 deletions

View File

@@ -4,6 +4,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
"xboard-go/internal/config"
"xboard-go/internal/database"
"xboard-go/internal/handler"
@@ -188,12 +189,16 @@ func registerAdminRoutesV2(v2 *gin.RouterGroup) {
admin.GET("/config/fetch", handler.AdminConfigFetch)
admin.POST("/config/save", handler.AdminConfigSave)
admin.GET("/config/getEmailTemplate", handler.AdminGetEmailTemplate)
admin.POST("/config/testSendMail", handler.AdminTestSendMail)
admin.POST("/config/setTelegramWebhook", handler.AdminSetTelegramWebhook)
admin.GET("/dashboard/summary", handler.AdminDashboardSummary)
admin.GET("/stat/getStats", handler.AdminDashboardSummary)
admin.GET("/stat/getOverride", handler.AdminDashboardSummary)
admin.GET("/stat/getTrafficRank", handler.AdminGetTrafficRank)
admin.GET("/stat/getOrder", handler.AdminGetOrderStats)
admin.POST("/stat/getStatUser", handler.AdminGetStatUser)
admin.GET("/system/getSystemStatus", handler.AdminSystemStatus)
admin.GET("/system/getQueueStats", handler.AdminSystemQueueStats)
@@ -222,25 +227,40 @@ func registerAdminRoutesV2(v2 *gin.RouterGroup) {
admin.POST("/plan/sort", handler.AdminPlanSort)
admin.GET("/order/fetch", handler.AdminOrdersFetch)
admin.POST("/order/fetch", handler.AdminOrdersFetch)
admin.POST("/order/detail", handler.AdminOrderDetail)
admin.POST("/order/paid", handler.AdminOrderPaid)
admin.POST("/order/cancel", handler.AdminOrderCancel)
admin.GET("/coupon/fetch", handler.AdminCouponsFetch)
admin.POST("/coupon/save", handler.AdminCouponSave)
admin.POST("/coupon/drop", handler.AdminCouponDrop)
admin.POST("/order/update", handler.AdminOrderUpdate)
admin.POST("/order/assign", handler.AdminOrderAssign)
admin.GET("/user/fetch", handler.AdminUsersFetch)
admin.POST("/user/fetch", handler.AdminUsersFetch)
admin.POST("/user/update", handler.AdminUserUpdate)
admin.POST("/user/ban", handler.AdminUserBan)
admin.POST("/user/resetSecret", handler.AdminUserResetSecret)
admin.POST("/user/sendMail", handler.AdminUserSendMail)
admin.POST("/user/destroy", handler.AdminUserDelete)
admin.POST("/user/resetTraffic", handler.AdminUserResetTraffic)
admin.POST("/user/drop", handler.AdminUserDelete)
admin.GET("/ticket/fetch", handler.AdminTicketsFetch)
admin.GET("/gift-card/status", handler.AdminGiftCardStatus)
admin.POST("/ticket/fetch", handler.AdminTicketsFetch)
admin.GET("/traffic-reset/fetch", handler.AdminTrafficResetFetch)
admin.GET("/traffic-reset/logs", handler.AdminTrafficResetFetch)
admin.POST("/traffic-reset/reset-user", handler.AdminTrafficResetUser)
admin.GET("/traffic-reset/user/:id/history", handler.AdminTrafficResetUserHistory)
admin.GET("/notice/fetch", handler.AdminNoticeFetch)
admin.POST("/notice/save", handler.AdminNoticeSave)
admin.POST("/notice/drop", handler.AdminNoticeDrop)
admin.POST("/notice/show", handler.AdminNoticeShow)
admin.POST("/notice/sort", handler.AdminNoticeSort)
admin.GET("/knowledge/fetch", handler.AdminKnowledgeFetch)
admin.POST("/knowledge/save", handler.AdminKnowledgeSave)
admin.POST("/knowledge/drop", handler.AdminKnowledgeDrop)
admin.POST("/knowledge/sort", handler.AdminKnowledgeSort)
// Integrated Admin Features
admin.GET("/realname/records", handler.PluginRealNameRecords)
admin.POST("/realname/clear-cache", handler.PluginRealNameClearCache)
@@ -249,6 +269,9 @@ func registerAdminRoutesV2(v2 *gin.RouterGroup) {
admin.POST("/realname/sync-all", handler.PluginRealNameSyncAll)
admin.POST("/realname/approve-all", handler.PluginRealNameApproveAll)
admin.GET("/user-online-devices/users", handler.PluginUserOnlineDevicesUsers)
admin.GET("/user-add-ipv6-subscription/users", handler.AdminIPv6SubscriptionUsers)
admin.POST("/user-add-ipv6-subscription/enable/:userId", handler.AdminIPv6SubscriptionEnable)
admin.POST("/user-add-ipv6-subscription/sync-password/:userId", handler.AdminIPv6SubscriptionSyncPassword)
}
func registerWebRoutes(router *gin.Engine) {
@@ -267,5 +290,14 @@ func registerWebRoutes(router *gin.Engine) {
router.GET("/dashboard", handler.UserThemePage)
router.GET(securePath, handler.AdminAppPage)
router.GET(securePath+"/", handler.AdminAppPage)
router.GET(securePath+"/plugin-panel/:kind", handler.AdminPluginPanelPage)
router.GET(securePath+"/plugins/:plugin", handler.AdminAppPage)
router.NoRoute(func(c *gin.Context) {
path := c.Request.URL.Path
if path == securePath || strings.HasPrefix(path, securePath+"/") {
handler.AdminAppPage(c)
return
}
c.JSON(404, gin.H{"message": "not found"})
})
}