Add Print Detail
This commit is contained in:
@@ -18,6 +18,7 @@ type Context interface {
|
||||
IsCasheer() bool
|
||||
GetPartnerID() *int64
|
||||
GetSiteID() *int64
|
||||
GetName() string
|
||||
}
|
||||
|
||||
type MyContextImpl struct {
|
||||
@@ -28,6 +29,7 @@ type MyContextImpl struct {
|
||||
partnerID int64
|
||||
roleID int
|
||||
siteID int64
|
||||
name string
|
||||
}
|
||||
|
||||
func (m *MyContextImpl) RequestedBy() int64 {
|
||||
@@ -64,6 +66,10 @@ func (m *MyContextImpl) GetSiteID() *int64 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MyContextImpl) GetName() string {
|
||||
return m.name
|
||||
}
|
||||
|
||||
func NewMyContext(parent context.Context, claims *entity.JWTAuthClaims) (*MyContextImpl, error) {
|
||||
return &MyContextImpl{
|
||||
Context: parent,
|
||||
@@ -71,6 +77,7 @@ func NewMyContext(parent context.Context, claims *entity.JWTAuthClaims) (*MyCont
|
||||
partnerID: claims.PartnerID,
|
||||
roleID: claims.Role,
|
||||
siteID: claims.SiteID,
|
||||
name: claims.Name,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user