Class PostSlugUpdater

java.lang.Object
com.example.blogs.app.api.post.service.PostSlugUpdater

@Service public class PostSlugUpdater extends Object
Updates post slugs by regenerating them from the updated title when necessary.
  • Constructor Details

    • PostSlugUpdater

      public PostSlugUpdater()
  • Method Details

    • apply

      public void apply(PostEntity post, PostUpdateRequestDTO dto)
      Applies slug update to a post entity if the title is being changed. Generates a new slug from the title when a non-blank title is provided.
      Parameters:
      post - the post entity to update
      dto - the update request containing the new title