优化结构
This commit is contained in:
@@ -24,3 +24,4 @@ type SystemConfig = handler.SystemConfig
|
||||
type Task = handler.Task
|
||||
type User = handler.User
|
||||
type Version = handler.Version
|
||||
type IntegrationConfig = handler.IntegrationConfig
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package router
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func RegisterIntegrationConfig(group *gin.RouterGroup, handler *IntegrationConfig) {
|
||||
configs := group.Group("/integration/configs")
|
||||
configs.GET("/:kind", handler.List)
|
||||
configs.GET("/:kind/:provider", handler.Find)
|
||||
configs.PUT("/:kind/:provider", handler.Save)
|
||||
configs.DELETE("/:kind/:provider", handler.Delete)
|
||||
}
|
||||
@@ -6,8 +6,6 @@ import (
|
||||
|
||||
func RegisterPayment(group, public *gin.RouterGroup, h *Payment) {
|
||||
payment := group.Group("/payment")
|
||||
payment.GET("/configs", h.Configs)
|
||||
payment.POST("/config", h.SaveConfig)
|
||||
payment.GET("/orders", h.Orders)
|
||||
payment.POST("/order", h.Order)
|
||||
payment.GET("/orders/:provider/:tradeNo", h.OrderByPath)
|
||||
|
||||
@@ -38,5 +38,6 @@ func (r *Routes) RegisterRoutes(public, private *gin.RouterGroup, engine *gin.En
|
||||
RegisterMedia(private, r.handlers.Media)
|
||||
RegisterAnnouncement(private, public, r.handlers.Announcement)
|
||||
RegisterEmail(private, r.handlers.Email)
|
||||
RegisterIntegrationConfig(private, r.handlers.IntegrationConfig)
|
||||
RegisterPayment(private, public, r.handlers.Payment)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user