unified code verification service
This commit is contained in:
20
api/pkg/mutil/mzap/account.go
Normal file
20
api/pkg/mutil/mzap/account.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package mzap
|
||||
|
||||
import (
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mutil/mask"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func AccRef(accountRef bson.ObjectID) zap.Field {
|
||||
return ObjRef("account_ref", accountRef)
|
||||
}
|
||||
|
||||
func Email(email string) zap.Field {
|
||||
return zap.String("email", mask.Email(email))
|
||||
}
|
||||
|
||||
func Login(account *model.Account) zap.Field {
|
||||
return Email(account.Login)
|
||||
}
|
||||
@@ -13,7 +13,3 @@ func ObjRef(name string, objRef bson.ObjectID) zap.Field {
|
||||
func StorableRef(obj storable.Storable) zap.Field {
|
||||
return ObjRef(obj.Collection()+"_ref", *obj.GetID())
|
||||
}
|
||||
|
||||
func AccRef(accountRef bson.ObjectID) zap.Field {
|
||||
return ObjRef("account_ref", accountRef)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user