Documentation ¶
Index ¶
- Constants
- Variables
- func IfExistUserId(c *gin.Context) bool
- func InjectWebCheckRequest(s *WebCheckRequest)
- func InjectWebCheckRes(s *WebCheckRes)
- func InjectWebCheckResult(s *WebCheckResult)
- func InjectWebRequestToken(s *WebRequestToken)
- func InjectWebUserContext(s *WebContext)
- func InjectWebUserId(s *WebUserId)
- func LoadWebCheckRequest() baseiface.ISingleton
- func LoadWebCheckRes() baseiface.ISingleton
- func LoadWebCheckResult() baseiface.ISingleton
- func LoadWebRequestToken() baseiface.ISingleton
- func LoadWebUserContext() baseiface.ISingleton
- func LoadWebUserId() baseiface.ISingleton
- func PlatformshopId(shop_id string) string
- func SetUserId(c *gin.Context, userId *WebUserId)
- type WebCheckRequest
- type WebCheckRes
- type WebCheckResult
- func DefaultDisabledResult() *WebCheckResult
- func DefaultPassedResult() *WebCheckResult
- func DefaultPassedResultWeb() *WebCheckResult
- func DefaultResult() *WebCheckResult
- func FindBeanWebCheckResult() *WebCheckResult
- func GetAllowedResult(c *gin.Context) *WebCheckResult
- func NewWebCheckResult() *WebCheckResult
- type WebContext
- func (wcc *WebContext) BackendGetUserId(ctx context.Context) *WebUserId
- func (wcc *WebContext) GetUserId(c *gin.Context) *WebUserId
- func (wcc *WebContext) GetUserIdErr(c *gin.Context) (*WebUserId, error)
- func (wcc *WebContext) NewAdminContext(c context.Context) context.Context
- func (wcc *WebContext) NewBackendContext(c *gin.Context) context.Context
- func (wcc *WebContext) SetUserId(c *gin.Context, userId *WebUserId)
- func (this *WebContext) Single() bool
- type WebPlatformShop
- type WebRequestToken
- type WebUserId
Constants ¶
View Source
const ( RES_RES_TYPE_ERP = "B" RES_RES_TYPE_STORE = "F" )
View Source
const ( HEADER_SHOP_ID = "Shop_id" HEADER_USER_ID = "User_id" HEADER_SHOP_NAME = "Shop_name" HEADER_USER_NAME = "User_name" )
Variables ¶
View Source
var F_DEPTH = webconsts.DEPTH_Local
Functions ¶
func IfExistUserId ¶
func InjectWebCheckRequest ¶
func InjectWebCheckRequest(s *WebCheckRequest)
func InjectWebCheckRes ¶
func InjectWebCheckRes(s *WebCheckRes)
func InjectWebCheckResult ¶
func InjectWebCheckResult(s *WebCheckResult)
func InjectWebRequestToken ¶
func InjectWebRequestToken(s *WebRequestToken)
func InjectWebUserContext ¶
func InjectWebUserContext(s *WebContext)
func InjectWebUserId ¶
func InjectWebUserId(s *WebUserId)
func LoadWebCheckRequest ¶
func LoadWebCheckRequest() baseiface.ISingleton
func LoadWebCheckRes ¶
func LoadWebCheckRes() baseiface.ISingleton
func LoadWebCheckResult ¶
func LoadWebCheckResult() baseiface.ISingleton
func LoadWebRequestToken ¶
func LoadWebRequestToken() baseiface.ISingleton
func LoadWebUserContext ¶
func LoadWebUserContext() baseiface.ISingleton
func LoadWebUserId ¶
func LoadWebUserId() baseiface.ISingleton
func PlatformshopId ¶
Types ¶
type WebCheckRequest ¶
type WebCheckRequest struct { basedto.BaseEntity TenantId string `json:"tenant_id"` ShopId int64 `json:"shop_id"` ShopMemberId int64 `json:"shop_member_id"` JobId int64 `json:"job_id"` EmployeeAccountId int64 `json:"employee_account_id"` *WebCheckRes IfBackend bool `json:"if_backend"` }
func DefaultRequest ¶
func DefaultRequest() *WebCheckRequest
func FindBeanWebCheckRequest ¶
func FindBeanWebCheckRequest() *WebCheckRequest
FindBeanWebCheckRequest
func NewWebCheckRequest ¶
func NewWebCheckRequest() *WebCheckRequest
func (*WebCheckRequest) Check ¶
func (self *WebCheckRequest) Check() error
func (*WebCheckRequest) FromIfAbort ¶
func (self *WebCheckRequest) FromIfAbort(c *gin.Context, userId *WebUserId) bool
exist abort
func (*WebCheckRequest) ValueFrom ¶
func (self *WebCheckRequest) ValueFrom(webUserId *WebUserId)
type WebCheckRes ¶
type WebCheckRes struct { basedto.BaseEntity Method string `json:"method"` RoutePath string `json:"route_path"` MaxDepth string `json:"max_depth"` ResourceType string `json:"resource_type"` ResourceDomain string `json:"resource_domain"` ResourceCode string `json:"resource_code"` ResourceKey string `json:"resource_key"` ActionKey string `json:"action_key"` }
func DefaultResof ¶
func DefaultResof(res string) *WebCheckRes
func NewWebCheckRes ¶
func NewWebCheckRes() *WebCheckRes
type WebCheckResult ¶
type WebCheckResult struct { basedto.BaseEntity Allowed bool `json:"allowed"` Depth string `json:"depth"` ShopIds []int64 `json:"shop_ids"` ShopMemberIds []int64 `json:"shop_member_ids"` }
func DefaultDisabledResult ¶
func DefaultDisabledResult() *WebCheckResult
func DefaultPassedResult ¶
func DefaultPassedResult() *WebCheckResult
func DefaultPassedResultWeb ¶
func DefaultPassedResultWeb() *WebCheckResult
func DefaultResult ¶
func DefaultResult() *WebCheckResult
func GetAllowedResult ¶
func GetAllowedResult(c *gin.Context) *WebCheckResult
func NewWebCheckResult ¶
func NewWebCheckResult() *WebCheckResult
func (*WebCheckResult) SetAllowedResult ¶
func (self *WebCheckResult) SetAllowedResult(c *gin.Context)
SetAllowedResult 设定校验权限结果
type WebContext ¶
type WebContext struct { *ichubconfig.IchubConfig RootDir string `json:"root_dir"` WebPrefix string `json:"web_prefix"` MaxDepth string `json:"max_depth"` IfBackend bool `json:"if_backend"` // es环境前缀 EsEnv string `json:"es_env"` }
func NewWebContext ¶
func NewWebContext() *WebContext
func (*WebContext) BackendGetUserId ¶
func (wcc *WebContext) BackendGetUserId(ctx context.Context) *WebUserId
Backend 获取上下文信息
func (*WebContext) GetUserIdErr ¶
func (wcc *WebContext) GetUserIdErr(c *gin.Context) (*WebUserId, error)
func (*WebContext) NewAdminContext ¶
func (wcc *WebContext) NewAdminContext(c context.Context) context.Context
设定管理员上下文
func (*WebContext) NewBackendContext ¶
func (wcc *WebContext) NewBackendContext(c *gin.Context) context.Context
设定后台上下文
func (*WebContext) SetUserId ¶
func (wcc *WebContext) SetUserId(c *gin.Context, userId *WebUserId)
SetUserId 设定用户ID
func (*WebContext) Single ¶
func (this *WebContext) Single() bool
type WebPlatformShop ¶
type WebPlatformShop struct { ShopId string `json:"shop_id"` Advertisement int64 `json:"advertisement"` Invite int64 `json:"invite"` Questionnaire int64 `json:"questionnaire"` Qa int64 `json:"qa"` Article int64 `json:"article"` }
func NewWebPlatformShop ¶
func NewWebPlatformShop() *WebPlatformShop
type WebRequestToken ¶
type WebRequestToken struct { basedto.BaseEntity Token string `json:"token"` }
func FindBeanWebRequestToken ¶
func FindBeanWebRequestToken() *WebRequestToken
FindBeanWebRequestToken
func NewWebRequestToken ¶
func NewWebRequestToken() *WebRequestToken
type WebUserId ¶
type WebUserId struct { basedto.BaseEntity Id int64 `json:"id"` ShopId int64 `json:"shop_id"` ShopMemberId int64 `json:"shop_member_id"` ShopName string `json:"shop_name"` ShopMemberName string `json:"shop_member_name"` TenantId string `json:"tenant_id"` JobId int64 `json:"job_id"` AccountId int64 `json:"account_id"` RootShopId int64 `json:"root_shop_id"` Name string `json:"name"` EmployeeAccountId int64 `json:"employee_account_id"` ShopMemberShortName string `json:"shop_member_short_name"` ShopShortName string `json:"shop_short_name"` Station string `json:"station"` StationShopId int64 `json:"station_shop_id"` CurrencyId int64 `json:"currency_id"` TaxId int64 `json:"tax_id"` }
func DefaultWebUserId ¶
func DefaultWebUserId() *WebUserId
func NewWebUserId ¶
func NewWebUserId() *WebUserId
func NullWebUserId ¶
func NullWebUserId() *WebUserId
Source Files ¶
Click to show internal directories.
Click to hide internal directories.