fix comment again

This commit is contained in:
Hoang 2021-11-11 15:19:38 +07:00
parent 8d19c4c09c
commit 4ee176b9e0
1 changed files with 0 additions and 38 deletions

View File

@ -7,20 +7,9 @@ import (
"github.com/Selly-Modules/logger" "github.com/Selly-Modules/logger"
"github.com/Selly-Modules/usermngmt/database" "github.com/Selly-Modules/usermngmt/database"
"github.com/Selly-Modules/usermngmt/model" "github.com/Selly-Modules/usermngmt/model"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
) )
func findByID(ctx context.Context, id primitive.ObjectID) (model.DBRole, error) {
var (
doc model.DBRole
col = database.GetRoleCol()
)
err := col.FindOne(ctx, bson.M{"_id": id}).Decode(&doc)
return doc, err
}
func create(ctx context.Context, doc model.DBRole) error { func create(ctx context.Context, doc model.DBRole) error {
var ( var (
col = database.GetRoleCol() col = database.GetRoleCol()
@ -54,33 +43,6 @@ func updateOneByCondition(ctx context.Context, cond interface{}, payload interfa
return err return err
} }
func permissionFindByCondition(ctx context.Context, cond interface{}, opts ...*options.FindOptions) (docs []model.DBPermission) {
var (
col = database.GetPermissionCol()
)
docs = make([]model.DBPermission, 0)
cursor, err := col.Find(ctx, cond, opts...)
if err != nil {
logger.Error("usermngmt - Permission - Find", logger.LogData{
"cond": cond,
"opts": opts,
"err": err.Error(),
})
return
}
defer cursor.Close(ctx)
if err = cursor.All(ctx, &docs); err != nil {
logger.Error("usermngmt - Permission - Decode", logger.LogData{
"cond": cond,
"opts": opts,
"err": err.Error(),
})
return
}
return
}
func findByCondition(ctx context.Context, cond interface{}, opts ...*options.FindOptions) (docs []model.DBRole) { func findByCondition(ctx context.Context, cond interface{}, opts ...*options.FindOptions) (docs []model.DBRole) {
var ( var (
col = database.GetRoleCol() col = database.GetRoleCol()