Skip to content

Commit

Permalink
Updated with Joke Service Implementation. Closes springframeworkguru#58
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhDatar committed Dec 10, 2022
1 parent 5d2e4c2 commit ff43929
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>guru.springframework</groupId>
<artifactId>chuck-norris-for-actuator</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.springframework.spring5jokesappv2.services;

public interface JokeService {

String getJoke();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.springframework.spring5jokesappv2.services;

import guru.springframework.norris.chuck.ChuckNorrisQuotes;
import org.springframework.stereotype.Service;

@Service
public class JokeServiceImpl implements JokeService{
private final ChuckNorrisQuotes chuckNorrisQuotes;

public JokeServiceImpl(){
this.chuckNorrisQuotes = new ChuckNorrisQuotes();
}

@Override
public String getJoke() {
return chuckNorrisQuotes.getRandomQuote();
}
}

0 comments on commit ff43929

Please sign in to comment.