fix comment again
This commit is contained in:
parent
d423c25256
commit
b954532159
28
action.go
28
action.go
|
@ -6,13 +6,19 @@ import (
|
|||
"github.com/Selly-Modules/usermngmt/user"
|
||||
)
|
||||
|
||||
// Create ...
|
||||
func (s Service) Create(payload model.UserCreateOptions) error {
|
||||
//
|
||||
// User
|
||||
//
|
||||
|
||||
// user methods
|
||||
|
||||
// CreateUser ...
|
||||
func (s Service) CreateUser(payload model.UserCreateOptions) error {
|
||||
return user.Create(payload)
|
||||
}
|
||||
|
||||
// Update ...
|
||||
func (s Service) Update(userID string, payload model.UserUpdateOptions) error {
|
||||
// UpdateUser ...
|
||||
func (s Service) UpdateUser(userID string, payload model.UserUpdateOptions) error {
|
||||
return user.UpdateByUserID(userID, payload)
|
||||
}
|
||||
|
||||
|
@ -26,12 +32,18 @@ func (s Service) ChangeUserStatus(userID, newStatus string) error {
|
|||
return user.ChangeUserStatus(userID, newStatus)
|
||||
}
|
||||
|
||||
// All ...
|
||||
func (s Service) All(query model.UserAllQuery) model.UserAll {
|
||||
// GetAllUser ...
|
||||
func (s Service) GetAllUser(query model.UserAllQuery) model.UserAll {
|
||||
return user.All(query)
|
||||
}
|
||||
|
||||
// RoleCreate ...
|
||||
func (s Service) RoleCreate(payload model.RoleCreateOptions) error {
|
||||
//
|
||||
// Role
|
||||
//
|
||||
|
||||
// role methods
|
||||
|
||||
// CreateRole ...
|
||||
func (s Service) CreateRole(payload model.RoleCreateOptions) error {
|
||||
return role.Create(payload)
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package usermngmt
|
||||
|
||||
// Constant ...
|
||||
const (
|
||||
tablePrefixDefault = "usermngmt"
|
||||
)
|
|
@ -5,4 +5,6 @@ const (
|
|||
timezoneHCM = "Asia/Ho_Chi_Minh"
|
||||
|
||||
passwordHashingCost = 14
|
||||
|
||||
TablePrefixDefault = "usermngmt"
|
||||
)
|
||||
|
|
|
@ -4,4 +4,3 @@ package model
|
|||
type RoleCreateOptions struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
|
|
|
@ -5,4 +5,4 @@ type RoleShort struct {
|
|||
ID string `json:"_id"`
|
||||
Name string `json:"name"`
|
||||
IsAdmin bool `json:"isAdmin"`
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"github.com/Selly-Modules/mongodb"
|
||||
"github.com/Selly-Modules/usermngmt/database"
|
||||
"github.com/Selly-Modules/usermngmt/internal"
|
||||
)
|
||||
|
||||
// MongoDBConfig ...
|
||||
|
@ -36,7 +37,7 @@ func Init(config Config) (*Service, error) {
|
|||
|
||||
// If prefixTable is empty then it is usermngmt
|
||||
if config.TablePrefix == "" {
|
||||
config.TablePrefix = tablePrefixDefault
|
||||
config.TablePrefix = internal.TablePrefixDefault
|
||||
}
|
||||
|
||||
// Connect MongoDB
|
||||
|
|
Loading…
Reference in New Issue