Files
platforms/backend/api/internal/routers/gas.go

27 lines
837 B
Go
Raw Normal View History

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)
}