usermngmt/action.go

33 lines
869 B
Go
Raw Normal View History

2021-11-10 01:44:22 +00:00
package usermngmt
2021-11-10 02:54:49 +00:00
import (
"github.com/Selly-Modules/usermngmt/internal/model"
)
2021-11-10 01:44:22 +00:00
// Create ...
2021-11-10 02:54:49 +00:00
func (s Service) Create(payload model.CreateOptions) error {
return s.handler.User.Create(payload)
2021-11-10 01:44:22 +00:00
}
// Update ...
2021-11-10 02:54:49 +00:00
func (s Service) Update(userID string, payload model.UpdateOptions) error {
return s.handler.User.UpdateByUserID(userID, payload)
2021-11-10 01:44:22 +00:00
}
// ChangeUserPassword ...
2021-11-10 02:54:49 +00:00
func (s Service) ChangeUserPassword(userID string, payload model.ChangePasswordOptions) error {
return s.handler.User.ChangeUserPassword(userID, payload)
2021-11-10 01:44:22 +00:00
}
func (s Service) ChangeUserStatus(userID, newStatus string) error {
2021-11-10 02:54:49 +00:00
return s.handler.User.ChangeUserStatus(userID, newStatus)
2021-11-10 01:44:22 +00:00
}
2021-11-10 02:54:49 +00:00
func (s Service) All(query model.AllQuery) model.UserAll {
return s.handler.User.All(query)
2021-11-10 01:44:22 +00:00
}
2021-11-10 02:54:49 +00:00
func (s Service) RoleCreate(payload model.RoleCreateOptions) error {
return s.handler.Role.Create(payload)
2021-11-10 01:44:22 +00:00
}