feat: implement gas and delivery admin systems
This commit is contained in:
36
backend/api/internal/logic/gas/basic.go
Normal file
36
backend/api/internal/logic/gas/basic.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package gas
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/infra"
|
||||
"git.apinb.com/heqiapp/platforms/backend/api/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// ListMenu 返回 admin 角色的静态菜单。
|
||||
func ListMenu(ctx *gin.Context) {
|
||||
account, _, ok := CurrentGasAccount(ctx)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
list := MenusForRole(account.RoleCode)
|
||||
infra.Response.Success(ctx, gin.H{"total": len(list), "list": list})
|
||||
}
|
||||
|
||||
// InvitationQRCode 返回根据当前气站 identity 动态生成的注册链接数据。
|
||||
func InvitationQRCode(ctx *gin.Context) {
|
||||
_, station, ok := CurrentGasAccount(ctx)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
registerURL, _ := url.Parse(config.Spec.Global.UserRegisterURL)
|
||||
query := registerURL.Query()
|
||||
query.Set("gas_identity", station.Identity)
|
||||
registerURL.RawQuery = query.Encode()
|
||||
infra.Response.Success(ctx, gin.H{
|
||||
"gas_basic_identity": station.Identity,
|
||||
"gas_basic_name": station.Name,
|
||||
"register_url": registerURL.String(),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user