api change user password

This commit is contained in:
Efril
2026-01-14 14:08:27 +07:00
parent 057cccfef9
commit c8ea680e05
11 changed files with 89 additions and 23 deletions
+1
View File
@@ -17,6 +17,7 @@ type UserProcessor interface {
GetUserByEmail(ctx context.Context, email string) (*contract.UserResponse, error)
GetUserEntityByEmail(ctx context.Context, email string) (*entities.User, error)
ChangePassword(ctx context.Context, userID uuid.UUID, req *contract.ChangePasswordRequest) error
ChangeUserPassword(ctx context.Context, userID uuid.UUID, req *contract.ChangeUserPasswordRequest) error
GetUserRoles(ctx context.Context, userID uuid.UUID) ([]contract.RoleResponse, error)
GetUserPermissionCodes(ctx context.Context, userID uuid.UUID) ([]string, error)
+7 -3
View File
@@ -52,7 +52,7 @@ func (s *UserServiceImpl) ListUsers(ctx context.Context, req *contract.ListUsers
if page <= 0 {
page = 1
}
limit := req.Limit
if limit <= 0 {
limit = 10
@@ -60,7 +60,7 @@ func (s *UserServiceImpl) ListUsers(ctx context.Context, req *contract.ListUsers
if limit > 100 {
limit = 100 // Max limit to prevent performance issues
}
offset := (page - 1) * limit
// Pass calculated offset and limit to processor
@@ -79,6 +79,10 @@ func (s *UserServiceImpl) ChangePassword(ctx context.Context, userID uuid.UUID,
return s.userProcessor.ChangePassword(ctx, userID, req)
}
func (s *UserServiceImpl) ChangeUserPassword(ctx context.Context, userID uuid.UUID, req *contract.ChangeUserPasswordRequest) error {
return s.userProcessor.ChangeUserPassword(ctx, userID, req)
}
func (s *UserServiceImpl) GetProfile(ctx context.Context, userID uuid.UUID) (*contract.UserProfileResponse, error) {
prof, err := s.userProcessor.GetUserProfile(ctx, userID)
if err != nil {
@@ -114,6 +118,6 @@ func (s *UserServiceImpl) GetActiveUsersForMention(ctx context.Context, search *
if limit > 100 {
limit = 100 // Max limit to prevent performance issues
}
return s.userProcessor.GetActiveUsersForMention(ctx, search, limit)
}