feat: 优化web
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"giter.top/smart/internal/system/handler"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// SystemRoutes 注册 system 模块的 HTTP 路由。
|
||||
type SystemRoutes struct {
|
||||
paramHandler *handler.ParamHandler
|
||||
}
|
||||
// NewSystemRoutes 构造 system 模块的路由注册器,由 Wire 注入。
|
||||
func NewSystemRoutes( paramHandler *handler.ParamHandler) *SystemRoutes {
|
||||
return &SystemRoutes{
|
||||
paramHandler: paramHandler,
|
||||
}
|
||||
}
|
||||
// TODO 添加注册信息
|
||||
func (s *SystemRoutes) Register(engine *gin.Engine, apiGroup *gin.RouterGroup) {
|
||||
group := apiGroup.Group("/system")
|
||||
s.registerParamRoutes(group)
|
||||
}
|
||||
// 系统参数路由
|
||||
func (s *SystemRoutes) registerParamRoutes(group *gin.RouterGroup) {
|
||||
paramGroup := group.Group("/param")
|
||||
{
|
||||
paramGroup.POST("/create", s.paramHandler.CreateParam)
|
||||
paramGroup.PUT("/update", s.paramHandler.UpdateParam)
|
||||
paramGroup.DELETE("/delete-batch", s.paramHandler.DeleteParams)
|
||||
paramGroup.GET("/get", s.paramHandler.GetParam)
|
||||
paramGroup.GET("/list", s.paramHandler.ListParams)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user