Documentation ¶
Index ¶
- Constants
- func InjectWebUserContext(s *WebUserContext)
- func LoadWebUserContext() baseiface.ISingleton
- type WebUserContext
- func (wcc *WebUserContext) BackendGetUserId(ctx context.Context) *webdto.WebUserId
- func (wcc *WebUserContext) GetUserId(c *gin.Context) *webdto.WebUserId
- func (wcc *WebUserContext) NewAdminContext(c context.Context) context.Context
- func (wcc *WebUserContext) NewBackendContext(c *gin.Context) context.Context
- func (wcc *WebUserContext) SetUserId(c *gin.Context, userId *webdto.WebUserId)
- func (this *WebUserContext) Single() bool
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 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
Click to show internal directories.
Click to hide internal directories.