基本功能已初步完善
This commit is contained in:
@@ -134,10 +134,6 @@ func main() {
|
||||
admin.POST("/order/assign", handler.AdminOrderAssign)
|
||||
admin.POST("/order/update", handler.AdminOrderUpdate)
|
||||
|
||||
admin.POST("/coupon/fetch", handler.AdminCouponsFetch)
|
||||
admin.POST("/coupon/save", handler.AdminCouponSave)
|
||||
admin.POST("/coupon/drop", handler.AdminCouponDrop)
|
||||
|
||||
admin.POST("/ticket/fetch", handler.AdminTicketsFetch)
|
||||
|
||||
// Knowledge Base
|
||||
@@ -149,14 +145,6 @@ func main() {
|
||||
knowledgeGrp.POST("/sort", handler.AdminKnowledgeSort)
|
||||
}
|
||||
|
||||
// Gift Card
|
||||
giftCardGrp := admin.Group("/gift-card")
|
||||
{
|
||||
giftCardGrp.GET("/fetch", handler.AdminGiftCardFetch)
|
||||
giftCardGrp.POST("/save", handler.AdminGiftCardSave)
|
||||
giftCardGrp.POST("/generate", handler.AdminGiftCardGenerate)
|
||||
}
|
||||
|
||||
// Traffic Reset
|
||||
trafficResetGrp := admin.Group("/traffic-reset")
|
||||
{
|
||||
@@ -190,14 +178,6 @@ func main() {
|
||||
admin.POST("/server/route/save", handler.AdminServerRouteSave)
|
||||
admin.POST("/server/route/drop", handler.AdminServerRouteDrop)
|
||||
|
||||
// Payment
|
||||
admin.GET("/payment/fetch", handler.AdminPaymentFetch)
|
||||
admin.POST("/payment/save", handler.AdminPaymentSave)
|
||||
admin.POST("/payment/drop", handler.AdminPaymentDrop)
|
||||
admin.POST("/payment/show", handler.AdminPaymentShow)
|
||||
admin.POST("/payment/sort", handler.AdminPaymentSort)
|
||||
admin.GET("/payment/getPaymentMethods", handler.AdminGetPaymentMethods)
|
||||
|
||||
// Notice
|
||||
admin.GET("/notice/fetch", handler.AdminNoticeFetch)
|
||||
admin.POST("/notice/save", handler.AdminNoticeSave)
|
||||
|
||||
@@ -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"})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user