feat: implement gas and delivery admin systems
This commit is contained in:
26
backend/api/internal/routers/gas.go
Normal file
26
backend/api/internal/routers/gas.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sdkmiddleware "git.apinb.com/bsm-sdk/core/middleware"
|
||||
gaslogic "git.apinb.com/heqiapp/platforms/backend/api/internal/logic/gas"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// RegisterGas 注册 /heqi/gas/v1 气站后台路由。
|
||||
func RegisterGas(serviceKey string, engine *gin.Engine) {
|
||||
basePath := fmt.Sprintf("/%s/gas/v1", serviceKey)
|
||||
anonymous := engine.Group(basePath)
|
||||
anonymous.POST("/auth/login", gaslogic.Login)
|
||||
|
||||
protected := engine.Group(basePath)
|
||||
protected.Use(sdkmiddleware.JwtAuth(true))
|
||||
protected.Use(gaslogic.RequireGasAdmin())
|
||||
protected.GET("/auth/profile", gaslogic.CurrentProfile)
|
||||
protected.PUT("/auth/password", gaslogic.ChangePassword)
|
||||
protected.GET("/gas_menu", gaslogic.ListMenu)
|
||||
protected.GET("/invitation/qrcode", gaslogic.InvitationQRCode)
|
||||
|
||||
registerGasBusinessRoutes(protected)
|
||||
}
|
||||
Reference in New Issue
Block a user