Files
platforms/backend/api/internal/routers/gas.go
2026-08-19 22:07:00 +08:00

29 lines
961 B
Go

package routers
import (
"fmt"
sdkmiddleware "git.apinb.com/bsm-sdk/core/middleware"
"git.apinb.com/heqiapp/platforms/backend/api/internal/logic/common"
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.Use(common.EnableConfiguredKeywordSearch())
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)
}