webdto

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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

Functions

func IfExistUserId

func IfExistUserId(c *gin.Context) bool

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

func PlatformshopId(shop_id string) string

func SetUserId

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

SetUserId 设定用户ID

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 DefaultOf

func DefaultOf(res string, method string, path string) *WebCheckRes

func DefaultResof

func DefaultResof(res string) *WebCheckRes

func FindBeanWebCheckRes

func FindBeanWebCheckRes() *WebCheckRes

FindBeanWebCheckRes

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 FindBeanWebCheckResult

func FindBeanWebCheckResult() *WebCheckResult

FindBeanWebCheckResult

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 FindBeanWebContext

func FindBeanWebContext() *WebContext

FindBeanWebContext

func NewWebContext

func NewWebContext() *WebContext

func (*WebContext) BackendGetUserId

func (wcc *WebContext) BackendGetUserId(ctx context.Context) *WebUserId

Backend 获取上下文信息

func (*WebContext) GetUserId

func (wcc *WebContext) GetUserId(c *gin.Context) *WebUserId

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 FindBeanWebUserId

func FindBeanWebUserId() *WebUserId

FindBeanWebUserId

func GetUserId

func GetUserId(c *gin.Context) *WebUserId

func GetUserIdErr

func GetUserIdErr(c *gin.Context) (*WebUserId, error)

func NewWebUserId

func NewWebUserId() *WebUserId

func NullWebUserId

func NullWebUserId() *WebUserId

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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