webcontext

package
v1.0.1-dev-02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2024 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADER_SHOP_ID   = "Shop_id"
	HEADER_USER_ID   = "User_id"
	HEADER_SHOP_NAME = "Shop_name"
	HEADER_USER_NAME = "User_name"
)

Variables

This section is empty.

Functions

func InjectWebUserContext

func InjectWebUserContext(s *WebUserContext)

func LoadWebUserContext

func LoadWebUserContext() baseiface.ISingleton

Types

type WebUserContext

type WebUserContext struct {
	*ichubconfig.IchubConfig
	ServerName string `json:"server_name"`
	WebPrefix  string `json:"web_prefix"`
	RootDir    string `json:"root_dir"`
}

func FindBeanWebUserContext

func FindBeanWebUserContext() *WebUserContext

FindBeanWebUserContext

func NewWebUserContext

func NewWebUserContext() *WebUserContext

func (*WebUserContext) BackendGetUserId

func (wcc *WebUserContext) BackendGetUserId(ctx context.Context) *webdto.WebUserId

Backend 获取上下文信息

func (*WebUserContext) GetUserId

func (wcc *WebUserContext) GetUserId(c *gin.Context) *webdto.WebUserId

func (*WebUserContext) NewAdminContext

func (wcc *WebUserContext) NewAdminContext(c context.Context) context.Context

func (*WebUserContext) NewBackendContext

func (wcc *WebUserContext) NewBackendContext(c *gin.Context) context.Context

设定后台上下文

func (*WebUserContext) SetUserId

func (wcc *WebUserContext) SetUserId(c *gin.Context, userId *webdto.WebUserId)

SetUserId 设定用户ID

func (*WebUserContext) Single

func (this *WebUserContext) Single() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL