feat: complete API-driven projects with infrastructure and business acceptance
This commit is contained in:
16
examples/userService/internal/service/user/deleteUser.go
Normal file
16
examples/userService/internal/service/user/deleteUser.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"example.com/userService/internal/model"
|
||||
repo "example.com/userService/internal/repository/user"
|
||||
"example.com/userService/internal/types"
|
||||
)
|
||||
|
||||
func (s *Service) DeleteUser(ctx context.Context, req *types.UserIDReq) error {
|
||||
_, err := s.mutate(ctx, "deleted", func(r repo.UserRepository) (model.User, error) {
|
||||
err := r.Delete(ctx, req.ID)
|
||||
return model.User{ID: req.ID}, err
|
||||
})
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user